Programa para el testeo de las funciones.Para compilar o código example_logisticregression_meansquare_hard.cpp:
g++ -static -o example_logisticregression_meansquare_hard example_logisticregression_meansquare_hard.cpp -lpdsmlmm
Para executar o programa:
./example_logisticregression_meansquare_hard
Retornando por consola:
W_ms_conf:
0.54735453715447 4.5966020377534 -13.467304051768
W_ms:
0.54735453715474 4.5966020377536 -13.467304051769
W_ms_conf:
12.840026069741 9.1677022674658 -27.478493922404
W_ms_w:
12.840026069741 9.1677022674659 -27.478493922405
Clasification - Mean square conf
Clasification - Mean square
Clasification - W mean square conf
Clasification - W mean square
Código example_logisticregression_meansquare_hard.cpp:
#include <iostream>
#include <Pds/Ra>
#include <Pds/Ml>
int main(void)
{
Pds::Matrix X(Pds::Ra::TextFormat,"../test/hard2-data-x.txt");
Pds::Vector Y(Pds::Ra::TextFormat,"../test/hard2-data-y.txt");
Pds::Vector W;
Pds::Vector d=Y.BalancedBinaryWeight(0.5);
W.T().Print("W_ms_conf:\n");
W.T().Print("W_ms:\n");
W.T().Print("W_ms_conf:\n");
W.T().Print("W_ms_w:\n");
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.
Pds::Vector FittingLogitMeanSquare(Pds::IterationConf &Conf, const Pds::Matrix &X, const Pds::Vector &Y, double Delta=0.0001)
Calculo de pesos.
Pds::Vector FittingLogitWeightedMeanSquare(Pds::IterationConf &Conf, const Pds::Matrix &X, const Pds::Vector &Y, const Pds::Vector &D, double Delta=0.0001)
Calculo de pesos.
std::string YLabel
Texto correspondente a ylabel.
std::string XLabel
Texto correspondente a xlabel.
bool PointsX2DYW(const Pds::Matrix &X, const Pds::Vector &Y, const Pds::Vector &W, const std::string &octfilename, const std::string &imgfilename)
Plot de muestras en 2D en las columnas X, clasificadas de forma binaria con Y>=0.5,...