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.h 726B

12345678910111213141516171819202122232425262728293031323334353637
  1. #ifndef MLANALYZER_H
  2. #define MLANALYZER_H
  3. #include <chrono>
  4. #include <vector>
  5. #include <eigen3/Eigen/Dense>
  6. #include "DataModel.h"
  7. #include "MLAlert.h"
  8. //Interface for Machine Learning algorithms
  9. class MLAnalyzer
  10. {
  11. protected:
  12. std::chrono::milliseconds updateTime;
  13. const long long n;
  14. long long m;
  15. unsigned short currentBatch = 0;
  16. const unsigned short trainAfterNPoints = 10;
  17. //Data references
  18. CappedStorage* data;
  19. const int updateRate;
  20. int updateCounter = 0;
  21. public:
  22. MLAnalyzer(CappedStorage *storage);
  23. void addData(Eigen::VectorXd Px, double Py);
  24. void addData(Eigen::MatrixXd Px, Eigen::VectorXd Py);
  25. virtual MLAlert updateModel() = 0;
  26. };
  27. #endif // MLANALYZER_H