OmniSciDB  72c90bc290
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MLModelType.h File Reference
#include "Logger/Logger.h"
#include "Shared/StringTransform.h"
#include "Shared/misc.h"
#include <string>
+ Include dependency graph for MLModelType.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Enumerations

enum  MLModelType {
  LINEAR_REG, DECISION_TREE_REG, GBT_REG, RANDOM_FOREST_REG,
  PCA
}
 

Functions

std::string get_ml_model_type_str (const MLModelType model_type)
 
MLModelType get_ml_model_type_from_str (const std::string &model_type_str)
 
bool is_regression_model (const MLModelType model_type)
 

Enumeration Type Documentation

Enumerator
LINEAR_REG 
DECISION_TREE_REG 
GBT_REG 
RANDOM_FOREST_REG 
PCA 

Definition at line 25 of file MLModelType.h.

Function Documentation

MLModelType get_ml_model_type_from_str ( const std::string &  model_type_str)
inline

Definition at line 52 of file MLModelType.h.

References DECISION_TREE_REG, GBT_REG, LINEAR_REG, PCA, RANDOM_FOREST_REG, and to_upper().

Referenced by Parser::CreateModelStmt::CreateModelStmt().

52  {
53  const auto upper_model_type_str = to_upper(model_type_str);
54  if (upper_model_type_str == "LINEAR_REG") {
56  } else if (upper_model_type_str == "DECISION_TREE_REG") {
58  } else if (upper_model_type_str == "GBT_REG") {
59  return MLModelType::GBT_REG;
60  } else if (upper_model_type_str == "RANDOM_FOREST_REG") {
62  } else if (upper_model_type_str == "PCA") {
63  return MLModelType::PCA;
64  } else {
65  throw std::invalid_argument("Unknown model type: " + upper_model_type_str);
66  }
67 }
std::string to_upper(const std::string &str)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

std::string get_ml_model_type_str ( const MLModelType  model_type)
inline

Definition at line 27 of file MLModelType.h.

References CHECK, DECISION_TREE_REG, GBT_REG, LINEAR_REG, PCA, and RANDOM_FOREST_REG.

Referenced by Parser::CreateModelStmt::train_model().

27  {
28  switch (model_type) {
30  return "LINEAR_REG";
31  }
33  return "DECISION_TREE_REG";
34  }
35  case MLModelType::GBT_REG: {
36  return "GBT_REG";
37  }
39  return "RANDOM_FOREST_REG";
40  }
41  case MLModelType::PCA: {
42  return "PCA";
43  }
44  default: {
45  CHECK(false) << "Unknown model type.";
46  // Satisfy compiler
47  return "LINEAR_REG";
48  }
49  }
50 }
#define CHECK(condition)
Definition: Logger.h:291

+ Here is the caller graph for this function:

bool is_regression_model ( const MLModelType  model_type)
inline

Definition at line 69 of file MLModelType.h.

References DECISION_TREE_REG, GBT_REG, shared::is_any(), LINEAR_REG, and RANDOM_FOREST_REG.

Referenced by Parser::CreateModelStmt::build_model_query(), and EvaluateModelCommand::execute().

+ Here is the call graph for this function:

+ Here is the caller graph for this function: