public class Logistic extends AbstractClassifier implements OptionHandler, WeightedInstancesHandler, TechnicalInformationHandler, PMMLProducer, Aggregateable<Logistic>
@article{leCessie1992, author = {le Cessie, S. and van Houwelingen, J.C.}, journal = {Applied Statistics}, number = {1}, pages = {191-201}, title = {Ridge Estimators in Logistic Regression}, volume = {41}, year = {1992} }Valid options are:
-D Turn on debugging output.
-S Do not standardize the attributes in the input data.
-R <ridge> Set the ridge in the log-likelihood.
-M <number> Set the maximum number of iterations (default -1, until convergence).
BATCH_SIZE_DEFAULT, NUM_DECIMAL_PLACES_DEFAULT
Constructor and Description |
---|
Logistic()
Constructor that sets the default number of decimal places to 4.
|
Modifier and Type | Method and Description |
---|---|
Logistic |
aggregate(Logistic toAggregate)
Aggregate an object with this one
|
void |
buildClassifier(Instances train)
Builds the classifier
|
double[][] |
coefficients()
Returns the coefficients for this logistic model.
|
java.lang.String |
debugTipText()
Returns the tip text for this property
|
double[] |
distributionForInstance(Instance instance)
Computes the distribution for a given instance
|
java.lang.String |
doNotStandardizeAttributesTipText()
Returns the tip text for this property
|
void |
finalizeAggregation()
Call to complete the aggregation process.
|
Capabilities |
getCapabilities()
Returns default capabilities of the classifier.
|
boolean |
getDebug()
Gets whether debugging output will be printed.
|
boolean |
getDoNotStandardizeAttributes()
Gets whether not to standardize attributes.
|
int |
getMaxIts()
Get the value of MaxIts.
|
java.lang.String[] |
getOptions()
Gets the current settings of the classifier.
|
java.lang.String |
getRevision()
Returns the revision string.
|
double |
getRidge()
Gets the ridge in the log-likelihood.
|
TechnicalInformation |
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.
|
boolean |
getUseConjugateGradientDescent()
Gets whether to use conjugate gradient descent rather than BFGS updates.
|
java.lang.String |
globalInfo()
Returns a string describing this classifier
|
java.util.Enumeration<Option> |
listOptions()
Returns an enumeration describing the available options
|
static void |
main(java.lang.String[] argv)
Main method for testing this class.
|
java.lang.String |
maxItsTipText()
Returns the tip text for this property
|
java.lang.String |
ridgeTipText()
Returns the tip text for this property
|
void |
setDebug(boolean debug)
Sets whether debugging output will be printed.
|
void |
setDoNotStandardizeAttributes(boolean DoNotStandardizeAttributes)
Sets whether not to standardize attributes
|
void |
setMaxIts(int newMaxIts)
Set the value of MaxIts.
|
void |
setOptions(java.lang.String[] options)
Parses a given list of options.
|
void |
setRidge(double ridge)
Sets the ridge in the log-likelihood.
|
void |
setUseConjugateGradientDescent(boolean useConjugateGradientDescent)
Sets whether conjugate gradient descent is used.
|
java.lang.String |
toPMML(Instances train)
Produce a PMML representation of this logistic model
|
java.lang.String |
toString()
Gets a string describing the classifier.
|
java.lang.String |
useConjugateGradientDescentTipText()
Returns the tip text for this property
|
batchSizeTipText, classifyInstance, distributionsForInstances, doNotCheckCapabilitiesTipText, forName, getBatchSize, getDoNotCheckCapabilities, getNumDecimalPlaces, implementsMoreEfficientBatchPrediction, makeCopies, makeCopy, numDecimalPlacesTipText, postExecution, preExecution, run, runClassifier, setBatchSize, setDoNotCheckCapabilities, setNumDecimalPlaces
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
makeCopy
public Logistic()
public java.lang.String globalInfo()
public TechnicalInformation getTechnicalInformation()
getTechnicalInformation
in interface TechnicalInformationHandler
public java.util.Enumeration<Option> listOptions()
listOptions
in interface OptionHandler
listOptions
in class AbstractClassifier
public void setOptions(java.lang.String[] options) throws java.lang.Exception
-D Turn on debugging output.
-S Do not standardize the attributes in the input data.
-R <ridge> Set the ridge in the log-likelihood.
-M <number> Set the maximum number of iterations (default -1, until convergence).
setOptions
in interface OptionHandler
setOptions
in class AbstractClassifier
options
- the list of options as an array of stringsjava.lang.Exception
- if an option is not supportedpublic java.lang.String[] getOptions()
getOptions
in interface OptionHandler
getOptions
in class AbstractClassifier
public java.lang.String debugTipText()
debugTipText
in class AbstractClassifier
public void setDebug(boolean debug)
setDebug
in class AbstractClassifier
debug
- true if debugging output should be printedpublic boolean getDebug()
getDebug
in class AbstractClassifier
public java.lang.String useConjugateGradientDescentTipText()
public void setUseConjugateGradientDescent(boolean useConjugateGradientDescent)
useConjugateGradientDescent
- true if CGD is to be used.public boolean getUseConjugateGradientDescent()
public java.lang.String doNotStandardizeAttributesTipText()
public void setDoNotStandardizeAttributes(boolean DoNotStandardizeAttributes)
DoNotStandardizeAttributes
- true if attributes are not to be standardizepublic boolean getDoNotStandardizeAttributes()
public java.lang.String ridgeTipText()
public void setRidge(double ridge)
ridge
- the ridgepublic double getRidge()
public java.lang.String maxItsTipText()
public int getMaxIts()
public void setMaxIts(int newMaxIts)
newMaxIts
- Value to assign to MaxIts.public Capabilities getCapabilities()
getCapabilities
in interface Classifier
getCapabilities
in interface CapabilitiesHandler
getCapabilities
in class AbstractClassifier
Capabilities
public void buildClassifier(Instances train) throws java.lang.Exception
buildClassifier
in interface Classifier
train
- the training data to be used for generating the boosted
classifier.java.lang.Exception
- if the classifier could not be built successfullypublic double[] distributionForInstance(Instance instance) throws java.lang.Exception
distributionForInstance
in interface Classifier
distributionForInstance
in class AbstractClassifier
instance
- the instance for which distribution is computedjava.lang.Exception
- if the distribution can't be computed successfullypublic double[][] coefficients()
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String getRevision()
getRevision
in interface RevisionHandler
getRevision
in class AbstractClassifier
public Logistic aggregate(Logistic toAggregate) throws java.lang.Exception
aggregate
in interface Aggregateable<Logistic>
toAggregate
- the object to aggregatejava.lang.Exception
- if the supplied object can't be aggregated for some
reasonpublic void finalizeAggregation() throws java.lang.Exception
finalizeAggregation
in interface Aggregateable<Logistic>
java.lang.Exception
- if the aggregation can't be finalized for some reasonpublic static void main(java.lang.String[] argv)
argv
- should contain the command line arguments to the scheme (see
Evaluation)public java.lang.String toPMML(Instances train)
toPMML
in interface PMMLProducer
train
- the training data that was used to construct the model