Class MeanSquaredError
java.lang.Object
org.tribuo.regression.rtree.impurity.MeanSquaredError
- All Implemented Interfaces:
com.oracle.labs.mlrg.olcut.config.Configurable
,com.oracle.labs.mlrg.olcut.provenance.Provenancable<com.oracle.labs.mlrg.olcut.provenance.ConfiguredObjectProvenance>
,RegressorImpurity
Measures the mean squared error over a set of inputs.
Used to calculate the impurity of a regression node.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.tribuo.regression.rtree.impurity.RegressorImpurity
RegressorImpurity.ImpurityTuple
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncom.oracle.labs.mlrg.olcut.provenance.ConfiguredObjectProvenance
double
impurity
(float[] targets, float[] weights) Calculates the impurity based on the supplied weights and targets.impurityTuple
(int[] indices, int indicesLength, float[] targets, float[] weights) Calculates the weighted impurity of the targets specified in the indices array.impurityTuple
(List<int[]> indices, float[] targets, float[] weights) Calculates the weighted impurity of the targets specified in all the indices arrays.toString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.oracle.labs.mlrg.olcut.config.Configurable
postConfig
Methods inherited from interface org.tribuo.regression.rtree.impurity.RegressorImpurity
impurity, impurity, impurity, impurity
-
Constructor Details
-
MeanSquaredError
public MeanSquaredError()
-
-
Method Details
-
impurity
public double impurity(float[] targets, float[] weights) Description copied from interface:RegressorImpurity
Calculates the impurity based on the supplied weights and targets.- Specified by:
impurity
in interfaceRegressorImpurity
- Parameters:
targets
- The targets.weights
- The weights.- Returns:
- The impurity.
-
impurityTuple
public RegressorImpurity.ImpurityTuple impurityTuple(int[] indices, int indicesLength, float[] targets, float[] weights) Description copied from interface:RegressorImpurity
Calculates the weighted impurity of the targets specified in the indices array.- Specified by:
impurityTuple
in interfaceRegressorImpurity
- Parameters:
indices
- The indices in the targets and weights arrays.indicesLength
- The number of values to use in indices.targets
- The regression targets.weights
- The example weights.- Returns:
- A tuple containing the impurity and the used weight sum.
-
impurityTuple
public RegressorImpurity.ImpurityTuple impurityTuple(List<int[]> indices, float[] targets, float[] weights) Description copied from interface:RegressorImpurity
Calculates the weighted impurity of the targets specified in all the indices arrays.- Specified by:
impurityTuple
in interfaceRegressorImpurity
- Parameters:
indices
- The indices in the targets and weights arrays.targets
- The regression targets.weights
- The example weights.- Returns:
- A tuple containing the impurity and the used weight sum.
-
toString
-
getProvenance
public com.oracle.labs.mlrg.olcut.provenance.ConfiguredObjectProvenance getProvenance()- Specified by:
getProvenance
in interfacecom.oracle.labs.mlrg.olcut.provenance.Provenancable<com.oracle.labs.mlrg.olcut.provenance.ConfiguredObjectProvenance>
-