10#define _CAL_FEATURE_H_
22 typedef double (*
SetJoinFunc)(
const std::vector<std::string> &,
const std::vector<std::string> &);
36 static void calOriginalFeatures(std::vector<std::vector<double>> &featureValues,
const std::string &func,
37 const std::string &lstr,
const std::string &rstr,
38 const std::vector<std::string> <okens,
39 const std::vector<std::string> &rtokens,
40 bool isCoeff =
false);
44 static void calOneSideFeatures(std::vector<std::vector<double>> &featureValues,
SetJoinFunc setJoinP,
const std::string &tok,
45 const std::vector<std::string> &tokens,
const std::vector<std::string> &ictokens,
47 int cltid,
int iccltid);
49 static void calOneSideFeatures(std::vector<std::vector<double>> &featureValues,
StringJoinFunc stringJoinP,
const std::string &tok,
51 int cltid,
int iccltid,
const std::string &func);
54 static void calDoubleSideFeatures(std::vector<std::vector<double>> &featureValues,
SetJoinFunc setjoinP,
const std::string &tok,
55 const std::vector<std::string> <okens,
const std::vector<std::string> &rtokens,
57 int lcltid,
int rcltid,
int *
const &curDCIdx,
double ***
const &curCache,
58 const std::vector<int> &featureLength,
const std::string &func,
ui attrpos);
60 static void calDoubleSideFeatures(std::vector<std::vector<double>> &featureValues,
StringJoinFunc stringJoinP,
const std::string &tok,
62 int lcltid,
int rcltid,
int *
const &curDCIdx,
double ***
const &curCache,
63 const std::vector<int> &featureLength,
const std::string &func,
ui attrpos);
68 static void calAll(
int numFeatures,
Rule *featureNames,
const std::vector<std::string> &attrVec,
const Table &resTable,
75 std::vector<std::vector<double>> &featureValues,
const std::vector<int> &featureLength,
bool isTopK);
Definition cal_feature.h:17
static FeatureIndex index
Definition cal_feature.h:26
double(*) SetJoinFunc(const std::vector< std::string > &, const std::vector< std::string > &)
Definition cal_feature.h:22
static void calAllWithoutInterchangeable(int numFeatures, Rule *featureNames, const std::vector< std::string > &attrVec, const Table &resTable, std::vector< std::vector< double > > &featureValues, const std::vector< int > &featureLength, bool isTopK)
Definition cal_feature.cc:264
CalculateFeature()=default
double(*) StringJoinFunc(const std::string &, const std::string &)
Definition cal_feature.h:23
static void calAll(int numFeatures, Rule *featureNames, const std::vector< std::string > &attrVec, const Table &resTable, std::vector< std::vector< double > > &featureValues, const FeatureIndex::Groups &group, const FeatureIndex::GroupTokens &groupTokensDlm, const FeatureIndex::GroupTokens &groupTokensQgm, const FeatureIndex::Cluster &cluster, const std::vector< int > &featureLength, bool flagConsistent, bool isTopK)
Definition cal_feature.cc:143
CalculateFeature(const CalculateFeature &other)=delete
CalculateFeature(CalculateFeature &&other)=delete
~CalculateFeature()=default
Definition feature_index.h:20
std::vector< std::unordered_map< int, std::vector< std::string > > > Groups
Definition feature_index.h:26
std::unordered_map< int, std::vector< std::vector< std::string > > > GroupToken
Definition feature_index.h:27
std::unordered_map< int, std::vector< std::string > > Group
Definition feature_index.h:25
std::vector< std::unordered_map< std::string, int > > Cluster
Definition feature_index.h:31
std::vector< std::unordered_map< int, std::vector< std::vector< std::string > > > > GroupTokens
Definition feature_index.h:28
Definition dataframe.h:19
Definition dataframe.h:54
unsigned int ui
Definition type.h:8