class that specifies the machine learning algorithm to pair with Feat.
More...
#include <ml.h>
|
| | ML (string ml="LinearRidgeRegression", bool norm=true, bool classification=false, int n_classes=2) |
| |
| void | init (bool assign_p_est=true) |
| |
| | ~ML () |
| |
| vector< float > | get_weights (bool norm_adjust=true) const |
| |
| shared_ptr< CLabels > | fit (const MatrixXf &X, const VectorXf &y, const Parameters ¶ms, bool &pass, const vector< char > &dtypes=vector< char >()) |
| |
| VectorXf | fit_vector (const MatrixXf &X, const VectorXf &y, const Parameters ¶ms, bool &pass, const vector< char > &dtypes=vector< char >()) |
| |
| shared_ptr< CLabels > | predict (const MatrixXf &X, bool print=false) |
| |
| VectorXf | predict_vector (const MatrixXf &X) |
| |
| ArrayXXf | predict_proba (const MatrixXf &X) |
| |
| VectorXf | labels_to_vector (const shared_ptr< CLabels > &labels) |
| | utility function to convert CLabels types to VectorXd types. More...
|
| |
| shared_ptr< CLabels > | retrieve_labels (CDenseFeatures< float64_t > *features, bool proba, bool &pass) |
| | returns labels of a fitted model estimating on features More...
|
| |
| void | set_dtypes (const vector< char > &dtypes) |
| |
| float | get_bias (bool norm_adjust=true) const |
| | returns bias for linear machines
More...
|
| |
| void | set_bias (float b) |
| |
| shared_ptr< CLabels > | fit_tune (MatrixXf &X, VectorXf &y, const Parameters ¶ms, bool &pass, const vector< char > &dtypes=vector< char >(), bool set_default=false) |
| | tune algorithm parameters More...
|
| |
class that specifies the machine learning algorithm to pair with Feat.
Definition at line 79 of file ml.h.
◆ ML()
| FT::Model::ML::ML |
( |
string |
ml = "LinearRidgeRegression", |
|
|
bool |
norm = true, |
|
|
bool |
classification = false, |
|
|
int |
n_classes = 2 |
|
) |
| |
use string to specify a desired ML algorithm from shogun.
Definition at line 21 of file ml.cc.
◆ ~ML()
◆ fit()
| shared_ptr< CLabels > FT::Model::ML::fit |
( |
const MatrixXf & |
X, |
|
|
const VectorXf & |
y, |
|
|
const Parameters & |
params, |
|
|
bool & |
pass, |
|
|
const vector< char > & |
dtypes = vector<char>() |
|
) |
| |
Trains ml on X, y to generate output yhat = f(X).
- Parameters
-
| X | n_features x n_samples matrix |
| y | n_samples vector of training labels |
| params | feat parameters |
| [out] | pass | returns True if fit was successful, False if not |
| dtypes | the data types of features in X |
- Returns
- yhat: n_samples vector of outputs
Definition at line 282 of file ml.cc.
◆ fit_tune()
| shared_ptr< CLabels > FT::Model::ML::fit_tune |
( |
MatrixXf & |
X, |
|
|
VectorXf & |
y, |
|
|
const Parameters & |
params, |
|
|
bool & |
pass, |
|
|
const vector< char > & |
dtypes = vector<char>(), |
|
|
bool |
set_default = false |
|
) |
| |
tune algorithm parameters
Definition at line 676 of file ml.cc.
◆ fit_vector()
| VectorXf FT::Model::ML::fit_vector |
( |
const MatrixXf & |
X, |
|
|
const VectorXf & |
y, |
|
|
const Parameters & |
params, |
|
|
bool & |
pass, |
|
|
const vector< char > & |
dtypes = vector<char>() |
|
) |
| |
◆ get_bias()
| float FT::Model::ML::get_bias |
( |
bool |
norm_adjust = true | ) |
const |
returns bias for linear machines
Definition at line 565 of file ml.cc.
◆ get_weights()
| vector< float > FT::Model::ML::get_weights |
( |
bool |
norm_adjust = true | ) |
const |
- Returns
- weight vector from model.
Definition at line 211 of file ml.cc.
◆ init()
| void FT::Model::ML::init |
( |
bool |
assign_p_est = true | ) |
|
Definition at line 71 of file ml.cc.
◆ labels_to_vector()
| VectorXf FT::Model::ML::labels_to_vector |
( |
const shared_ptr< CLabels > & |
labels | ) |
|
utility function to convert CLabels types to VectorXd types.
Definition at line 539 of file ml.cc.
◆ predict()
| shared_ptr< CLabels > FT::Model::ML::predict |
( |
const MatrixXf & |
X, |
|
|
bool |
print = false |
|
) |
| |
◆ predict_proba()
| ArrayXXf FT::Model::ML::predict_proba |
( |
const MatrixXf & |
X | ) |
|
◆ predict_vector()
| VectorXf FT::Model::ML::predict_vector |
( |
const MatrixXf & |
X | ) |
|
◆ retrieve_labels()
| shared_ptr< CLabels > FT::Model::ML::retrieve_labels |
( |
CDenseFeatures< float64_t > * |
features, |
|
|
bool |
proba, |
|
|
bool & |
pass |
|
) |
| |
returns labels of a fitted model estimating on features
Definition at line 614 of file ml.cc.
◆ set_bias()
| void FT::Model::ML::set_bias |
( |
float |
b | ) |
|
◆ set_dtypes()
| void FT::Model::ML::set_dtypes |
( |
const vector< char > & |
dtypes | ) |
|
Definition at line 146 of file ml.h.
◆ dtypes
| vector<char> FT::Model::ML::dtypes |
|
private |
Definition at line 149 of file ml.h.
◆ max_train_time
| int FT::Model::ML::max_train_time |
max seconds allowed for training
Definition at line 143 of file ml.h.
◆ ml_hash
| std::map<string, ML_TYPE> FT::Model::ML::ml_hash |
Definition at line 92 of file ml.h.
◆ ml_str
| string FT::Model::ML::ml_str |
user specified ML type (string)
Definition at line 139 of file ml.h.
◆ ml_type
user specified ML type
Definition at line 138 of file ml.h.
normalization
Definition at line 142 of file ml.h.
◆ normalize
| bool FT::Model::ML::normalize |
control whether ML normalizes its input before training
Definition at line 144 of file ml.h.
◆ p_est
| shared_ptr<sh::CMachine> FT::Model::ML::p_est |
pointer to the ML object
Definition at line 137 of file ml.h.
◆ prob_type
| sh::EProblemType FT::Model::ML::prob_type |
type of learning problem; binary, multiclass or regression
Definition at line 140 of file ml.h.
The documentation for this class was generated from the following files: