/*set cpon get cpon range from centroid, dimension parameters, and data parameters. */ void setCPON(int f, int c, int t, int ec, int clst_c, int l, oneclass_t *db) { centroid_t *centroid = db->table_centroid[f][c][t]; dimparam_t *dimparam = db->table_dimparam[f][c][t]; dataparam_t *dataparam = &db->table_dataparam[f][c][t]; int datasize = dataparam->datasize; //set no_centroids centroid[clst_c].cpon_range[l].no_centroids = clst_c + 1; //set up sigma in the last centroid centroid[ec].cpon_range[l].sigma = sqrt(centroid->var_max) * (exp((l - 2.0) * log(2.0))); //set pdfweight being centroid and pdf_tr being dataparam setPDF(ec, clst_c + 1, l, centroid, dataparam); //set feature scaled pdf in the dataparam(it includes getta min and max of pdf) setFeatureScaledPDF(dataparam); //printf("%lf, %lf\n", (*(*((db->table_dataparam) + f) + c))->y_min, (*(*((db->table_dataparam) + f) + c))->y_max); //set beta parameters belonging to cpon range setCPONRangeBetaParams(l, ¢roid[clst_c], dataparam); //set p value of train centroid[clst_c].cpon_range[l].p_value_train = p_value_train(datasize, dataparam->cdf, dataparam->cmp, centroid[clst_c].cpon_range[l].beta_a, centroid[clst_c].cpon_range[l].beta_b, dataparam->pdf_fs); }
PDF(int size, char init_mode=' ') : size(0), data(NULL), allocated(false) { setPDF(size, init_mode); }