Home | Develop | Download | Contact
example_funcpwc_probability.cpp

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

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

Para executar o programa:

./example_funcpwc_probability

Retornando por consola:

Anomaly detection - data
Anomaly detection - probability

Código example_funcpwc_probability.cpp:

#include <iostream>
#include <Pds/Ra>
#include <Pds/Ml>
int main(void)
{
Pds::Octave::XLabel="x1";
Pds::Octave::YLabel="x2";
Pds::Octave::DAspect=true;
Pds::IterationConf Conf; Conf.Show=true; Conf.SetMinError(1.0e-6);
unsigned int L=1000;
Pds::Matrix X;
Pds::Vector Y;
Pds::Vector P;
// Generating data X=[x1 x2]
Pds::Octave::MarkerSize=4;
Pds::Octave::Plot::PointsX2D(X,"testando.m","example_funcpwc_probability_data.png");
// Mu, Sigma estimation
Pds::Matrix Sinv=X.CovMatrix().Inv();
// density function
Pds::Octave::MarkerSize=12;
Pds::Octave::Plot::ScatterX2DY(X,P,"testando.m","example_funcpwc_probability_prob.png");
// density function
P=Pds::Probability::PWCDensity(X,X,Sinv,0.1,1.0/Sinv.Det());
Pds::Octave::MarkerSize=12;
Pds::Octave::Plot::ScatterX2DY(X,P,"testando.m","example_funcpwc_probability_prob2.png");
return 0;
}
La clase tipo Pds::IterationConf . Esta clase genera una matriz de Nlin lineas y 1 columna....
bool SetMinError(double MinError)
Coloca el valor MinError.
void LoadKGaussian(unsigned int L, unsigned int K, Pds::Matrix &X, Pds::Vector &Y, double factor=0.70711)
Clasificación múltiple de datos.
Pds::Vector PWCDensity(const Pds::Matrix &X, const Pds::Matrix &C, const Pds::Matrix &Sinv, double h=0.1)
Retorna un vector . Con este fin, evalua la "Parzen Window Classifier probability density function" .

Enlaces de interés

HomePage Bazaar Download Bug report Ayuda Developer Feed