fitting

Fitting is a class to generate and store the fitted results. This is the class for generating fitting_results.json

Author: Zeyu Deng Email: dengzeyu@gmail.com

class kmcpy.fitting.Fitting[source]

Main class for model fitting

add_data(time_stamp, time, keci, empty_cluster, weight, alpha, rmse, loocv)[source]

Add data to the Fitting object

Parameters:
  • time_stamp (float) – Time stamp string of the fitting

  • time (string) – Human redable date time of the fitting

  • weight ([float]) – Weights of each NEB data point

  • alpha (float) – Alpha value for Lasso regression

  • keci ([float]) – Kinetic effective cluster interactions

  • empty_cluster (float) – Empty cluster

  • rmse (float) – Root mean square error

  • loocv (float) – Leave-one-out cross validation error

Return type:

None

fit(alpha, max_iter=1000000, ekra_fname='e_kra.txt', keci_fname='keci.txt', weight_fname='weight.txt', corr_fname='correlation_matrix.txt', fit_results_fname='fitting_results.json')[source]

Main fitting function

Parameters:
  • alpha (float) – Alpha value for Lasso regression

  • max_iter (int, optional) – Maximum number of iterations. Defaults to 1000000.

  • ekra_fname (str, optional) – File name for E_KRA storage. Defaults to ‘e_kra.txt’.

  • keci_fname (str, optional) – File name for KECI storage. Defaults to ‘keci.txt’.

  • weight_fname (str, optional) – File name for weight storage. Defaults to ‘weight.txt’.

  • corr_fname (str, optional) – File name for correlation matrix storage. Defaults to ‘correlation_matrix.txt’.

  • fit_results_fname (str, optional) – File name for fitting results storage. Defaults to ‘fitting_results.json’.

Returns:

Predicted E_KRA; DFT Computed E_KRA

Return type:

y_pred (numpy.ndarray(float)),y_true (numpy.ndarray(float))