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

#include <MLModel.h>

+ Inheritance diagram for PcaModel:
+ Collaboration diagram for PcaModel:

Public Member Functions

 PcaModel (const std::vector< double > &col_means, const std::vector< double > &col_std_devs, const std::vector< std::vector< double >> &eigenvectors, const std::vector< double > &eigenvalues, const std::string &model_metadata)
 
 PcaModel (const std::vector< double > &col_means, const std::vector< double > &col_std_devs, const std::vector< std::vector< double >> &eigenvectors, const std::vector< double > &eigenvalues, 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 > & getColumnMeans () const
 
const std::vector< double > & getColumnStdDevs () const
 
const std::vector< std::vector
< double > > & 
getEigenvectors () const
 
const std::vector< double > & getEigenvalues () 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 > col_means_
 
std::vector< double > col_std_devs_
 
std::vector< std::vector
< double > > 
eigenvectors_
 
std::vector< double > eigenvalues_
 

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 429 of file MLModel.h.

Constructor & Destructor Documentation

PcaModel::PcaModel ( const std::vector< double > &  col_means,
const std::vector< double > &  col_std_devs,
const std::vector< std::vector< double >> &  eigenvectors,
const std::vector< double > &  eigenvalues,
const std::string &  model_metadata 
)
inline

Definition at line 431 of file MLModel.h.

436  : AbstractMLModel(model_metadata)
437  , col_means_(col_means)
438  , col_std_devs_(col_std_devs)
439  , eigenvectors_(eigenvectors)
440  , eigenvalues_(eigenvalues) {}
std::vector< double > eigenvalues_
Definition: MLModel.h:473
std::vector< double > col_std_devs_
Definition: MLModel.h:471
std::vector< double > col_means_
Definition: MLModel.h:470
AbstractMLModel(const std::string &model_metadata)
std::vector< std::vector< double > > eigenvectors_
Definition: MLModel.h:472
PcaModel::PcaModel ( const std::vector< double > &  col_means,
const std::vector< double > &  col_std_devs,
const std::vector< std::vector< double >> &  eigenvectors,
const std::vector< double > &  eigenvalues,
const std::string &  model_metadata,
const std::vector< std::vector< std::string >> &  cat_feature_keys 
)
inline

Definition at line 442 of file MLModel.h.

448  : AbstractMLModel(model_metadata, cat_feature_keys)
449  , col_means_(col_means)
450  , col_std_devs_(col_std_devs)
451  , eigenvectors_(eigenvectors)
452  , eigenvalues_(eigenvalues) {}
std::vector< double > eigenvalues_
Definition: MLModel.h:473
std::vector< double > col_std_devs_
Definition: MLModel.h:471
std::vector< double > col_means_
Definition: MLModel.h:470
AbstractMLModel(const std::string &model_metadata)
std::vector< std::vector< double > > eigenvectors_
Definition: MLModel.h:472

Member Function Documentation

const std::vector<double>& PcaModel::getColumnMeans ( ) const
inline

Definition at line 462 of file MLModel.h.

462 { return col_means_; }
std::vector< double > col_means_
Definition: MLModel.h:470
const std::vector<double>& PcaModel::getColumnStdDevs ( ) const
inline

Definition at line 463 of file MLModel.h.

463 { return col_std_devs_; }
std::vector< double > col_std_devs_
Definition: MLModel.h:471
const std::vector<double>& PcaModel::getEigenvalues ( ) const
inline

Definition at line 467 of file MLModel.h.

Referenced by ShowModelFeatureDetailsCommand::extractExtraMetadata().

467 { return eigenvalues_; }
std::vector< double > eigenvalues_
Definition: MLModel.h:473

+ Here is the caller graph for this function:

const std::vector<std::vector<double> >& PcaModel::getEigenvectors ( ) const
inline

Definition at line 464 of file MLModel.h.

464  {
465  return eigenvectors_;
466  }
std::vector< std::vector< double > > eigenvectors_
Definition: MLModel.h:472
virtual MLModelType PcaModel::getModelType ( ) const
inlineoverridevirtual

Implements AbstractMLModel.

Definition at line 454 of file MLModel.h.

References PCA.

454 { return MLModelType::PCA; }
virtual std::string PcaModel::getModelTypeString ( ) const
inlineoverridevirtual

Implements AbstractMLModel.

Definition at line 456 of file MLModel.h.

456 { return "PCA"; }
virtual int64_t PcaModel::getNumFeatures ( ) const
inlineoverridevirtual

Implements AbstractMLModel.

Definition at line 458 of file MLModel.h.

458  {
459  return static_cast<int64_t>(col_means_.size());
460  }
std::vector< double > col_means_
Definition: MLModel.h:470

Member Data Documentation

std::vector<double> PcaModel::col_means_
private

Definition at line 470 of file MLModel.h.

std::vector<double> PcaModel::col_std_devs_
private

Definition at line 471 of file MLModel.h.

std::vector<double> PcaModel::eigenvalues_
private

Definition at line 473 of file MLModel.h.

std::vector<std::vector<double> > PcaModel::eigenvectors_
private

Definition at line 472 of file MLModel.h.


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