jsat.regression.evaluation
Class MeanSquaredError
- java.lang.Object
-
- jsat.regression.evaluation.MeanSquaredError
-
- All Implemented Interfaces:
- java.io.Serializable, RegressionScore
public class MeanSquaredError extends java.lang.Object implements RegressionScore
Uses the Mean of the Squared Errors between the predictions and the true values.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description MeanSquaredError()MeanSquaredError(boolean rmse)MeanSquaredError(MeanSquaredError toCopy)Copy constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidaddResult(double prediction, double trueValue, double weight)Adds the given result to the scorevoidaddResults(RegressionScore other)The score contained in this object is augmented with the results already accumulated in theotherobject.MeanSquaredErrorclone()booleanequals(java.lang.Object obj)java.lang.StringgetName()Returns the name to present for this scoredoublegetScore()Computes the score for the results that have been enrolled viaRegressionScore.addResult(double, double, double)inthashCode()booleanisRMSE()booleanlowerIsBetter()Returnstrueif a lower score is better, orfalseif a higher score is bettervoidprepare()voidsetRMSE(boolean rmse)
-
-
-
Constructor Detail
-
MeanSquaredError
public MeanSquaredError()
-
MeanSquaredError
public MeanSquaredError(boolean rmse)
-
MeanSquaredError
public MeanSquaredError(MeanSquaredError toCopy)
Copy constructor- Parameters:
toCopy- the object to copy
-
-
Method Detail
-
setRMSE
public void setRMSE(boolean rmse)
-
isRMSE
public boolean isRMSE()
-
prepare
public void prepare()
- Specified by:
preparein interfaceRegressionScore
-
addResult
public void addResult(double prediction, double trueValue, double weight)Description copied from interface:RegressionScoreAdds the given result to the score- Specified by:
addResultin interfaceRegressionScore- Parameters:
prediction- the prediction for the data pointtrueValue- the true value for the data pointweight- the weigh to assign to the data point
-
addResults
public void addResults(RegressionScore other)
Description copied from interface:RegressionScoreThe score contained in this object is augmented with the results already accumulated in theotherobject. This does not result in an averaging, but alters the current object to have the same score it would have had if all the results were originally inserted into this object.
This method is only required to work ifotherif of the same class asthisobject.- Specified by:
addResultsin interfaceRegressionScore- Parameters:
other- the object to add the results from
-
getScore
public double getScore()
Description copied from interface:RegressionScoreComputes the score for the results that have been enrolled viaRegressionScore.addResult(double, double, double)- Specified by:
getScorein interfaceRegressionScore- Returns:
- the score for the current results
-
lowerIsBetter
public boolean lowerIsBetter()
Description copied from interface:RegressionScoreReturnstrueif a lower score is better, orfalseif a higher score is better- Specified by:
lowerIsBetterin interfaceRegressionScore- Returns:
trueif a lower score is better
-
hashCode
public int hashCode()
- Specified by:
hashCodein interfaceRegressionScore- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Specified by:
equalsin interfaceRegressionScore- Overrides:
equalsin classjava.lang.Object
-
clone
public MeanSquaredError clone()
- Specified by:
clonein interfaceRegressionScore- Overrides:
clonein classjava.lang.Object
-
getName
public java.lang.String getName()
Description copied from interface:RegressionScoreReturns the name to present for this score- Specified by:
getNamein interfaceRegressionScore- Returns:
- the score name
-
-
DataMelt 3.0 © DataMelt by jWork.ORG