Objects of this class comprise represent a cluster expansion model
Model class
Parameters:
corrc
: CorrelationsCalculator objectThe correlations calculator corresponding to the optimal model.
property_name
: StringThe methods of the Model
class that take a StructureSet
object as
argument, will query property values named according to property_name
.
estimator
: Estimator objectAn estimator object to predict the property values. Alternatively, The effective cluster interactions (ECIs) can be set.
ecis
: Array of floatEffective cluster iteractions (multiplied by the corresponding
multiplicities). Overrides estimator
object.
filepath
: string (default: None)Overrides all the above. Used to initialize from file. Path of a json or pickle
file containing a serialized Model object, as generated by the Model.serialize()
method.
json_db_filepath
: string (default: None)DEPRECATED, use filepath
instead.
Overrides all the above. Used to initialize from file. Path of a json
file containing a serialized Model object, as generated by the Model.serialize()
method.
Return absolute errors of every structure in a structures set.
Parameters:
sset
: StructuresSet objectthe errors are calculated for every structure in the structures set
srtd
: Boolean (default: False
)if True
the output errors are sorted from smallest to largest.
Returns: structured numpy array with fields:
[('index','<i4'), ('error','<f4')]
i.e., every element of the array contains a tuple with an integer, the structure index and a float, the absolute error
Return correlations calculator of the Model object
Get leave-one-out cross-validation score over structures set.
Parameters:
fit_params
: dictionaryParameters to pass to the fit method of the estimator.
Return array of effective cluster interactions (ECIs) of the model
Compute RMSE, MAE and MaxAE for model in structures set.
Return parent lattice of the cluster expansion model.
Predict property with the optimal cluster expansion model.
Parameters:
structure
: Structure objectstructure object to calculate property to.
Predict property difference with the optimal cluster expansion model.
Parameters:
structure
: Structure objectstructure object to calculate property difference to.
ind1
: intindex of first atom position has been swapped
ind2
: intindex of second atom position has been swapped
Report fit and CV scores
Parameters:
sset
: StructuresSet objectthe scores are computed for the give structures set
Write cluster expansion model to Json database
Parameter:
filepath
: string Name of the file to store the Model instance. It can contain the relative or absolute path. If not given, and if db_name (deprecated) is None, filepathh is set to “cemodel.pickle” and fmt is overriden (set to pickle).
fmt
: stringIt can take the values "pickle"
or "json"
.
So far, object can only be re-initiated from a "pickle"
file, therefore this is the preferred format.
If not given, it is inferred from the filepathh.
db_name
: (DEPRECATED) string Name of the json file containing the database