Feat C++ API
A feature engineering automation tool
n_fuzzy_fixed_split.h
Go to the documentation of this file.
1 /* FEAT
2 copyright 2017 William La Cava
3 license: GNU/GPL v3
4 */
5 #ifndef NODE_FUZZY_FIXED_SPLIT
6 #define NODE_FUZZY_FIXED_SPLIT
7 
8 #include "../n_train.h"
9 
10 namespace FT{
11 
12 namespace Pop{
13 namespace Op{
14 template <class T>
16 {
17  public:
18 
19  float threshold;
21 
23 
25  void set_threshold(ArrayXf& x, VectorXf& y,
26  bool classification);
27 
29  float gain(const VectorXf& lsplit, const VectorXf& rsplit,
30  bool classification=false,
31  vector<float> unique_classes = vector<float>());
32 
34  float gini_impurity_index(const VectorXf& classes,
35  vector<float> uc);
36 
38  void evaluate(const Data& data, State& state);
39 
41  void eval_eqn(State& state);
42 
43  protected:
44  NodeFuzzyFixedSplit* clone_impl() const override;
45  NodeFuzzyFixedSplit* rnd_clone_impl() const override;
46 };
47 // serialization
49  complexity, visits, train, threshold, threshold_set)
51  complexity, visits, train, threshold, threshold_set)
52 } // Op
53 } // Pop
54 }// FT
55 
56 #endif
data holding X, y, and Z data
Definition: data.h:42
void eval_eqn(State &state)
Evaluates the node symbolically.
void set_threshold(ArrayXf &x, VectorXf &y, bool classification)
Uses a heuristic to set a splitting threshold.
float gain(const VectorXf &lsplit, const VectorXf &rsplit, bool classification=false, vector< float > unique_classes=vector< float >())
returns the gain of a split
void evaluate(const Data &data, State &state)
Evaluates the node and updates the state states.
NodeFuzzyFixedSplit * clone_impl() const override
NodeFuzzyFixedSplit * rnd_clone_impl() const override
float gini_impurity_index(const VectorXf &classes, vector< float > uc)
gini impurity of classes in classes
NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(NodeFuzzyFixedSplit< float >, name, otype, arity, complexity, visits, train, threshold, threshold_set) NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(NodeFuzzyFixedSplit< int >
main Feat namespace
Definition: data.cc:13
contains various types of State actually used by feat
Definition: state.h:102