QuickRank  v2.0
QuickRank: A C++ suite of Learning to Rank algorithms
rtnode_histogram.h
Go to the documentation of this file.
1 /*
2  * QuickRank - A C++ suite of Learning to Rank algorithms
3  * Webpage: http://quickrank.isti.cnr.it/
4  * Contact: quickrank@isti.cnr.it
5  *
6  * Unless explicitly acquired and licensed from Licensor under another
7  * license, the contents of this file are subject to the Reciprocal Public
8  * License ("RPL") Version 1.5, or subsequent versions as allowed by the RPL,
9  * and You may not copy or use this file in either source code or executable
10  * form, except in compliance with the terms and conditions of the RPL.
11  *
12  * All software distributed under the RPL is provided strictly on an "AS
13  * IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, AND
14  * LICENSOR HEREBY DISCLAIMS ALL SUCH WARRANTIES, INCLUDING WITHOUT
15  * LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
16  * PURPOSE, QUIET ENJOYMENT, OR NON-INFRINGEMENT. See the RPL for specific
17  * language governing rights and limitations under the RPL.
18  *
19  * Contributor:
20  * HPC. Laboratory - ISTI - CNR - http://hpc.isti.cnr.it/
21  */
22 #pragma once
23 
24 #include "data/vertical_dataset.h"
25 
27  public:
28  float **thresholds = NULL; //[0..nfeatures-1]x[0..thresholds_size[i]-1]
29  size_t const *thresholds_size = NULL;
30  size_t **stmap = NULL; //[0..nfeatures-1]x[0..nthresholds-1]
31  const size_t nfeatures = 0;
32  double **sumlbl = NULL; //[0..nfeatures-1]x[0..nthresholds-1]
33  size_t **count = NULL; //[0..nfeatures-1]x[0..nthresholds-1]
34  double squares_sum_ = 0.0;
35  public:
36  RTNodeHistogram(float **thresholds, size_t const *thresholds_size,
37  size_t nfeatures);
38 
39  RTNodeHistogram(RTNodeHistogram const *parent, size_t const *sampleids,
40  const size_t nsampleids, double const *labels);
41 
42  RTNodeHistogram(RTNodeHistogram const *parent, RTNodeHistogram const *left);
43 
45 
46  void update(double *labels, const size_t nlabels);
47 
48  void transform_intorightchild(RTNodeHistogram const *left);
49 
50  void quick_dump(size_t f, size_t num_t);
51 };
52 
54  public:
55  RTRootHistogram(quickrank::data::VerticalDataset *dps, size_t **sortedidx,
56  size_t sortedidxsize, float **thresholds,
57  size_t const *thresholds_size);
58 
59  ~RTRootHistogram();
60 };
RTNodeHistogram(float **thresholds, size_t const *thresholds_size, size_t nfeatures)
Definition: histogram.cc:24
size_t const * thresholds_size
Definition: rtnode_histogram.h:29
void transform_intorightchild(RTNodeHistogram const *left)
Definition: histogram.cc:113
double squares_sum_
Definition: rtnode_histogram.h:34
double ** sumlbl
Definition: rtnode_histogram.h:32
void update(double *labels, const size_t nlabels)
Definition: histogram.cc:89
Definition: rtnode_histogram.h:53
This class implements a Dataset to be used for a L-t-R task.
Definition: vertical_dataset.h:46
void quick_dump(size_t f, size_t num_t)
Definition: histogram.cc:125
size_t ** stmap
Definition: rtnode_histogram.h:30
Definition: rtnode_histogram.h:26
const size_t nfeatures
Definition: rtnode_histogram.h:31
~RTNodeHistogram()
Definition: histogram.cc:83
float ** thresholds
Definition: rtnode_histogram.h:28
size_t ** count
Definition: rtnode_histogram.h:33