public class PreConstructedLinearModel extends AbstractClassifier implements Serializable
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
|
String |
getRevision()
Returns the revision string.
|
double |
intercept()
Return the intercept
|
int |
numParameters()
Return the number of parameters (coefficients) in the linear model
|
String |
toString()
Returns a textual description of this linear model
|
debugTipText, distributionForInstance, forName, getCapabilities, getDebug, getOptions, listOptions, makeCopies, makeCopy, runClassifier, setDebug, setOptions
public PreConstructedLinearModel(double[] coeffs, double intercept)
coeffs
- an array of coefficientsintercept
- the interceptpublic void buildClassifier(Instances instances) throws Exception
buildClassifier
in interface Classifier
instances
- an Instances
valueException
- if an error occurspublic double classifyInstance(Instance inst) throws Exception
classifyInstance
in interface Classifier
classifyInstance
in class AbstractClassifier
inst
- the instance to make a prediction forException
- if an error occurspublic int numParameters()
public double[] coefficients()
public double intercept()
public String toString()
public String getRevision()
getRevision
in interface RevisionHandler
getRevision
in class AbstractClassifier
Copyright © 2012 University of Waikato, Hamilton, NZ. All Rights Reserved.