Package weka.classifiers.meta
Class ClassificationViaRegression
java.lang.Object
weka.classifiers.AbstractClassifier
weka.classifiers.SingleClassifierEnhancer
weka.classifiers.meta.ClassificationViaRegression
- All Implemented Interfaces:
Serializable
,Cloneable
,Classifier
,BatchPredictor
,CapabilitiesHandler
,CapabilitiesIgnorer
,CommandlineRunnable
,OptionHandler
,RevisionHandler
,TechnicalInformationHandler
,WeightedInstancesHandler
public class ClassificationViaRegression
extends SingleClassifierEnhancer
implements TechnicalInformationHandler, WeightedInstancesHandler
Class for doing classification using regression methods. Class is binarized and one regression model is built for each class value. For more information, see, for example
E. Frank, Y. Wang, S. Inglis, G. Holmes, I.H. Witten (1998). Using model trees for classification. Machine Learning. 32(1):63-76. BibTeX:
E. Frank, Y. Wang, S. Inglis, G. Holmes, I.H. Witten (1998). Using model trees for classification. Machine Learning. 32(1):63-76. BibTeX:
@article{Frank1998, author = {E. Frank and Y. Wang and S. Inglis and G. Holmes and I.H. Witten}, journal = {Machine Learning}, number = {1}, pages = {63-76}, title = {Using model trees for classification}, volume = {32}, year = {1998} }Valid options are:
-D If set, classifier is run in debug mode and may output additional info to the console
-W Full name of base classifier. (default: weka.classifiers.trees.M5P)
Options specific to classifier weka.classifiers.trees.M5P:
-N Use unpruned tree/rules
-U Use unsmoothed predictions
-R Build regression tree/rule rather than a model tree/rule
-M <minimum number of instances> Set minimum number of instances per leaf (default 4)
-L Save instances at the nodes in the tree (for visualization purposes)
- Version:
- $Revision: 15481 $
- Author:
- Eibe Frank (eibe@cs.waikato.ac.nz), Len Trigg (trigg@cs.waikato.ac.nz)
- See Also:
-
Field Summary
Fields inherited from class weka.classifiers.AbstractClassifier
BATCH_SIZE_DEFAULT, NUM_DECIMAL_PLACES_DEFAULT
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
buildClassifier
(Instances insts) Builds the classifiers.double[]
Returns the distribution for an instance.double[][]
Returns predictions for a whole set of instances.Returns default capabilities of the classifier.Returns the revision string.Returns an instance of a TechnicalInformation object, containing detailed information about the technical background of this class, e.g., paper reference or book this class is based on.Returns a string describing classifierboolean
Return whether this classifier configuration yields more efficient batch predictionstatic void
Main method for testing this class.toString()
Prints the classifiers.Methods inherited from class weka.classifiers.SingleClassifierEnhancer
classifierTipText, getClassifier, getOptions, listOptions, postExecution, preExecution, setClassifier, setOptions
Methods inherited from class weka.classifiers.AbstractClassifier
batchSizeTipText, classifyInstance, debugTipText, doNotCheckCapabilitiesTipText, forName, getBatchSize, getDebug, getDoNotCheckCapabilities, getNumDecimalPlaces, makeCopies, makeCopy, numDecimalPlacesTipText, run, runClassifier, setBatchSize, setDebug, setDoNotCheckCapabilities, setNumDecimalPlaces
-
Constructor Details
-
ClassificationViaRegression
public ClassificationViaRegression()Default constructor.
-
-
Method Details
-
globalInfo
Returns a string describing classifier- Returns:
- a description suitable for displaying in the explorer/experimenter gui
-
getTechnicalInformation
Returns an instance of a TechnicalInformation object, containing detailed information about the technical background of this class, e.g., paper reference or book this class is based on.- Specified by:
getTechnicalInformation
in interfaceTechnicalInformationHandler
- Returns:
- the technical information about this class
-
getCapabilities
Returns default capabilities of the classifier.- Specified by:
getCapabilities
in interfaceCapabilitiesHandler
- Specified by:
getCapabilities
in interfaceClassifier
- Overrides:
getCapabilities
in classSingleClassifierEnhancer
- Returns:
- the capabilities of this classifier
- See Also:
-
buildClassifier
Builds the classifiers.- Specified by:
buildClassifier
in interfaceClassifier
- Parameters:
insts
- the training data.- Throws:
Exception
- if a classifier can't be built
-
distributionForInstance
Returns the distribution for an instance.- Specified by:
distributionForInstance
in interfaceClassifier
- Overrides:
distributionForInstance
in classAbstractClassifier
- Parameters:
inst
- the instance to get the distribution for- Returns:
- the computed distribution
- Throws:
Exception
- if the distribution can't be computed successfully
-
implementsMoreEfficientBatchPrediction
public boolean implementsMoreEfficientBatchPrediction()Return whether this classifier configuration yields more efficient batch prediction- Specified by:
implementsMoreEfficientBatchPrediction
in interfaceBatchPredictor
- Overrides:
implementsMoreEfficientBatchPrediction
in classAbstractClassifier
- Returns:
- the base classifier's flag indicating whether it can do batch prediction efficiently
-
distributionsForInstances
Returns predictions for a whole set of instances.- Specified by:
distributionsForInstances
in interfaceBatchPredictor
- Overrides:
distributionsForInstances
in classAbstractClassifier
- Parameters:
insts
- the instances to make predictions for- Returns:
- the 2D array with results
- Throws:
Exception
- if a problem occurs.
-
toString
Prints the classifiers. -
getRevision
Returns the revision string.- Specified by:
getRevision
in interfaceRevisionHandler
- Overrides:
getRevision
in classAbstractClassifier
- Returns:
- the revision
-
main
Main method for testing this class.- Parameters:
argv
- the options for the learner
-