OmniSciDB  a5dc49c757
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
LinearRegressionModel Class Reference

#include <MLModel.h>

+ Inheritance diagram for LinearRegressionModel:
+ Collaboration diagram for LinearRegressionModel:

Public Member Functions

 LinearRegressionModel (const std::vector< double > &coefs, const std::string &model_metadata)
 
 LinearRegressionModel (const std::vector< double > &coefs, const std::string &model_metadata, const std::vector< std::vector< std::string >> &cat_feature_keys)
 
virtual MLModelType getModelType () const override
 
virtual std::string getModelTypeString () const override
 
virtual int64_t getNumFeatures () const override
 
const std::vector< double > & getCoefs () const
 
- Public Member Functions inherited from AbstractMLModel
 AbstractMLModel (const std::string &model_metadata)
 
 AbstractMLModel (const std::string &model_metadata, const std::vector< std::vector< std::string >> &cat_feature_keys)
 
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
 

Private Attributes

std::vector< double > coefs_
 

Additional Inherited Members

- Protected Attributes inherited from AbstractMLModel
std::string model_metadata_
 
std::vector< std::vector
< std::string > > 
cat_feature_keys_
 

Detailed Description

Definition at line 127 of file MLModel.h.

Constructor & Destructor Documentation

LinearRegressionModel::LinearRegressionModel ( const std::vector< double > &  coefs,
const std::string &  model_metadata 
)
inline

Definition at line 129 of file MLModel.h.

131  : AbstractMLModel(model_metadata), coefs_(coefs) {}
std::vector< double > coefs_
Definition: MLModel.h:149
AbstractMLModel(const std::string &model_metadata)
LinearRegressionModel::LinearRegressionModel ( const std::vector< double > &  coefs,
const std::string &  model_metadata,
const std::vector< std::vector< std::string >> &  cat_feature_keys 
)
inline

Definition at line 133 of file MLModel.h.

136  : AbstractMLModel(model_metadata, cat_feature_keys), coefs_(coefs) {}
std::vector< double > coefs_
Definition: MLModel.h:149
AbstractMLModel(const std::string &model_metadata)

Member Function Documentation

const std::vector<double>& LinearRegressionModel::getCoefs ( ) const
inline

Definition at line 146 of file MLModel.h.

References coefs_.

Referenced by ShowModelFeatureDetailsCommand::extractExtraMetadata().

146 { return coefs_; }
std::vector< double > coefs_
Definition: MLModel.h:149

+ Here is the caller graph for this function:

virtual MLModelType LinearRegressionModel::getModelType ( ) const
inlineoverridevirtual

Implements AbstractMLModel.

Definition at line 138 of file MLModel.h.

References LINEAR_REG.

virtual std::string LinearRegressionModel::getModelTypeString ( ) const
inlineoverridevirtual

Implements AbstractMLModel.

Definition at line 140 of file MLModel.h.

140 { return "Linear Regression"; }
virtual int64_t LinearRegressionModel::getNumFeatures ( ) const
inlineoverridevirtual

Implements AbstractMLModel.

Definition at line 142 of file MLModel.h.

References coefs_.

142  {
143  return static_cast<int64_t>(coefs_.size()) - 1;
144  }
std::vector< double > coefs_
Definition: MLModel.h:149

Member Data Documentation

std::vector<double> LinearRegressionModel::coefs_
private

Definition at line 149 of file MLModel.h.

Referenced by getCoefs(), and getNumFeatures().


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