Class RegressionFactory
java.lang.Object
org.tribuo.regression.RegressionFactory
- All Implemented Interfaces:
- com.oracle.labs.mlrg.olcut.config.Configurable,- com.oracle.labs.mlrg.olcut.provenance.Provenancable<OutputFactoryProvenance>,- Serializable,- OutputFactory<Regressor>
A factory for creating 
Regressors and RegressionInfos.
 
 It parses the regression dimensions by toStringing the input and calling Regressor.parseString(java.lang.String), unless
 the input is a collection, in which case it extracts the elements.
 
 This OutputFactory has mutable state, namely the character which the dimension input is split on.
 In most cases the default DEFAULT_SPLIT_CHAR is fine.
- See Also:
- 
Nested Class SummaryNested Classes
- 
Field SummaryFields
- 
Constructor SummaryConstructorsConstructorDescriptionBuilds a regression factory using the default split characterDEFAULT_SPLIT_CHAR.RegressionFactory(char splitChar) Sets the split character used to parseRegressorinstances from Strings.
- 
Method SummaryModifier and TypeMethodDescriptionconstructInfoForExternalModel(Map<Regressor, Integer> mapping) Creates anImmutableOutputInfofrom the supplied mapping.booleanGenerates the appropriateMutableOutputInfoso the output values can be tracked by aDatasetor other aggregate.<V> RegressorgenerateOutput(V label) Parses the MultipleRegression value either by toStringing the input and callingRegressor.parseString(java.lang.String)or if it's a collection iterating over the elements calling toString on each element in turn and usingRegressor.parseElement(int, java.lang.String).Gets anEvaluatorsuitable for measuring performance of predictions for the Output subclass.Returns the singleton unknown output of type T which can be used for prediction time examples.inthashCode()voidUsed by the OLCUT configuration system, and should not be called by external code.Methods inherited from class java.lang.Objectclone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.tribuo.OutputFactorygenerateOutputs
- 
Field Details- 
DEFAULT_SPLIT_CHAR- See Also:
 
- 
UNKNOWN_REGRESSOR
- 
UNKNOWN_MULTIPLE_REGRESSOR
 
- 
- 
Constructor Details- 
RegressionFactorypublic RegressionFactory()Builds a regression factory using the default split characterDEFAULT_SPLIT_CHAR.
- 
RegressionFactorySets the split character used to parseRegressorinstances from Strings.- Parameters:
- splitChar- The split character.
 
 
- 
- 
Method Details- 
postConfigUsed by the OLCUT configuration system, and should not be called by external code.- Specified by:
- postConfigin interface- com.oracle.labs.mlrg.olcut.config.Configurable
 
- 
generateOutputParses the MultipleRegression value either by toStringing the input and callingRegressor.parseString(java.lang.String)or if it's a collection iterating over the elements calling toString on each element in turn and usingRegressor.parseElement(int, java.lang.String).- Specified by:
- generateOutputin interface- OutputFactory<Regressor>
- Type Parameters:
- V- The type of the input value.
- Parameters:
- label- An input value.
- Returns:
- A MultipleRegressor with sentinel variances.
 
- 
getUnknownOutputDescription copied from interface:OutputFactoryReturns the singleton unknown output of type T which can be used for prediction time examples.- Specified by:
- getUnknownOutputin interface- OutputFactory<Regressor>
- Returns:
- An unknown output.
 
- 
generateInfoDescription copied from interface:OutputFactoryGenerates the appropriateMutableOutputInfoso the output values can be tracked by aDatasetor other aggregate.- Specified by:
- generateInfoin interface- OutputFactory<Regressor>
- Returns:
- The appropriate subclass of MutableOutputInfoinitialised to zero.
 
- 
constructInfoForExternalModelpublic ImmutableOutputInfo<Regressor> constructInfoForExternalModel(Map<Regressor, Integer> mapping) Description copied from interface:OutputFactoryCreates anImmutableOutputInfofrom the supplied mapping. Requires that the mapping is dense in the integers [0,mapping.size()) and each mapping is unique.This call is used to import external models, and should not be used for other purposes. - Specified by:
- constructInfoForExternalModelin interface- OutputFactory<Regressor>
- Parameters:
- mapping- The mapping to use.
- Returns:
- The appropriate subclass of ImmutableOutputInfowith a single observation of each element.
 
- 
getEvaluatorDescription copied from interface:OutputFactoryGets anEvaluatorsuitable for measuring performance of predictions for the Output subclass.Evaluatorinstances are thread safe and immutable, and commonly this is a singleton stored in theOutputFactoryimplementation.- Specified by:
- getEvaluatorin interface- OutputFactory<Regressor>
- Returns:
- An evaluator.
 
- 
hashCode
- 
equals
- 
getProvenance- Specified by:
- getProvenancein interface- com.oracle.labs.mlrg.olcut.provenance.Provenancable<OutputFactoryProvenance>
 
 
-