#include "MLAnalyzer.h" #include #include "DataModel.h" #include "SystemConfig.h" MLAnalyzer::MLAnalyzer(CappedStorage *storage) : n(storage->getN()), m(storage->getM()), data(storage), updateRate(SystemConfig::getIntConfigParameter("update_model_rate")) { } void MLAnalyzer::addData(Eigen::VectorXd Px, double Py) { Eigen::Matrix temp; temp << Py; addData(Px, temp); } void MLAnalyzer::addData(Eigen::MatrixXd Px, Eigen::VectorXd Py) { //if(Px.cols() != n || (Px.rows() != Py.rows())){ // std::stringstream ss; // ss << "Invalid Matrix dimensions: "; // throw ss.str(); //} // //X.conservativeResize(X.rows()+Px.rows(), Eigen::NoChange_t()); //y.conservativeResize(y.rows()+Py.rows(), Eigen::NoChange_t()); // //X.block(m, 0, Px.rows(), 1) = Eigen::MatrixXd::Ones(Px.rows(), 1); //X.block(m, 1, Px.rows(), Px.cols()) = Px; // //m += X.rows(); // //if(++currentBatch >= trainAfterNPoints){ // updateModel(); // currentBatch = 0; //} }