public class PreConstructedLinearModel extends AbstractClassifier implements java.io.Serializable
BATCH_SIZE_DEFAULT, NUM_DECIMAL_PLACES_DEFAULT| Constructor and Description |
|---|
PreConstructedLinearModel(double[] coeffs,
double intercept)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
buildClassifier(Instances instances)
Builds the classifier.
|
double |
classifyInstance(Instance inst)
Predicts the class of the supplied instance using the linear model.
|
double[] |
coefficients()
Return the array of coefficients
|
java.lang.String |
getRevision()
Returns the revision string.
|
double |
intercept()
Return the intercept
|
int |
numParameters()
Return the number of parameters (coefficients) in the linear model
|
java.lang.String |
toString()
Returns a textual description of this linear model
|
batchSizeTipText, debugTipText, distributionForInstance, distributionsForInstances, doNotCheckCapabilitiesTipText, forName, getBatchSize, getCapabilities, getDebug, getDoNotCheckCapabilities, getNumDecimalPlaces, getOptions, implementsMoreEfficientBatchPrediction, listOptions, makeCopies, makeCopy, numDecimalPlacesTipText, postExecution, preExecution, run, runClassifier, setBatchSize, setDebug, setDoNotCheckCapabilities, setNumDecimalPlaces, setOptionsequals, getClass, hashCode, notify, notifyAll, wait, wait, waitmakeCopypublic PreConstructedLinearModel(double[] coeffs,
double intercept)
coeffs - an array of coefficientsintercept - the interceptpublic void buildClassifier(Instances instances) throws java.lang.Exception
buildClassifier in interface Classifierinstances - an Instances valuejava.lang.Exception - if an error occurspublic double classifyInstance(Instance inst) throws java.lang.Exception
classifyInstance in interface ClassifierclassifyInstance in class AbstractClassifierinst - the instance to make a prediction forjava.lang.Exception - if an error occurspublic int numParameters()
public double[] coefficients()
public double intercept()
public java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String getRevision()
getRevision in interface RevisionHandlergetRevision in class AbstractClassifier