Fix refactor of static aggregate method
This commit is contained in:
@@ -40,11 +40,11 @@ namespace platform {
|
|||||||
}
|
}
|
||||||
compute_accuracy_value();
|
compute_accuracy_value();
|
||||||
}
|
}
|
||||||
static Score Scores::create_aggregate(json& data, std::string key)
|
Scores Scores::create_aggregate(json& data, std::string key)
|
||||||
{
|
{
|
||||||
auto scores = Scores(result[key][0]);
|
auto scores = Scores(data[key][0]);
|
||||||
for (int i = 1; i < result[key].size(); i++) {
|
for (int i = 1; i < data[key].size(); i++) {
|
||||||
auto score = Scores(result[key][i]);
|
auto score = Scores(data[key][i]);
|
||||||
scores.aggregate(score);
|
scores.aggregate(score);
|
||||||
}
|
}
|
||||||
return scores;
|
return scores;
|
||||||
|
@@ -10,7 +10,7 @@ namespace platform {
|
|||||||
public:
|
public:
|
||||||
Scores(torch::Tensor& y_test, torch::Tensor& y_pred, int num_classes, std::vector<std::string> labels = {});
|
Scores(torch::Tensor& y_test, torch::Tensor& y_pred, int num_classes, std::vector<std::string> labels = {});
|
||||||
explicit Scores(json& confusion_matrix_);
|
explicit Scores(json& confusion_matrix_);
|
||||||
static Score create_aggregate(json& data, std::string key);
|
static Scores create_aggregate(json& data, std::string key);
|
||||||
float accuracy();
|
float accuracy();
|
||||||
float f1_score(int num_class);
|
float f1_score(int num_class);
|
||||||
float f1_weighted();
|
float f1_weighted();
|
||||||
|
@@ -6,7 +6,6 @@
|
|||||||
#include "ReportBase.h"
|
#include "ReportBase.h"
|
||||||
#include "main/Scores.h"
|
#include "main/Scores.h"
|
||||||
|
|
||||||
|
|
||||||
namespace platform {
|
namespace platform {
|
||||||
const int MAXL = 133;
|
const int MAXL = 133;
|
||||||
class ReportConsole : public ReportBase {
|
class ReportConsole : public ReportBase {
|
||||||
|
Reference in New Issue
Block a user