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

Mean absolute error. More...

#include <CosanMetric.h>

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

Public Member Functions

 MeanAbsError ()
 
 MeanAbsError (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::MeanAbsError< NumericType >

Mean absolute error.

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

Definition at line 112 of file CosanMetric.h.

Constructor & Destructor Documentation

◆ MeanAbsError() [1/2]

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

Definition at line 114 of file CosanMetric.h.

114 : CosanMetric<NumericType>() {}

◆ MeanAbsError() [2/2]

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

Definition at line 116 of file CosanMetric.h.

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

Member Function Documentation

◆ GetError()

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

Reimplemented from Cosan::CosanMetric< NumericType >.

Definition at line 120 of file CosanMetric.h.

120  {
121  this->error = (yPredict - yTrue).array().abs().sum() / yPredict.rows();
122  return this->error;
123  }

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