ts-aggregator/project_template/RMSE.cpp
2022-12-13 12:36:06 +04:00

29 lines
500 B
C++

#include "StdAfx.h"
#include "RMSE.h"
#include <vector>
#include <math.h>
Rmse::Rmse() {
}
Rmse::~Rmse() {
}
double Rmse::getValue(int paramCount, vector<double> original, vector<double> model) {
return 0;
}
double Rmse::getValue(vector<double> original, vector<double> model) {
double valueRMSE = 0;
int sampleSize = original.size();
for (int i = 0; i < sampleSize; i++) {
valueRMSE += pow(original[i] - model[i], 2);
}
valueRMSE = sqrt(valueRMSE / sampleSize);
return valueRMSE;
}