Class implementing multiclassification logistic regression.
More...
#include <multiclass_logistic_regression.h>
|
| MulticlassLogisticRegression (uint64_t features, uint64_t classes, bool bias_enabled=true) |
| Constructor for MulticlassLogisticRegression.
|
|
uint64_t | Features () const |
| Get number of features in each sample for the model.
|
|
void | FitSGD (const Eigen::MatrixXf &samples, const Eigen::MatrixXi &targets, float learning_rate, uint64_t batch_size, uint64_t epochs) |
| Fit model using stochastic gradient descent with given hyperparameters.
|
|
Eigen::MatrixXf | Predict (Eigen::MatrixXf samples) |
| Get predictions for a given matrix of samples.
|
|
Class implementing multiclassification logistic regression.
◆ MulticlassLogisticRegression()
plusml::MulticlassLogisticRegression::MulticlassLogisticRegression |
( |
uint64_t | features, |
|
|
uint64_t | classes, |
|
|
bool | bias_enabled = true ) |
Constructor for MulticlassLogisticRegression.
- Parameters
-
features | Number of features in each sample |
classes | Number of classes in classification problem |
bias_enabled | Specifies whether to use bias or not |
◆ Features()
uint64_t plusml::MulticlassLogisticRegression::Features |
( |
| ) |
const |
Get number of features in each sample for the model.
- Returns
- Number of features in each sample for the model
◆ FitSGD()
void plusml::MulticlassLogisticRegression::FitSGD |
( |
const Eigen::MatrixXf & | samples, |
|
|
const Eigen::MatrixXi & | targets, |
|
|
float | learning_rate, |
|
|
uint64_t | batch_size, |
|
|
uint64_t | epochs ) |
Fit model using stochastic gradient descent with given hyperparameters.
- Parameters
-
samples | Matrix of samples (MxN where M is number of samples and N is number of features in each sample) |
targets | Matrix of targets (Mx1 where M is number of samples) |
learning_rate | Learning rate for SGD |
batch_size | Batch size for SGD |
epochs | Number of epochs for SGD |
◆ Predict()
Eigen::MatrixXf plusml::MulticlassLogisticRegression::Predict |
( |
Eigen::MatrixXf | samples | ) |
|
Get predictions for a given matrix of samples.
- Parameters
-
samples | Matrix of samples (MxN where M is number of samples and N is number of features in each sample) |
- Returns
- Matrix of predicted probabilities (MxN where M is number of samples and N is number of classes)
The documentation for this class was generated from the following files: