123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- /**
- * @file LinRegression.h
- * @brief Algorithm for linear regression
- * @author Frank Prüfer
- * @date 08/13/2013
- */
- #ifndef LINREGRESSIONINCLUDE
- #define LINREGRESSIONINCLUDE
- #include "vislearning/regression/regressionbase/RegressionAlgorithm.h"
- #include <vector>
- #include "core/vector/VectorT.h"
- #include "core/vector/MatrixT.h"
- namespace OBJREC
- {
- class LinRegression : public RegressionAlgorithm
- {
- protected:
- /** vector containing all model parameters */
- std::vector<double> modelParams;
-
- /** dimensionality of the model (i.e. number of model parameters) */
- uint dim;
-
- public:
- /** simple constructor */
- LinRegression();
-
- /** constructor, specifying the dimensionality of the model*/
- LinRegression(uint dimension);
-
- /** copy constructor */
- LinRegression ( const LinRegression & src );
-
- /** simple destructor */
- virtual ~LinRegression();
-
- /** clone function */
- LinRegression* clone (void) const;
-
- /** method to learn model parameters */
- void teach ( const NICE::VVector & x, const NICE::Vector & y );
-
- /** returns model parameters as a vector */
- std::vector<double> getModelParams();
-
- /** method to predict function value */
- double predict ( const NICE::Vector & x );
- };
- } //namespace
- #endif
|