26 #include "extra_newhb.h"
28 bool get_W1_W2_IS_for_given_W_X_Y(
double b,
unsigned int N,
29 Pds::Vector W,Pds::Matrix X,Pds::Vector Y,
30 Pds::Matrix &W1,Pds::Matrix &W2,Pds::Matrix &IS)
33 Pds::Vector w1=Pds::LinSpace(-b,b,N);
34 Pds::Vector w2=Pds::LinSpace(-b,b,N);
36 Pds::Meshgrid(w1,w2,W1,W2);
39 for(
unsigned int i=0;i<N;i++)
40 for(
unsigned int j=0;j<N;j++)
58 Pds::Octave::DAspect=
true;
59 Pds::Octave::YLimits=
true;
63 Pds::Matrix X(Pds::Ra::TextFormat,
"../test/hard-data-x.txt");
64 Pds::Vector Y(Pds::Ra::TextFormat,
"../test/hard-data-y.txt");
78 Pds::Octave::Plot::PointsX2DYW(X,Y,W,
"testando_w.m",
"test_working_steps_0.png");
81 unsigned int N=64;
double b=2.0;
84 Pds::Vector P(W.Nel());
87 for(
unsigned int n=1;n<=60;n++)
90 std::cout<<
"\n n: "<<n<<
"\n";
91 std::cout<<
" h: "<<h<<
"\n";
104 get_W1_W2_IS_for_given_W_X_Y( b,N,W,X,Y, W1,W2,IS);
106 DW.T().Print(
"DW: ");
114 Pds::Octave::Title=
"NHb:"+std::to_string(E1);
115 Pds::Octave::Plot::PointsX2DYW(X,Y,W,
"testando_w.m",
"test_working_steps_"+std::to_string(n)+
".png");
120 Pds::Octave::Plot::SurfCWithPoint( W1,W2,IS,P,
121 "testando_is"+std::to_string(n)+
".m",
122 "is_matrix_"+std::to_string(n)+
".png");
Pds::Vector Classify(const Pds::Vector &W, const Pds::Matrix &X)
Calculo del resultado del clasificador.
Pds::Vector GetW0MeanMethod(const Pds::Matrix &X)
Obtiene de forma rapida un vector inicial para usar en regresion logistica.
Pds::Vector GradientCostXqEntropy(const Pds::Vector &W, const Pds::Matrix &X, const Pds::Vector &Y, double q, double h)
double CostXqEntropy(const Pds::Vector &W, const Pds::Matrix &X, const Pds::Vector &Y, double q)