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_protectedclone, doRobustRegression, getRobustRegressionQ, robustTraining, setRobustRegressionQabout, 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, trainprotected void defineCoefficients()
AbstractNonlinearRegressionCoefficients 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 AbstractNonlinearRegressionprotected abstract java.lang.String defineVariables(java.lang.String Expression)
throws java.lang.Exception
AbstractNonlinearRegressionExpression - Expression to be parsedjava.lang.Exception - If poorly-formed expressionprotected void defineVariables()
AbstractNonlinearRegressionVariables 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 AbstractNonlinearRegressionpublic 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
OptionssetOptions in interface OptionssetOptions in class AbstractNonlinearRegressionOptionsObj - Array of options as Objects - can be nulljava.lang.Exception - if problem with inputspublic void parseFormula(java.lang.String formula)
throws java.lang.Exception
formula - Formula to be parsedjava.lang.ExceptionAbstractParsedNonlinearRegressionpublic java.lang.String printUsage()
OptionsprintUsage in interface OptionsprintUsage in class AbstractNonlinearRegressionpublic java.util.List<java.lang.String> printModelDescriptionDetails(boolean htmlFormat)
BaseModelBaseModel.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 BaseModelhtmlFormat - Whether to use HTML formatprotected java.lang.String printModel_protected()
BaseModelprintModel_protected in class BaseModel