Dataset fitting
Module that contains the classes for performing interpolation or regression of a specified dataset and then evaluating its function value at any given position
- class topsearch.potentials.dataset_fitting.DatasetInterpolation(model_data: ModelData, smoothness: float = 0.0)
Class to compute and evaluate a radial basis function interpolation fitted to a given dataset.
- model_data
The dataset which we interpolate
- Type:
class
- smoothness
Smoothness parameter for the kernel in RBF interpolation
- Type:
float
- model
The scipy interpolation model that can be fit and queried
- Type:
class
- function(position: NDArray[Any, Any]) float
Evaluate the value of the interpolation model
- initialise_model() None
Initialise the interpolation model, a radial basis function interpolation with a thin-plate kernel as implemented in scipy
- refit_model() None
Refit the interpolation model for the current model_data
- class topsearch.potentials.dataset_fitting.DatasetRegression(model_data: ModelData, model_rand: int = 1)
Class to fit a regression model to a given dataset using the sklearn multilayer perceptron, and then query its value at any point in space
- model_data
The dataset which we regress
- Type:
class
- model_rand
Random seed passed to MLP fitting
- Type:
int
- model
The sklearn regression model that can be fit and queried
- Type:
class
- cv_results
The results of cross-validation fitting of MLP
- Type:
dict
- function(position: NDArray[Any, Any]) float
Evaluate the value of the regression model
- get_model_error() float
Return the model error of current fit
- initialise_model() None
Initialise the regression model, a multi-layer perceptron as implemented in sklearn
- refit_model() None
Refit model and recalculate error based on current training