#include <MLModelMetadata.h>
Definition at line 24 of file MLModelMetadata.h.
MLModelMetadata::MLModelMetadata |
( |
const std::string & |
model_name, |
|
|
const MLModelType |
model_type, |
|
|
const std::string & |
model_type_str, |
|
|
const int64_t |
num_logical_features, |
|
|
const int64_t |
num_features, |
|
|
const int64_t |
num_categorical_features, |
|
|
const int64_t |
num_numeric_features, |
|
|
const std::string & |
model_metadata_json |
|
) |
| |
|
inline |
void MLModelMetadata::extractModelMetadata |
( |
const std::string & |
model_metadata_json, |
|
|
const int64_t |
num_logical_features |
|
) |
| |
Definition at line 23 of file MLModelMetadata.cpp.
References data_split_eval_fraction_, data_split_train_fraction_, feature_permutations_, features_, predicted_, and training_query_.
Referenced by MLModelMetadata().
25 rapidjson::Document model_metadata_doc;
26 model_metadata_doc.Parse(model_metadata_json.c_str());
27 if (model_metadata_doc.HasMember(
"predicted") &&
28 model_metadata_doc[
"predicted"].IsString()) {
29 predicted_ = model_metadata_doc[
"predicted"].GetString();
31 if (model_metadata_doc.HasMember(
"training_query") &&
32 model_metadata_doc[
"training_query"].IsString()) {
35 if (model_metadata_doc.HasMember(
"features") &&
36 model_metadata_doc[
"features"].IsArray()) {
37 const rapidjson::Value& features_array = model_metadata_doc[
"features"];
38 for (
const auto& feature : features_array.GetArray()) {
39 features_.emplace_back(feature.GetString());
42 features_.resize(num_logical_features,
"");
44 if (model_metadata_doc.HasMember(
"data_split_train_fraction") &&
45 model_metadata_doc[
"data_split_train_fraction"].IsDouble()) {
48 model_metadata_doc[
"data_split_train_fraction"].GetDouble();
50 if (model_metadata_doc.HasMember(
"data_split_eval_fraction") &&
51 model_metadata_doc[
"data_split_eval_fraction"].IsDouble()) {
54 model_metadata_doc[
"data_split_eval_fraction"].GetDouble();
56 if (model_metadata_doc.HasMember(
"feature_permutations") &&
57 model_metadata_doc[
"feature_permutations"].IsArray()) {
58 const rapidjson::Value& feature_permutations_array =
59 model_metadata_doc[
"feature_permutations"];
60 for (
const auto& feature_permutation : feature_permutations_array.GetArray()) {
double MLModelMetadata::getDataSplitEvalFraction |
( |
| ) |
const |
|
inline |
double MLModelMetadata::getDataSplitTrainFraction |
( |
| ) |
const |
|
inline |
const std::vector<int64_t>& MLModelMetadata::getFeaturePermutations |
( |
| ) |
const |
|
inline |
const std::vector<std::string>& MLModelMetadata::getFeatures |
( |
| ) |
const |
|
inline |
const std::string& MLModelMetadata::getModelName |
( |
| ) |
const |
|
inline |
const MLModelType MLModelMetadata::getModelType |
( |
| ) |
const |
|
inline |
const std::string& MLModelMetadata::getModelTypeStr |
( |
| ) |
const |
|
inline |
int64_t MLModelMetadata::getNumCategoricalFeatures |
( |
| ) |
const |
|
inline |
int64_t MLModelMetadata::getNumFeatures |
( |
| ) |
const |
|
inline |
int64_t MLModelMetadata::getNumLogicalFeatures |
( |
| ) |
const |
|
inline |
int64_t MLModelMetadata::getNumNumericFeatures |
( |
| ) |
const |
|
inline |
const std::string& MLModelMetadata::getPredicted |
( |
| ) |
const |
|
inline |
const std::string& MLModelMetadata::getTrainingQuery |
( |
| ) |
const |
|
inline |
double MLModelMetadata::data_split_eval_fraction_ {0.0} |
|
private |
double MLModelMetadata::data_split_train_fraction_ {1.0} |
|
private |
std::vector<int64_t> MLModelMetadata::feature_permutations_ |
|
private |
std::vector<std::string> MLModelMetadata::features_ |
|
private |
const std::string MLModelMetadata::model_name_ |
|
private |
const std::string MLModelMetadata::model_type_str_ |
|
private |
const int64_t MLModelMetadata::num_categorical_features_ |
|
private |
const int64_t MLModelMetadata::num_features_ |
|
private |
const int64_t MLModelMetadata::num_logical_features_ |
|
private |
const int64_t MLModelMetadata::num_numeric_features_ |
|
private |
std::string MLModelMetadata::predicted_ |
|
private |
std::string MLModelMetadata::training_query_ |
|
private |
The documentation for this class was generated from the following files:
- /home/jenkins-slave/workspace/core-os-doxygen/QueryEngine/TableFunctions/SystemFunctions/os/ML/MLModelMetadata.h
- /home/jenkins-slave/workspace/core-os-doxygen/QueryEngine/TableFunctions/SystemFunctions/os/ML/MLModelMetadata.cpp