UFJF - Machine Learning Toolkit  0.51.8
regressor/Regressor.hpp
1 //
2 // Created by mateus558 on 18/10/18.
3 //
4 
5 #pragma once
6 
7 #include "ufjfmltk/core/Learner.hpp"
8 
9 namespace mltk{
13  namespace regressor {
14 
15  template<typename T>
16  class Regressor : public Learner<T> {
17  protected:
20  public:
21  Regressor() = default;
22 
23  explicit Regressor(DataPointer <T> samples) : Learner<T>(samples) {}
24 
25  /*********************************************
26  * Getters *
27  *********************************************/
28 
33  [[nodiscard]] Solution getSolution() const { return solution; }
34 
40 
41  /*********************************************
42  * Setters *
43  *********************************************/
44 
49  void setW(const std::vector<double> &w) { this->solution.w = w; }
50 
55  void setSolution(Solution solution) { this->solution = solution; }
56  };
57  }
58 }
Definition: Learner.hpp:18
std::shared_ptr< Data< T > > samples
Samples used in the model training.
Definition: Learner.hpp:21
Definition: Solution.hpp:13
mltk::Point< double > w
Weights vector.
Definition: Solution.hpp:17
Definition: regressor/Regressor.hpp:16
void setW(const std::vector< double > &w)
setW Set the weights vector of the regressor.
Definition: regressor/Regressor.hpp:49
Solution solution
Regressor solution.
Definition: regressor/Regressor.hpp:19
void setSolution(Solution solution)
setSolution Set a solution for the regressor.
Definition: regressor/Regressor.hpp:55
Solution * getSolutionRef()
getSolution Returns a reference to the solution of the regressor.
Definition: regressor/Regressor.hpp:39
Solution getSolution() const
getSolution Returns the solution of the regressor.
Definition: regressor/Regressor.hpp:33
UFJF-MLTK main namespace for core functionalities.
Definition: classifier/Classifier.hpp:11