All Packages Class Hierarchy This Package Previous Next Index WEKA's home
Class weka.classifiers.Logistic
java.lang.Object
|
+----weka.classifiers.Classifier
|
+----weka.classifiers.DistributionClassifier
|
+----weka.classifiers.Logistic
- public class Logistic
- extends DistributionClassifier
- implements OptionHandler
Class for building and using a two-class logistic regression model.
Missing values are replaced using a ReplaceMissingValuesFilter, and
nominal attributes are transformed into numeric attributes using a
NominalToBinaryFilter.
Valid options are:
-D
Turn on debugging output.
- Version:
- $Revision: 1.5 $
- Author:
- Len Trigg (trigg@cs.waikato.ac.nz)
-
Logistic()
-
-
buildClassifier(Instances)
- Builds the classifier
-
distributionForInstance(Instance)
- Computes the distribution for a given instance
-
getDebug()
- Gets whether debugging output will be printed.
-
getOptions()
- Gets the current settings of the classifier.
-
listOptions()
- Returns an enumeration describing the available options
-
main(String[])
- Main method for testing this class.
-
setDebug(boolean)
- Sets whether debugging output will be printed.
-
setOptions(String[])
- Parses a given list of options.
-
toString()
- Gets a string describing the classifier.
Logistic
public Logistic()
listOptions
public Enumeration listOptions()
- Returns an enumeration describing the available options
- Returns:
- an enumeration of all the available options
setOptions
public void setOptions(String options[]) throws Exception
- Parses a given list of options. Valid options are:
-D
Turn on debugging output.
- Parameters:
- options - the list of options as an array of strings
- Throws: Exception
- if an option is not supported
getOptions
public String[] getOptions()
- Gets the current settings of the classifier.
- Returns:
- an array of strings suitable for passing to setOptions
setDebug
public void setDebug(boolean debug)
- Sets whether debugging output will be printed.
- Parameters:
- debug - true if debugging output should be printed
getDebug
public boolean getDebug()
- Gets whether debugging output will be printed.
- Returns:
- true if debugging output will be printed
buildClassifier
public void buildClassifier(Instances train) throws Exception
- Builds the classifier
- Parameters:
- data - the training data to be used for generating the
boosted classifier.
- Throws: Exception
- if the classifier could not be built successfully
- Overrides:
- buildClassifier in class Classifier
distributionForInstance
public double[] distributionForInstance(Instance instance) throws Exception
- Computes the distribution for a given instance
- Parameters:
- instance - the instance for which distribution is computed
- Returns:
- the distribution
- Throws: Exception
- if the distribution can't be computed successfully
- Overrides:
- distributionForInstance in class DistributionClassifier
toString
public String toString()
- Gets a string describing the classifier.
- Returns:
- a string describing the classifer built.
- Overrides:
- toString in class Object
main
public static void main(String argv[])
- Main method for testing this class.
- Parameters:
- argv - should contain the command line arguments to the
scheme (see Evaluation)
All Packages Class Hierarchy This Package Previous Next Index WEKA's home