casm.learn.to_json

casm.learn.to_json(index, indiv)[source]

Serialize an individual to JSON records.

Keys in each record:

“index”: index of individual in hall of fame “id”: uuid str for individual “selected”: str of 0’s and 1’s indicating selected features “n_selected”: number of selected features “cv”: CV score “rms”: root-mean-square error “wrms”: weighted problem root-mean-square error “mean_absolute_error”: mean absolute error “wmean_absolute_error”: weighted problem mean absolute error “max_absolute_error”: maximum absolute error “wmax_absolute_error”: weighted problem maximum absolute error “estimator_method”: name of estimator method “features_selection_method”: name of feature selection method “note”: a descriptive note “eci”: List of (feature index, coefficient value) pairs “input”: input settings dict

Keys added by –checkhull, if y=”formation_energy”: pandas.DataFrame

“dft_gs” : DFT calculated ground states “clex_gs” : predicted ground states “gs_missing” : DFT ground states that are not predicted ground states “gs_spurious” : Predicted ground states that are not DFT ground states “uncalculated” : Predicted ground states and near ground states that have not been calculated “below_hull” : All configurations predicted below the prediction of the DFT hull “ranged_rms”: root-mean-square error calculated for the subset of configurations

whose DFT formation energy lies within some range of the DFT convex hull

Parameters
  • index (int) – The index in hall of fame of the individual

  • indiv (List[bool] of length n_features) – This is a boolean list of shape [n_features], in which an element is True iff its corresponding feature is selected for retention.

Note

ECI are serialized using cls=casm.misc.noident.noindent.NoIndent, so when writing with json.dump or json.dumps, include ‘cls=casm.misc.noindent.noindent.NoIndentEncoder’.