LECA.analyze.plot_2D_Sx
- LECA.analyze.plot_2D_Sx(wf: WorkFlow, model: str | List[str], feature_dict: Dict[str, List[float]], steps: int = 50, restriction: List[str] = ['x_EC', 'x_EMC', 'x_LiSalt'], multiply_by_salt: bool = False, focus: bool | DataFrame = False, save_loc: str | bool = False, objectives: List[str] = ['S0', 'S1', 'S2'], **kwargs) None
2-dimensional slice along two features for predicted Arrhenius objective values (typically S0, S1 and S2). Three plots will be rendered which show the coefficient predictions for the given feature ranges/values.
- Parameters:
wf (WorkFlow) – LECA WorkFlow object containing the trained models for predicting the Arrhenius objective functions.
model (Union[str, List[str]]) – String or list of string names of model(s) to use for prediction. If a single string is passed, the same model is used for all objectives.
feature_dict (Dict[str, List[float]]) – Dictionary with input feature names as keys, and either [min, max] as values, or a list of explicit values [val0, val1, val2, …] to be used to generate predictions.
steps (int) –
Number of steps for generating values between feature_dict[feature]: min to max.
Default value
50restriction (List[str]) –
Set limited feature values. If the sum of the input features declared in this list is greater than 1, the prediction is excluded. This argument can be used to set boundaries for impossible electrolyte compositions.
Default value
['x_EC', 'x_EMC', 'x_LiSalt']multiply_by_salt (bool) –
Whether to multiply the prediction by the salt content (feature: “x_LiSalt”). This is necessary if the models were trained with the objective function log(conductivity/x_Lisalt). If
TrueS0 predictions are transformed: S0_output = S0_pred + log10(x_LiSalt)Default value
Falsefocus (Union[bool, pd.DataFrame]) –
If False, do nothing. If pd.DataFrame (1-row DataFrame with input features columns) a black circle will be plotted on the 2D plots corresponding to the focus point.
Default value
Falsesave_loc (Union[str, bool]) –
Boolean or string to indicate whether and where to to save the plot. If
Falseno plot is saved, otherwise: Depending on other passed arguments, the naming scheme follows: save_loc+’slice_2D_Sx_{varied_features}.pdfDefault value
Falseobjectives (str) –
String name of the Arrhenius coefficients for the trained models in the WorkFlow.
Default value
['S0', 'S1', 'S2']**kwargs – Keyword arguments passed to matplotlib.pyplot.countourf.
- Return type:
None