Feat C++ API
A feature engineering automation tool
scorer.h
Go to the documentation of this file.
1 /* FEAT
2 copyright 2017 William La Cava
3 license: GNU/GPL v3
4 */
5 #ifndef SCORER_H
6 #define SCORER_H
7 // internal includes
8 #include "metrics.h"
9 using namespace shogun;
10 using Eigen::Map;
11 
12 // code to evaluate GP programs.
13 namespace FT{
14 
19  namespace Eval{
21 
25  typedef float (*funcPointer)(const VectorXf&,
26  const shared_ptr<CLabels>&,
27  VectorXf&,
28  const vector<float>&);
29 
30  class Scorer
31  {
32  public:
33  /* // pointer to scoring function */
34  /* float (* score_fn)(const VectorXf&, */
35  /* const shared_ptr<CLabels>&, */
36  /* VectorXf&, */
37  /* const vector<float>&); */
38 
39  std::map<string, funcPointer> score_hash;
40 
41  Scorer(string scorer="");
42 
43  void set_scorer(string scorer);
44  /* void set_scorer(string scorer); */
45  float score(const VectorXf& y_true,
46  const shared_ptr<CLabels>& yhat,
47  VectorXf& loss,
48  const vector<float>& w);
49  float score(const VectorXf& y_true,
50  const shared_ptr<CLabels>& yhat,
51  vector<float> w=vector<float>());
52 
53  string scorer;
54  };
55  }
56 }
57 #endif
scoring class for Feat
Definition: scorer.h:31
std::map< string, funcPointer > score_hash
Definition: scorer.h:39
string scorer
Definition: scorer.h:53
float(* funcPointer)(const VectorXf &, const shared_ptr< CLabels > &, VectorXf &, const vector< float > &)
Definition: scorer.h:25
main Feat namespace
Definition: data.cc:13