9#include <mva/methods/FANN.h>
10#include <mva/interface/Interface.h>
11#include <framework/utilities/FileSystem.h>
13#include <gtest/gtest.h>
19 TEST(FANNTest, WeightfilesAreReadCorrectly)
24 general_options.m_variables = {
"M",
"p",
"pt"};
26 {1.873689, 1.881940, 1.843310},
27 {1.863657, 1.774831, 1.753773},
28 {1.858293, 1.605311, 0.631336},
29 {1.837129, 1.575739, 1.490166},
30 {1.811395, 1.524029, 0.565220}
32 {}, {0.0, 1.0, 0.0, 1.0, 0.0, 1.0});
37 expert->load(weightfile);
38 auto probabilities = expert->apply(dataset);
39 EXPECT_NEAR(probabilities[0], 0.047535836696624756, 0.0001);
40 EXPECT_NEAR(probabilities[1], 0.7130427360534668, 0.0001);
41 EXPECT_NEAR(probabilities[2], 0.7729528546333313, 0.0001);
42 EXPECT_NEAR(probabilities[3], 0.16526281833648682, 0.0001);
43 EXPECT_NEAR(probabilities[4], 0.0091879460960626602, 0.0001);
44 EXPECT_NEAR(probabilities[5], -0.21771839261054993, 0.0001);
static std::string findFile(const std::string &path, bool silent=false)
Search for given file or directory in local or central release directory, and return absolute path if...
General options which are shared by all MVA trainings.
Template class to easily construct a interface for an MVA library using a library-specific Options,...
virtual std::unique_ptr< MVA::Expert > getExpert() const override
Get Exoert of this MVA library.
Wraps the data of a multiple event into a Dataset.
static Weightfile loadFromFile(const std::string &filename)
Static function which loads a Weightfile from a file.
Abstract base class for different kinds of events.