netkit.classifiers.relational
Class NetworkMetaClassifier
java.lang.Object
netkit.classifiers.ClassifierImp
netkit.classifiers.relational.NetworkClassifierImp
netkit.classifiers.relational.NetworkMetaClassifier
- All Implemented Interfaces:
- Classifier, NetworkClassifier, Configurable
- Direct Known Subclasses:
- MetaMultiplicative
public abstract class NetworkMetaClassifier
- extends NetworkClassifierImp
Abstract class for combining multiple relational and non-relational classifiers. It configures itsel
with the list of (non-)relational classifiers to use and induces them individually. How to combine them
is left to subclasses. It uses the
Networklearning.LC_PREFIX
and
Networklearning.RC_PREFIX
properties from the configuration details
specified in the lclassifier.properties
and rclassifier.properties
files (in addition to any properties used by the superclass).
Properties
- NetworkLearning.LC_PREFIX: what non-relational classifiers to use. default=naivebayes (see
lclassifier.properties
)
- NetworkLearning.RC_PREFIX: what relational classifiers to use. default=naivebayes (see
rclassifier.properties
)
- Author:
- Sofus A. Macskassy (sofmac@gmail.com)
- See Also:
NetworkLearning.LC_PREFIX
,
NetworkLearning.RC_PREFIX
Fields inherited from class netkit.classifiers.ClassifierImp |
attribute, classPrior, clsIdx, graph, keyIndex, logger, nodeType, right, tmpVector, useIntrinsic, vectorClsIdx |
Method Summary |
void |
configure(Configuration config)
Configure this classifier by getting the Weka classifier object using the classifier
and options properties in addition to anything used by the superclass. |
protected java.lang.String |
getClassifierNames()
Returns the list of classifier names in the format: "RC[relational_classifiers] LC[nonrelational_classifiers]"
where the list of classifiers is comma-separated and appear exactly is it was in the configuration object
that was used to configure this classifier. |
Configuration |
getDefaultConfiguration()
Get the detault configuration of using a naive Bayes classifier both as the single non-relational and the
single relational classifier.. |
void |
induceModel(Graph graph,
DataSplit split)
This separately induces all the non-relational and relational classifiers in addition to any
setup the super-class needs to do. |
Methods inherited from class netkit.classifiers.relational.NetworkClassifierImp |
classify, doEstimate, estimate, estimate, estimate, estimate, generateAggregators, getAttributeNames, includeClassAttribute, initializeRun, makeVector |
Methods inherited from class netkit.classifiers.ClassifierImp |
addListener, classify, classify, clearListeners, estimate, estimate, getLogger, getNofifyListeners, notifyListeners, notifyListeners, removeListener, reset, setNofityListeners |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface netkit.classifiers.Classifier |
addListener, classify, classify, clearListeners, estimate, estimate, getDescription, getLogger, getName, getNofifyListeners, getShortName, notifyListeners, notifyListeners, removeListener, reset, setNofityListeners |
rclassifiers
protected java.util.ArrayList<NetworkClassifier> rclassifiers
- The list of relational classifiers to use
lclassifiers
protected java.util.ArrayList<Classifier> lclassifiers
- The list of non-relational classifiers to use
NetworkMetaClassifier
public NetworkMetaClassifier()
getDefaultConfiguration
public Configuration getDefaultConfiguration()
- Get the detault configuration of using a naive Bayes classifier both as the single non-relational and the
single relational classifier.. This is in addition to any defaults set by the superclass.
- Specified by:
getDefaultConfiguration
in interface Configurable
- Overrides:
getDefaultConfiguration
in class NetworkClassifierImp
- Returns:
- a Configuration object
- See Also:
NetworkClassifierImp.getDefaultConfiguration()
configure
public void configure(Configuration config)
- Configure this classifier by getting the Weka classifier object using the
classifier
and options
properties in addition to anything used by the superclass. The classifier
property defines the weka classifier (this name should resolve to a real weka class name in the
weka.properties
file). The options property defines the options string to pass to
the weka classifier.
By default, this will use a naive Bayes classifier both as the single non-relational and the
single relational classifier.
- Specified by:
configure
in interface Configurable
- Overrides:
configure
in class NetworkClassifierImp
- Parameters:
config
- The configuration object used to configure this classifier- See Also:
NetworkClassifierImp.configure(netkit.util.Configuration)
induceModel
public void induceModel(Graph graph,
DataSplit split)
- This separately induces all the non-relational and relational classifiers in addition to any
setup the super-class needs to do.
- Specified by:
induceModel
in interface Classifier
- Overrides:
induceModel
in class NetworkClassifierImp
- Parameters:
graph
- The graph over which a model is inducedsplit
- The datasplit that specifies which nodes have their class labels known- See Also:
NetworkClassifierImp.induceModel(netkit.graph.Graph, netkit.classifiers.DataSplit)
getClassifierNames
protected java.lang.String getClassifierNames()
- Returns the list of classifier names in the format: "RC[relational_classifiers] LC[nonrelational_classifiers]"
where the list of classifiers is comma-separated and appear exactly is it was in the configuration object
that was used to configure this classifier.
- Returns:
- the list of classifier names from the configuration object when configure was called
- See Also:
configure(netkit.util.Configuration)