Digitalisierte Elektroverteilung zur permanenten Verbraucherüberwachung
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

MLAnalyzer.cpp 1.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #include "MLAnalyzer.h"
  2. #include <sstream>
  3. #include "DataModel.h"
  4. #include "SystemConfig.h"
  5. MLAnalyzer::MLAnalyzer(CappedStorage *storage) :
  6. n(storage->getN()), m(storage->getM()), data(storage), updateRate(SystemConfig::getIntConfigParameter("update_model_rate"))
  7. {
  8. }
  9. void MLAnalyzer::addData(Eigen::VectorXd Px, double Py)
  10. {
  11. Eigen::Matrix<double, 1, 1> temp;
  12. temp << Py;
  13. addData(Px, temp);
  14. }
  15. void MLAnalyzer::addData(Eigen::MatrixXd Px, Eigen::VectorXd Py)
  16. {
  17. //if(Px.cols() != n || (Px.rows() != Py.rows())){
  18. // std::stringstream ss;
  19. // ss << "Invalid Matrix dimensions: ";
  20. // throw ss.str();
  21. //}
  22. //
  23. //X.conservativeResize(X.rows()+Px.rows(), Eigen::NoChange_t());
  24. //y.conservativeResize(y.rows()+Py.rows(), Eigen::NoChange_t());
  25. //
  26. //X.block(m, 0, Px.rows(), 1) = Eigen::MatrixXd::Ones(Px.rows(), 1);
  27. //X.block(m, 1, Px.rows(), Px.cols()) = Px;
  28. //
  29. //m += X.rows();
  30. //
  31. //if(++currentBatch >= trainAfterNPoints){
  32. // updateModel();
  33. // currentBatch = 0;
  34. //}
  35. }