OmniSciDB  a5dc49c757
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MLTableFunctionsCommon.h File Reference
+ Include dependency graph for MLTableFunctionsCommon.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Enumerations

enum  MLFramework {
  MLFramework::DEFAULT, MLFramework::ONEDAL, MLFramework::ONEAPI, MLFramework::MLPACK,
  MLFramework::INVALID
}
 
enum  KMeansInitStrategy {
  KMeansInitStrategy::DEFAULT, KMeansInitStrategy::DETERMINISTIC, KMeansInitStrategy::RANDOM, KMeansInitStrategy::PLUS_PLUS,
  KMeansInitStrategy::INVALID
}
 
enum  VarImportanceMetric {
  VarImportanceMetric::DEFAULT, VarImportanceMetric::NONE, VarImportanceMetric::MDI, VarImportanceMetric::MDA,
  VarImportanceMetric::MDA_SCALED, VarImportanceMetric::INVALID
}
 

Functions

MLFramework get_ml_framework (const std::string &ml_framework_str)
 
KMeansInitStrategy get_kmeans_init_type (const std::string &init_type_str)
 
VarImportanceMetric get_var_importance_metric (const std::string &var_importance_metric_str)
 

Enumeration Type Documentation

enum KMeansInitStrategy
strong
Enumerator
DEFAULT 
DETERMINISTIC 
RANDOM 
PLUS_PLUS 
INVALID 

Definition at line 39 of file MLTableFunctionsCommon.h.

enum MLFramework
strong
Enumerator
DEFAULT 
ONEDAL 
ONEAPI 
MLPACK 
INVALID 

Definition at line 23 of file MLTableFunctionsCommon.h.

Function Documentation

KMeansInitStrategy get_kmeans_init_type ( const std::string &  init_type_str)
inline

Definition at line 41 of file MLTableFunctionsCommon.h.

References DEFAULT, DETERMINISTIC, INVALID, PLUS_PLUS, RANDOM, and to_upper().

Referenced by kmeans__cpu_template().

41  {
42  const auto upper_init_type_str = to_upper(init_type_str);
43  const static std::map<std::string, KMeansInitStrategy> kmeans_init_type_map = {
44  {"DEFAULT", KMeansInitStrategy::DEFAULT},
45  {"DETERMINISTIC", KMeansInitStrategy::DETERMINISTIC},
46  {"RANDOM", KMeansInitStrategy::RANDOM},
47  {"PLUS_PLUS", KMeansInitStrategy::PLUS_PLUS}};
48  const auto itr = kmeans_init_type_map.find(upper_init_type_str);
49  if (itr == kmeans_init_type_map.end()) {
51  }
52  return itr->second;
53 }
std::string to_upper(const std::string &str)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

MLFramework get_ml_framework ( const std::string &  ml_framework_str)
inline

Definition at line 25 of file MLTableFunctionsCommon.h.

References DEFAULT, INVALID, MLPACK, ONEAPI, ONEDAL, and to_upper().

Referenced by dbscan__cpu_template(), decision_tree_reg_impl(), gbt_reg_fit_impl(), kmeans__cpu_template(), linear_reg_fit_impl(), ml_reg_predict_impl(), pca_fit_impl(), and random_forest_reg_fit_impl().

25  {
26  const auto upper_ml_framework_str = to_upper(ml_framework_str);
27  const static std::map<std::string, MLFramework> ml_framework_map = {
28  {"DEFAULT", MLFramework::DEFAULT},
29  {"ONEDAL", MLFramework::ONEDAL},
30  {"ONEAPI", MLFramework::ONEAPI},
31  {"MLPACK", MLFramework::MLPACK}};
32  const auto itr = ml_framework_map.find(upper_ml_framework_str);
33  if (itr == ml_framework_map.end()) {
34  return MLFramework::INVALID;
35  }
36  return itr->second;
37 }
std::string to_upper(const std::string &str)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

VarImportanceMetric get_var_importance_metric ( const std::string &  var_importance_metric_str)
inline

Definition at line 57 of file MLTableFunctionsCommon.h.

References DEFAULT, INVALID, MDA, MDA_SCALED, MDI, NONE, and to_upper().

Referenced by random_forest_reg_fit_impl().

58  {
59  const auto upper_var_importance_metric_str = to_upper(var_importance_metric_str);
60  const static std::map<std::string, VarImportanceMetric> var_importance_metric_map = {
61  {"DEFAULT", VarImportanceMetric::DEFAULT},
62  {"NONE", VarImportanceMetric::NONE},
63  {"MDI", VarImportanceMetric::MDI},
64  {"MDA", VarImportanceMetric::MDA},
65  {"MDA_SCALED", VarImportanceMetric::MDA_SCALED}};
66  const auto itr = var_importance_metric_map.find(upper_var_importance_metric_str);
67  if (itr == var_importance_metric_map.end()) {
69  }
70  return itr->second;
71 }
std::string to_upper(const std::string &str)

+ Here is the call graph for this function:

+ Here is the caller graph for this function: