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)

Constructor Index

 o Logistic()

Method Index

 o buildClassifier(Instances)
Builds the classifier
 o distributionForInstance(Instance)
Computes the distribution for a given instance
 o getDebug()
Gets whether debugging output will be printed.
 o getOptions()
Gets the current settings of the classifier.
 o listOptions()
Returns an enumeration describing the available options
 o main(String[])
Main method for testing this class.
 o setDebug(boolean)
Sets whether debugging output will be printed.
 o setOptions(String[])
Parses a given list of options.
 o toString()
Gets a string describing the classifier.

Constructors

 o Logistic
 public Logistic()

Methods

 o listOptions
 public Enumeration listOptions()
Returns an enumeration describing the available options

Returns:
an enumeration of all the available options
 o 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
 o getOptions
 public String[] getOptions()
Gets the current settings of the classifier.

Returns:
an array of strings suitable for passing to setOptions
 o setDebug
 public void setDebug(boolean debug)
Sets whether debugging output will be printed.

Parameters:
debug - true if debugging output should be printed
 o getDebug
 public boolean getDebug()
Gets whether debugging output will be printed.

Returns:
true if debugging output will be printed
 o 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
 o 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
 o toString
 public String toString()
Gets a string describing the classifier.

Returns:
a string describing the classifer built.
Overrides:
toString in class Object
 o 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