public abstract class AbstractParsedNonlinearRegression extends AbstractNonlinearRegression
AbstractNonlinearRegression
-based models which parse the equation
of interest from text input.
Use this class by passing a specially-formatted equation to
#parseFormula(java.lang.String) .
Usage: <equation>
Rules for writing an equation:
#{a:<Attribute Name>}
#{<Constant Name>}
Example expression with two fitting constants and a single attribute
variable : #{a} + #{b} * #{a:NComp}
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
UserFormula
Stores the user-provided formula
|
AttributeSelector, trained, TrainingStats, validated, ValidationStats
Constructor and Description |
---|
AbstractParsedNonlinearRegression() |
Modifier and Type | Method and Description |
---|---|
protected void |
defineCoefficients()
Define the names and, if desired, initial guesses of fitting coefficients.
|
protected void |
defineVariables()
Define which attributes are used by the function.
|
protected abstract java.lang.String |
defineVariables(java.lang.String Expression)
Reads an expression and stores the names of all variables.
|
void |
parseFormula(java.lang.String formula)
Parse formula to use as model.
|
abstract void |
prepareEvaluator(java.lang.String Expression)
Define the internal
Evaluator and parse the user-defined function |
protected java.lang.String |
printModel_protected()
Internal method that handles printing the model as a string.
|
java.util.List<java.lang.String> |
printModelDescriptionDetails(boolean htmlFormat)
Print details of the model.
|
java.lang.String |
printUsage()
Print out required format for options.
|
void |
setOptions(java.util.List OptionsObj)
Set any options for this object.
|
addCoefficient, addCoefficient, addVariable, function, getCoefficientName, getFittedCoefficient, getMaxIter, getNFittingParameters, getVariableName, makeObjectiveFunction, NCoefficients, NVariables, run_protected, runCommand, runNonlinearCommand, setInitialGuess, setMaxIterations, train_protected
clone, doRobustRegression, getRobustRegressionQ, robustTraining, setRobustRegressionQ
about, crossValidate, crossValidate, crossValidate, done, externallyValidate, getAttributeSelector, getCitations, getFilter, getTrainTime, getValidationMethod, handleSetCommand, isTrained, isValidated, loadState, printCommand, printDescription, printModel, resetModel, run, saveCommand, saveState, setAttributeSelector, setComponent, setFilter, train, train
protected void defineCoefficients()
AbstractNonlinearRegression
Coefficients are defined using the AbstractNonlinearRegression.addCoefficient(java.lang.String)
function.
In AbstractNonlinearRegression.function(double[], double[])
these names are mapped to the coeff
array
in the same order you define them.
defineCoefficients
in class AbstractNonlinearRegression
protected abstract java.lang.String defineVariables(java.lang.String Expression) throws java.lang.Exception
AbstractNonlinearRegression
Expression
- Expression to be parsedjava.lang.Exception
- If poorly-formed expressionprotected void defineVariables()
AbstractNonlinearRegression
Variables are defined using the AbstractNonlinearRegression.addVariable(java.lang.String)
function. *
In AbstractNonlinearRegression.function(double[], double[])
these names are mapped to the variable
array
in the same order you define them.
defineVariables
in class AbstractNonlinearRegression
public abstract void prepareEvaluator(java.lang.String Expression) throws java.lang.Exception
Evaluator
and parse the user-defined functionExpression
- User-defined functionjava.lang.Exception
- If the formula is illegiblepublic void setOptions(java.util.List OptionsObj) throws java.lang.Exception
Options
setOptions
in interface Options
setOptions
in class AbstractNonlinearRegression
OptionsObj
- Array of options as Objects - can be null
java.lang.Exception
- if problem with inputspublic void parseFormula(java.lang.String formula) throws java.lang.Exception
formula
- Formula to be parsedjava.lang.Exception
AbstractParsedNonlinearRegression
public java.lang.String printUsage()
Options
printUsage
in interface Options
printUsage
in class AbstractNonlinearRegression
public java.util.List<java.lang.String> printModelDescriptionDetails(boolean htmlFormat)
BaseModel
BaseModel.printDescription(boolean)
.
Implementation note: No not add indentation for details. That is handled
by BaseModel.printDescription(boolean)
. You should also call the super
operation to get the Normalizer and Attribute selector settings
printModelDescriptionDetails
in class BaseModel
htmlFormat
- Whether to use HTML formatprotected java.lang.String printModel_protected()
BaseModel
printModel_protected
in class BaseModel