Feat C++ API
A feature engineering automation tool
n_fuzzy_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_SPLIT
6 #define NODE_FUZZY_SPLIT
7 
8 #include "../n_train.h"
9 
10 namespace FT{
11 
12 namespace Pop{
13 namespace Op{
14 template <class T>
15 class NodeFuzzySplit : public NodeTrain
16 {
17  public:
18 
19  float threshold;
20 
22 
24  void set_threshold(ArrayXf& x, VectorXf& y, bool classification);
25 
27  float gain(const VectorXf& lsplit, const VectorXf& rsplit,
28  bool classification=false,
29  vector<float> unique_classes = vector<float>());
30 
32  float gini_impurity_index(const VectorXf& classes,
33  vector<float> uc);
34 
36  void evaluate(const Data& data, State& state);
37 
39  void eval_eqn(State& state);
40 
41  protected:
42  NodeFuzzySplit* clone_impl() const override;
43  NodeFuzzySplit* rnd_clone_impl() const override;
44 };
45 // serialization
50 }
51 }
52 }
53 
54 #endif
data holding X, y, and Z data
Definition: data.h:42
void eval_eqn(State &state)
Evaluates the node symbolically.
void evaluate(const Data &data, State &state)
Evaluates the node and updates the state states.
NodeFuzzySplit * clone_impl() const override
void set_threshold(ArrayXf &x, VectorXf &y, bool classification)
Uses a heuristic to set a splitting threshold.
float gini_impurity_index(const VectorXf &classes, vector< float > uc)
gini impurity of classes in classes
NodeFuzzySplit * rnd_clone_impl() const override
float gain(const VectorXf &lsplit, const VectorXf &rsplit, bool classification=false, vector< float > unique_classes=vector< float >())
returns the gain of a split
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