Cosan  1.0
Data Analytics Library
Cosan::MeanSquareError< NumericType > Class Template Reference

Mean squared error. More...

#include <CosanMetric.h>

Inheritance diagram for Cosan::MeanSquareError< NumericType >:
Cosan::CosanMetric< NumericType > Cosan::Evaluation Cosan::CosanBO

Public Member Functions

 MeanSquareError ()
 
 MeanSquareError (const CosanMatrix< NumericType > &yPredict, const CosanMatrix< NumericType > &yTrue)
 
NumericType GetError (const CosanMatrix< NumericType > &yPredict, const CosanMatrix< NumericType > &yTrue) override
 
- Public Member Functions inherited from Cosan::CosanMetric< NumericType >
 CosanMetric ()
 
 CosanMetric (const CosanMatrix< NumericType > &yPredict, const CosanMatrix< NumericType > &yTrue)
 
void setAttr (const CosanMatrix< NumericType > &yPredict, const CosanMatrix< NumericType > &yTrue)
 
- Public Member Functions inherited from Cosan::Evaluation
 Evaluation ()
 
- Public Member Functions inherited from Cosan::CosanBO
 CosanBO ()
 Default constructor. More...
 
virtual const std::string GetName () const
 Get the name of the objects. More...
 

Additional Inherited Members

- Public Attributes inherited from Cosan::CosanMetric< NumericType >
NumericType error
 

Detailed Description

template<Numeric NumericType>
class Cosan::MeanSquareError< NumericType >

Mean squared error.

https://scikit-learn.org/stable/modules/model_evaluation.html#mean-squared-error

Definition at line 132 of file CosanMetric.h.

Constructor & Destructor Documentation

◆ MeanSquareError() [1/2]

template<Numeric NumericType>
Cosan::MeanSquareError< NumericType >::MeanSquareError ( )
inline

Definition at line 134 of file CosanMetric.h.

134 : CosanMetric<NumericType>() {}

◆ MeanSquareError() [2/2]

template<Numeric NumericType>
Cosan::MeanSquareError< NumericType >::MeanSquareError ( const CosanMatrix< NumericType > &  yPredict,
const CosanMatrix< NumericType > &  yTrue 
)
inline

Definition at line 136 of file CosanMetric.h.

137  : CosanMetric<NumericType>(yPredict, yTrue) {}

Member Function Documentation

◆ GetError()

template<Numeric NumericType>
NumericType Cosan::MeanSquareError< NumericType >::GetError ( const CosanMatrix< NumericType > &  yPredict,
const CosanMatrix< NumericType > &  yTrue 
)
inlineoverridevirtual

Reimplemented from Cosan::CosanMetric< NumericType >.

Definition at line 140 of file CosanMetric.h.

140  {
141  this->error = (yTrue - yPredict).squaredNorm() / yTrue.rows();
142  return this->error;
143  }

The documentation for this class was generated from the following file:
Cosan::CosanMetric::error
NumericType error
Definition: CosanMetric.h:70