|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.knime.base.node.mine.regression.linear.LinearRegressionContent
public final class LinearRegressionContent
Utility class that carries out the loading and saving of linear regression models. It is used by the learner node model and the predictor node model.
Constructor Summary | |
---|---|
LinearRegressionContent()
Public no arg constructor as required by super class. |
|
LinearRegressionContent(DataTableSpec spec,
double offset,
double[] multipliers,
double[] means)
Create new object with the given parameters. |
Method Summary | |
---|---|
PMMLRegressionPortObject |
createPortObject()
Creates a new PMML regression port object from this linear regression model. |
static PMMLPortObjectSpec |
createPortObjectSpec(DataTableSpec spec)
Creates a PMML port object spec based on all columns in the given data table spec. |
double |
getApproximationFor(String variable,
double v)
Does a prediction when the given variable has the value v and all other variables have their mean value. |
double[] |
getMultipliers()
|
double |
getOffset()
|
DataTableSpec |
getSpec()
|
String |
getTargetColumnName()
Get the name of the response column, i.e. |
static LinearRegressionContent |
instantiateAndLoad(ModelContentRO par,
PortObjectSpec spec)
Creates a new linear regression model that is read from the given model content object. |
protected void |
load(ModelContentRO par,
PortObjectSpec spec)
Loads a linear regression model from the given model content object. |
DataCell |
predict(DataRow row)
Predicts the target value for the given row. |
void |
save(ModelContentWO par)
Saves the regression model into the model content object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public LinearRegressionContent()
public LinearRegressionContent(DataTableSpec spec, double offset, double[] multipliers, double[] means)
spec
- The table spec of the variablesoffset
- The fixed (constant) offsetmultipliers
- multiplier valuesmeans
- means of all variables (used for 2D plot approximation)Method Detail |
---|
public PMMLRegressionPortObject createPortObject() throws InvalidSettingsException
InvalidSettingsException
- if the settings are invalidpublic static PMMLPortObjectSpec createPortObjectSpec(DataTableSpec spec) throws InvalidSettingsException
spec
- the data table spec with which the regression model was
created.
InvalidSettingsException
- if PMML incompatible type was foundpublic String getTargetColumnName()
public double getOffset()
public double[] getMultipliers()
public double getApproximationFor(String variable, double v)
variable
- the variable currently shown on xv
- its value
public DataTableSpec getSpec()
public DataCell predict(DataRow row)
row
- a data row to predict
public void save(ModelContentWO par)
par
- a model content object where the settings are saved toprotected void load(ModelContentRO par, PortObjectSpec spec) throws InvalidSettingsException
par
- a model content objectspec
- the port object spec
InvalidSettingsException
- if the model to load in invalidpublic static LinearRegressionContent instantiateAndLoad(ModelContentRO par, PortObjectSpec spec) throws InvalidSettingsException
par
- a model content objectspec
- the spec for the model
InvalidSettingsException
- if the model to load in invalid
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |