Home | Develop | Download | Contact
example_logisticregression_robust_meansquare.cpp

Programa para el testeo de las funciones.Para compilar o código example_logisticregression_robust_meansquare.cpp:

g++ -static -o example_logisticregression_robust_meansquare example_logisticregression_robust_meansquare.cpp -lpdsmlmm -lpdsramm -lpdsspmm

Para executar o programa:

./example_logisticregression_robust_meansquare

Retornando por consola:

Classification - robust Mean square - Y


Classification - robust Mean square - Yp


Classification - robust Mean square - Yp

Código example_logisticregression_robust_meansquare.cpp:

#include <iostream>
#include <Pds/Ra>
#include <Pds/Ml>
int main(void)
{
Pds::Octave::XLabel="x_1";
Pds::Octave::YLabel="x_2";
Pds::Octave::XLimits=true;
Pds::Octave::YLimits=true;
// Generating data
/*
Pds::Matrix X(Pds::Ra::TextFormat,"../test/hard-data-x.txt");
Pds::Vector Y(Pds::Ra::TextFormat,"../test/hard-data-y.txt");
*/
Pds::Matrix X;
Pds::Vector Y;
unsigned int L=1000;
Pds::Octave::Plot::PointsX2DY(X,Y,"testando.m","example_logisticregression_robust_meansquare_y.png");
Pds::Vector W;
Pds::Vector Yp;
Conf.Show=true; Conf.SetMinError(1e-07); Conf.SetAlpha(0.1);
unsigned int N=2;
// Create W using training data
W.T().Print("W:\n");
Pds::Octave::Plot::PointsX2DYW(X,Yp,W,"testando.m","example_logisticregression_robust_meansquare_yp.png");
// Create W using training data
W.T().Print("W:\n");
Pds::Octave::Plot::PointsX2DYW(X,Yp,W,"testando.m","example_logisticregression_robust_meansquare_ypc.png");
return 0;
}
La clase tipo Pds::IterationConf . Esta clase genera una matriz de Nlin lineas y 1 columna....
bool SetAlpha(double Alpha)
Coloca el valor alpha.
bool SetMinError(double MinError)
Coloca el valor MinError.
void LoadDataBand(unsigned int L, Pds::Matrix &X, Pds::Vector &Y)
Clasificacion de datos separados por mas de una curva.
Pds::Vector Classify(const Pds::Vector &W, const Pds::Matrix &X)
Calculo del resultado del clasificador.
Pds::Vector FittingRobustLogitMeanSquare(const Pds::Matrix &X, const Pds::Vector &Y, double Delta=0.0001, unsigned int N=2, double Offset=0.1)
Calculo de pesos.

Enlaces de interés

HomePage Bazaar Download Bug report Ayuda Developer Feed