AlgoPlus v0.1.0
Loading...
Searching...
No Matches
logistic_regression Class Reference

logistic regression class The implementation follows this: https://www.stat.cmu.edu/~ryantibs/advmethods/notes/logreg.pdf More...

#include <log_reg.h>

Public Member Functions

 logistic_regression (const std::vector< std::vector< double > > data, const double lr=0.001, const double bias=0.001, const int epochs=10)
 default constructor for logistic regression class
 
void fit ()
 fits the input to the classifier, performs gradient descent using the predictors and learning rate.
 

Detailed Description

logistic regression class The implementation follows this: https://www.stat.cmu.edu/~ryantibs/advmethods/notes/logreg.pdf

Constructor & Destructor Documentation

◆ logistic_regression()

logistic_regression::logistic_regression ( const std::vector< std::vector< double > > data,
const double lr = 0.001,
const double bias = 0.001,
const int epochs = 10 )
inlineexplicit

default constructor for logistic regression class

Parameters
data(vector<vector<double>>): The passed data, x.back() for each x in data is the label of each data. So for example, let's assume x[0] = {1.2, 3.4, 5.4, 0.0}, 0 is the label for this row.
lr(double)learning rate
bias(double)the input bias
epochs(int)the number of epochs

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