OmniSciDB  72c90bc290
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AbstractMLModel Class Referenceabstract

#include <AbstractMLModel.h>

+ Inheritance diagram for AbstractMLModel:
+ Collaboration diagram for AbstractMLModel:

Public Member Functions

 AbstractMLModel (const std::string &model_metadata)
 
 AbstractMLModel (const std::string &model_metadata, const std::vector< std::vector< std::string >> &cat_feature_keys)
 
virtual MLModelType getModelType () const =0
 
virtual std::string getModelTypeString () const =0
 
virtual int64_t getNumFeatures () const =0
 
virtual ~AbstractMLModel ()=default
 
const std::string & getModelMetadataStr () const
 
MLModelMetadata getModelMetadata () const
 
const std::vector< std::vector
< std::string > > & 
getCatFeatureKeys () const
 
const int64_t getNumCatFeatures () const
 
const int64_t getNumOneHotFeatures () const
 
const int64_t getNumLogicalFeatures () const
 

Protected Attributes

std::string model_metadata_
 
std::vector< std::vector
< std::string > > 
cat_feature_keys_
 

Detailed Description

Definition at line 34 of file AbstractMLModel.h.

Constructor & Destructor Documentation

AbstractMLModel::AbstractMLModel ( const std::string &  model_metadata)
inline

Definition at line 36 of file AbstractMLModel.h.

37  : model_metadata_(default_metadata(model_metadata)) {}
std::string default_metadata(const std::string &metadata)
std::string model_metadata_
AbstractMLModel::AbstractMLModel ( const std::string &  model_metadata,
const std::vector< std::vector< std::string >> &  cat_feature_keys 
)
inline

Definition at line 39 of file AbstractMLModel.h.

41  : model_metadata_(default_metadata(model_metadata))
42  , cat_feature_keys_(cat_feature_keys) {}
std::string default_metadata(const std::string &metadata)
std::vector< std::vector< std::string > > cat_feature_keys_
std::string model_metadata_
virtual AbstractMLModel::~AbstractMLModel ( )
virtualdefault

Member Function Documentation

const std::vector<std::vector<std::string> >& AbstractMLModel::getCatFeatureKeys ( ) const
inline

Definition at line 58 of file AbstractMLModel.h.

References cat_feature_keys_.

58  {
59  return cat_feature_keys_;
60  }
std::vector< std::vector< std::string > > cat_feature_keys_
MLModelMetadata AbstractMLModel::getModelMetadata ( ) const
inline

Definition at line 48 of file AbstractMLModel.h.

References getModelMetadataStr(), getModelType(), getModelTypeString(), getNumCatFeatures(), getNumFeatures(), and getNumLogicalFeatures().

48  {
49  return MLModelMetadata("",
50  getModelType(),
57  }
virtual MLModelType getModelType() const =0
const int64_t getNumCatFeatures() const
virtual int64_t getNumFeatures() const =0
const std::string & getModelMetadataStr() const
const int64_t getNumLogicalFeatures() const
virtual std::string getModelTypeString() const =0

+ Here is the call graph for this function:

const std::string& AbstractMLModel::getModelMetadataStr ( ) const
inline

Definition at line 47 of file AbstractMLModel.h.

References model_metadata_.

Referenced by getModelMetadata().

47 { return model_metadata_; }
std::string model_metadata_

+ Here is the caller graph for this function:

virtual MLModelType AbstractMLModel::getModelType ( ) const
pure virtual

Implemented in PcaModel, and LinearRegressionModel.

Referenced by getModelMetadata().

+ Here is the caller graph for this function:

virtual std::string AbstractMLModel::getModelTypeString ( ) const
pure virtual

Implemented in PcaModel, and LinearRegressionModel.

Referenced by getModelMetadata().

+ Here is the caller graph for this function:

const int64_t AbstractMLModel::getNumCatFeatures ( ) const
inline

Definition at line 61 of file AbstractMLModel.h.

References cat_feature_keys_.

Referenced by getModelMetadata(), and getNumLogicalFeatures().

61 { return cat_feature_keys_.size(); }
std::vector< std::vector< std::string > > cat_feature_keys_

+ Here is the caller graph for this function:

virtual int64_t AbstractMLModel::getNumFeatures ( ) const
pure virtual

Implemented in PcaModel, and LinearRegressionModel.

Referenced by getModelMetadata(), and getNumLogicalFeatures().

+ Here is the caller graph for this function:

const int64_t AbstractMLModel::getNumLogicalFeatures ( ) const
inline

Definition at line 71 of file AbstractMLModel.h.

References getNumCatFeatures(), getNumFeatures(), and getNumOneHotFeatures().

Referenced by getModelMetadata().

71  {
73  }
const int64_t getNumCatFeatures() const
virtual int64_t getNumFeatures() const =0
const int64_t getNumOneHotFeatures() const

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

const int64_t AbstractMLModel::getNumOneHotFeatures ( ) const
inline

Definition at line 63 of file AbstractMLModel.h.

References cat_feature_keys_.

Referenced by getNumLogicalFeatures().

63  {
64  int64_t num_one_hot_features{0};
65  for (const auto& cat_feature_key : cat_feature_keys_) {
66  num_one_hot_features += static_cast<int64_t>(cat_feature_key.size());
67  }
68  return num_one_hot_features;
69  }
std::vector< std::vector< std::string > > cat_feature_keys_

+ Here is the caller graph for this function:

Member Data Documentation

std::vector<std::vector<std::string> > AbstractMLModel::cat_feature_keys_
protected

Definition at line 77 of file AbstractMLModel.h.

Referenced by getCatFeatureKeys(), getNumCatFeatures(), and getNumOneHotFeatures().

std::string AbstractMLModel::model_metadata_
protected

Definition at line 76 of file AbstractMLModel.h.

Referenced by getModelMetadataStr().


The documentation for this class was generated from the following file: