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

30 lines
641 B
C++

#include "StdAfx.h"
#include <iostream>
#include "Mape.h"
#include "Math.h"
#include <vector>
// êðèòåðèé Mape. Íàñëåäóåòñÿ îò êëàññà Estimation.
// ðåàëèçóåò ìåòîä "ïîëó÷èòü çíà÷åíèå êðèòåðèÿ"
Mape::Mape() {
}
Mape::~Mape() {
}
double Mape::getValue(int paramCount, vector<double> original, vector<double> model) {
return 0;
}
double Mape::getValue(vector<double> original, vector<double> model) {
double mape = 0;
for (int i = 0; i < original.size(); i++) {
mape += fabs((fabs(original[i] - model[i])) / original[i]);
}
mape = mape / original.size();
mape = mape * 100;
return mape;
}