38 explicit AdalineSGD(
double _eta = 0.01,
int iter = 10,
bool _shuffle =
false,
int _randomState = 0)
43 sgd =
SGD(_eta, iter, _shuffle);
94 std::function<bool(
double)> condition = [](
double x) {
return bool(x >= 0.0); };
Definition: Classifier.h:70
Definition: AdalineSGD.h:21
void partial_fit(const Matrix< double > &X, const Matrix< double > &y)
Definition: AdalineSGD.h:62
bool shuffle
signalizes whether given dataset should be shuffled while fitting
Definition: AdalineSGD.h:24
Matrix< double > predict(const Matrix< double > &X) override
Definition: AdalineSGD.h:93
AdalineSGD(double _eta=0.01, int iter=10, bool _shuffle=false, int _randomState=0)
Definition: AdalineSGD.h:38
Matrix< double > netInput(const Matrix< double > &X) override
Definition: AdalineSGD.h:72
int randomState
initialize weights with random state
Definition: AdalineSGD.h:26
double costFunction(const Matrix< double > &X) override
Definition: AdalineSGD.h:79
Matrix< double > activation(const Matrix< double > &X) override
Definition: AdalineSGD.h:86
void fit(const Matrix< double > &X, const Matrix< double > &y) override
Definition: AdalineSGD.h:52
SGD sgd
algorithmic object to represent fitting algorithm
Definition: AdalineSGD.h:28
bool w_initialized
flag to initialize weights only once
Definition: Classifier.h:25
Matrix< double > weights
Vector holding weights.
Definition: Classifier.h:29
void initialize_weights(size_t numRows, size_t numColumns=1)
Definition: Classifier.h:45
size_t columns() const
Definition: Matrix.h:198
static void SetSeed(int seed)
Definition: Random.h:30
void partial_fit(const Matrix< double > &X, const Matrix< double > &y, Matrix< double > &weights) const
Definition: SGD.h:86
static Matrix< double > netInput(const Matrix< double > &X, const Matrix< double > &weights)
Definition: SGD.h:132
void fit(const Matrix< double > &X, const Matrix< double > &y, Matrix< double > &weights)
Definition: SGD.h:57
Matrix< T > where(const std::function< bool(T)> &condition, const Matrix< T > &in, const Matrix< T > &valIfTrue, const Matrix< T > &valIfFalse)
Definition: matrix_utils.h:194