https://mooseframework.inl.gov
Loading...
Searching...
No Matches
PolynomialRegressionTrainer.h
Go to the documentation of this file.
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#include "libmesh/utility.h"
13#include "SurrogateTrainer.h"
15#include "Calculators.h"
16
18
20{
21public:
23
25
26 virtual void preTrain() override;
27
28 virtual void train() override;
29
30 virtual void postTrain() override;
31
32private:
34 const std::vector<Real> & _predictor_row;
35
38
40 const Real & _penalty;
41
43 std::vector<std::vector<Real>> & _coeff;
44
46 const unsigned int & _max_degree;
47
49 const std::vector<std::vector<unsigned int>> & _power_matrix;
50
52 const unsigned int _n_poly_terms;
53
56 DenseMatrix<Real> _matrix;
57 std::vector<DenseVector<Real>> _rhs;
59
61 std::vector<std::unique_ptr<RealCalculator>> _calculators;
62
64 std::vector<Real> _r_sum;
65};
StochasticTools::Calculator< std::vector< Real >, Real > RealCalculator
const InputParameters & parameters() const
const unsigned int & _max_degree
Maximum polynomial degree, limiting the sum of constituent polynomial degrees.
std::vector< Real > _r_sum
Calculator used to sum response values.
const Real & _penalty
The penalty parameter for Ridge regularization.
std::vector< std::unique_ptr< RealCalculator > > _calculators
Calculators used in standardizing polynomial features.
const MooseEnum & _regression_type
Types for the polynomial regression.
const std::vector< std::vector< unsigned int > > & _power_matrix
Matirx co containing the touples of the powers for each term.
const unsigned int _n_poly_terms
Number of terms in the polynomial expression.
std::vector< std::vector< Real > > & _coeff
Coefficients of regression model.
std::vector< DenseVector< Real > > _rhs
const std::vector< Real > & _predictor_row
Data from the current predictor row.
This is the main trainer base class.