Line data Source code
1 : //* This file is part of the MOOSE framework 2 : //* https://mooseframework.inl.gov 3 : //* 4 : //* All rights reserved, see COPYRIGHT for full restrictions 5 : //* https://github.com/idaholab/moose/blob/master/COPYRIGHT 6 : //* 7 : //* Licensed under LGPL 2.1, please see LICENSE for details 8 : //* https://www.gnu.org/licenses/lgpl-2.1.html 9 : 10 : #pragma once 11 : 12 : // MOOSE includes 13 : #include "GeneralReporter.h" 14 : #include "SurrogateModelInterface.h" 15 : #include "SurrogateModel.h" 16 : /** 17 : * A tool to output CV scores 18 : */ 19 : 20 : class CrossValidationScores : public GeneralReporter, public SurrogateModelInterface 21 : { 22 : public: 23 : static InputParameters validParams(); 24 : 25 : CrossValidationScores(const InputParameters & parameters); 26 : 27 48 : virtual void initialize() override {} 28 : virtual void execute() override; 29 48 : virtual void finalize() override {} 30 : 31 : protected: 32 : /// Storage for cross-validation scores 33 : std::vector<std::vector<std::vector<Real>> *> _cv_scores; 34 : 35 : /// Model to extract CV values from. 36 : std::vector<const SurrogateModel *> _models; 37 : };