36 lines
876 B
C++
36 lines
876 B
C++
|
#include "StdAfx.h"
|
|||
|
#include <iostream>
|
|||
|
#include "SMape.h"
|
|||
|
#include "Math.h"
|
|||
|
#include <vector>
|
|||
|
|
|||
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> SMape. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Estimation.
|
|||
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
|
|||
|
|
|||
|
SMape::SMape() {
|
|||
|
|
|||
|
}
|
|||
|
|
|||
|
SMape::~SMape() {
|
|||
|
}
|
|||
|
|
|||
|
double SMape::getValue(int countParams, vector<double> original, vector<double> model) {
|
|||
|
return 0;
|
|||
|
}
|
|||
|
|
|||
|
double SMape::getValue(vector<double> original, vector<double> model) {
|
|||
|
double smape = 0;
|
|||
|
for (int i = 0; i < original.size(); i++) {
|
|||
|
/*double a = original[i] - model[i];
|
|||
|
double b = (original[i] + model[i]) / 2;
|
|||
|
double c = fabs(a);
|
|||
|
double d = fabs(b);*/
|
|||
|
smape += (fabs((double)original[i] - model[i])) /
|
|||
|
(((fabs((double)(original[i])) + fabs((double)model[i]))) / 2);
|
|||
|
}
|
|||
|
smape = smape / original.size();
|
|||
|
smape = smape * 100;
|
|||
|
|
|||
|
return smape;
|
|||
|
}
|