Home | Develop | Download | Contact
example_predictor_evaluate.cpp
1 
30 #include <iostream>
31 #include <Pds/Ra>
32 #include <Pds/Ml>
33 
34 
35 int main(void)
36 {
37  Pds::Vector Yp;
38  Pds::IterationConf Conf;
39 
40  // Generating data
41  unsigned int L=1000;
42  Pds::Matrix X;
43  Pds::Vector Y;
45 
46  Pds::Octave::Plot::PointsXY(X,Y,"testando.m","example_predictor_evaluate_data.png");
47 
48  // Create Predictor
49  Pds::Predictor Data(Conf,X,Y);
50  Data.Print("W:\n");
51 
52  // Evaluate training data
53  Yp=Data.Evaluate(X);
54 
55  // Testing W with training data set
56  std::cout<<"\nTraining :: R2 : "<<Y.R2(Yp)<<std::endl;
57 
58  Pds::Octave::Plot::PointsXYXY(X,Y,X,Yp,"testando.m","example_predictor_evaluate_training.png");
59 
60  // Evaluate testing data
62  Yp=Data.Evaluate(X);
63 
64  // Testing W with training data set
65  std::cout<<"\nTesting :: R2 : "<<Y.R2(Yp)<<std::endl;
66 
67  Pds::Octave::Plot::PointsXYXY(X,Y,X,Yp,"testando.m","example_predictor_evaluate_testing.png");
68  return 0;
69 }
70 
La clase tipo Pds::IterationConf . Esta clase genera una matriz de Nlin lineas y 1 columna....
La clase tipo Pds::Predictor . Esta clase genera una matriz de Nlin lineas y 1 columna....
Definition: Predictor.hpp:62
void LoadDataLine(unsigned int L, Pds::Matrix &X, Pds::Vector &Y)
Regresion de datos ajustados por una linea.
bool PointsXY(const Pds::Vector &X, const Pds::Vector &Y, const std::string &octfilename, const std::string &imgfilename)
Plot de X vs. Y.
bool PointsXYXY(const Pds::Vector &X, const Pds::Vector &Y, const Pds::Vector &Xs, const Pds::Vector &Ys, const std::string &octfilename, const std::string &imgfilename)
Plot de X vs. Y.

Enlaces de interés

HomePage Bazaar Download Bug report Ayuda Developer Feed