Mordicus.Core.BasicAlgorithms.ScikitLearnRegressor module

Mordicus.Core.BasicAlgorithms.ScikitLearnRegressor.ComputeRegressionApproximation(model, scalerX, scalery, XTest)[source]

Computes the prediction of the Regressor,taking into account prelearned scalers for input and output

Parameters
  • model (sklearn.model_selection._search.GridSearchCV) – trained and optimized scikit learn regressor

  • scalerX (sklearn.preprocessing._data.StandardScaler) – scaler trained on input data

  • scalery (sklearn.preprocessing._data.StandardScaler) – scaler trained on output data

  • XTest (np.ndarray) – testing data

Returns

  • np.ndarray – kept eigenvalues, of size (numberOfEigenvalues)

  • np.ndarray – kept eigenvectors, of size (numberOfEigenvalues, numberOfSnapshots)

Mordicus.Core.BasicAlgorithms.ScikitLearnRegressor.GridSearchCVRegression(regressor, paramGrid, X, y)[source]

Optimizes a scikit learn regressor using gridSearchCV, using training data and target values

Parameters
  • regressor (objects satisfying the scikit-learn regressors API) – input regressor to be fitted and optimized

  • paramGrid (float) – the truncation tolerence, determining the number of keps eigenvalues

  • X (np.ndarray) – training data

  • y (np.ndarray) – target values

Returns

  • sklearn.model_selection._search.GridSearchCV – trained and optimized scikit learn regressor

  • sklearn.preprocessing._data.StandardScaler – scaler trained on input data

  • sklearn.preprocessing._data.StandardScaler – scaler trained on output data

class Mordicus.Core.BasicAlgorithms.ScikitLearnRegressor.MyGPR(kernel)[source]

Bases: GaussianProcessRegressor

Customization of scikit-learn’s GaussianProcessRegressor