Scine::Swoose  2.1.0
This is the SCINE module Swoose.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Pages
Scine::Swoose::MachineLearning::MolecularMachineLearningModel Class Reference

The combination of the machine learning models for molecular energies and atomic forces. More...

#include <MolecularMachineLearningModel.h>

Collaboration diagram for Scine::Swoose::MachineLearning::MolecularMachineLearningModel:
Collaboration graph

Public Member Functions

 MolecularMachineLearningModel ()=default
 Default constructor.
 
void setReferenceData (const Utils::MolecularTrajectory &structures, const std::vector< ForcesCollection > &refForces)
 Sets the reference data. More...
 
void trainEnergyModel ()
 Trains the energy model.
 
void trainForcesModel ()
 Trains the forces model.
 
double predictEnergy (const Utils::AtomCollection &structure)
 Predicts the energy for a given structure.
 
ForcesCollection predictForces (const Utils::AtomCollection &structure)
 Predicts the forces for a given structure.
 
std::pair< double, double > evaluateEnergyModel (int k)
 Validates the energy model via k-fold cross validation. More...
 
std::pair< double, double > evaluateForcesModel (int k, bool pooledVariance=true)
 Validates the model for the atomic forces via k-fold cross validation. More...
 
Utils::MachineLearning::KernelRidgeRegressionenergyPredictor ()
 Accessor for the underlying energy model.
 
Utils::MachineLearning::KernelRidgeRegressionforcePredictor (int atomIndex)
 Accessor for the underlying force model of the atom with index 'atomIndex'.
 

Detailed Description

The combination of the machine learning models for molecular energies and atomic forces.

Member Function Documentation

std::pair< double, double > Scine::Swoose::MachineLearning::MolecularMachineLearningModel::evaluateEnergyModel ( int  k)

Validates the energy model via k-fold cross validation.

Parameters
kThe number of subsets k for the k-fold cross validation algorithm.
Returns
The mean absolute error and the standard deviation of the model evaluation as a std::pair.
std::pair< double, double > Scine::Swoose::MachineLearning::MolecularMachineLearningModel::evaluateForcesModel ( int  k,
bool  pooledVariance = true 
)

Validates the model for the atomic forces via k-fold cross validation.

Parameters
kThe number of subsets k for the k-fold cross validation algorithm.
pooledVarianceDecides whether the standard deviation estimate for the forces is based on the principle of pooled variance. The alternative is a true combined variance that considers the different MAE means of the atomic forces.
Returns
The combined mean absolute error and the combined standard deviation of the model evaluation for the individual atomic forces as a std::pair.
void Scine::Swoose::MachineLearning::MolecularMachineLearningModel::setReferenceData ( const Utils::MolecularTrajectory structures,
const std::vector< ForcesCollection > &  refForces 
)

Sets the reference data.

Parameters
structuresThe molecular trajectory containing the structures along with their reference energies.
refForcesA vector of the reference forces for each structure.

The documentation for this class was generated from the following files: