OmniSciDB  c1a53651b2
 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::MLPACK, MLFramework::INVALID }
 
enum  KMeansInitStrategy {
  KMeansInitStrategy::DEFAULT, KMeansInitStrategy::DETERMINISTIC, KMeansInitStrategy::RANDOM, KMeansInitStrategy::PLUS_PLUS,
  KMeansInitStrategy::INVALID
}
 

Functions

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

Enumeration Type Documentation

enum KMeansInitStrategy
strong
Enumerator
DEFAULT 
DETERMINISTIC 
RANDOM 
PLUS_PLUS 
INVALID 

Definition at line 38 of file MLTableFunctionsCommon.h.

enum MLFramework
strong
Enumerator
DEFAULT 
ONEDAL 
MLPACK 
INVALID 

Definition at line 23 of file MLTableFunctionsCommon.h.

Function Documentation

KMeansInitStrategy get_kmeans_init_type ( const std::string &  init_type_str)

Definition at line 40 of file MLTableFunctionsCommon.h.

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

Referenced by kmeans__cpu_template().

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

Definition at line 25 of file MLTableFunctionsCommon.h.

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

Referenced by dbscan__cpu_template(), kmeans__cpu_template(), linear_reg_fit__cpu_template(), and linear_reg_predict__cpu_template().

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  {"MLPACK", MLFramework::MLPACK}};
31  const auto itr = ml_framework_map.find(upper_ml_framework_str);
32  if (itr == ml_framework_map.end()) {
33  return MLFramework::INVALID;
34  }
35  return itr->second;
36 }
std::string to_upper(const std::string &str)

+ Here is the call graph for this function:

+ Here is the caller graph for this function: