Medial Code Documentation
Loading...
Searching...
No Matches
MedHist.h
1#ifndef _MED_HIST_H_
2#define _MED_HIST_H_
3
4#include <stdlib.h>
5#include <stdarg.h>
6#include <stdio.h>
7
8#include <assert.h>
9#include <math.h>
10
11#include <vector>
12#include <map>
13#include <string>
14#include <algorithm>
15
16//======================================================================================
17// MedHist - simple class to get histograms
18//======================================================================================
19class MedHist {
20
21public:
22
23 float missing_value;
24 int positive_only_flag;
25 float rounder; // to round values with, -1: no rounding
26 float from_val, to_val; // histogram boundaries (first cell will be <from_val, last cell will be >= to_val), if not set will be the 0.001 - 0.999 parts of the distribution
27 int ncells; // if too big due to rounding values, will be shrinked automatically
28 float min_percentile, max_percentile;
29 vector<int> hist;
30 vector<float> from;
31 vector<float> to;
32
33
34 MedHist() { clear(); }
35
36 void clear();
37 int get_hist(vector<float> &vals);
38
39 int get_cdf(vector<float> &cdf);
40 int sum();
41 void print(string &prefix);
42};
43
44#endif
Definition MedHist.h:19
Copyright 2015-2023 by XGBoost Contributors.