LECA.analyze.plot_1D_Sx
- LECA.analyze.plot_1D_Sx(wfs: List[WorkFlow], models: List[str], feature_dict: Dict[str, List[float]], beta_0_list: List[float], steps: int = 50, objectives: List[str] = ['S0', 'S1', 'S2'], ylim: Tuple[float, float] | None = None, multiply_by_salt: bool = False, model_labels: List[str] | None = None, wf_labels: List[str] | None = None, min_max: bool = False, confidence: float = 1.0, save_loc: str | bool = False) None
1-dimensional slice along one feature for models predicted arrhenius objectives S0, S1 and S2. Three plots will be rendered which show the S0, S1 and S2 predictions for the argument defined WorkFlow(s) for every model for the given feature ranges/values.
- Parameters:
wfs (List[WorkFlow]) – List of LECA WorkFlow object(s) containing trained models for the three Arrhenius model coefficients (typically S0, S1 and S2, though these names can be modified with the objectives argument). Each WorkFlow in the wfs list should correspond to a WorkFlow label and beta_0 value in the wf_labels list and beta_0_list arguments, respectively.
models (List[str]) – List of string names of model(s) to use for prediction.
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.
beta_0_list (List[float]) – List of the beta_0 values for the Arrhenius fits for each trained WorkFlow to be plotted (See
prep.arrhenius()orprep.direct_sample_arrhenius()).steps (int) –
Number of steps for generating values between feature_dict[feature]: min to max.
Default value
50ylim (Optional[Tuple[float,float]]) –
Optional parameter to set fixed boundaries for the y-axis of the plots.
Default value
Nonemultiply_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
Falsemodel_labels (Optional[List[str]]) –
String values for labeling the models in the plots. Can be useful for abbreviating otherwise verbose string model names. If
None, by default uses the model names given in the models argument.Default value
Nonewf_labels (Optional[List[str]]) –
Optionally append a label for different WorkFlows to the plotted predictions. If
Nonenothing is added. Note: If a list is passed, it should correspond 1:1 with the list of WorkFlows passed to the wfs argument.Default value
Nonemin_max (bool) –
Whether to use the min_max method to estimate uncertainty, or MAPIE with conformity scores. min_max:
Truereturns the standard deviations of the predictions from all the bootstrapped models for each point. min_max:Falseuses the MAPIE uncertainty estimation outlined in: Mapie jackknife+-AB This parameter is moot for GPR models.Default value
False.confidence (float) –
Scalar value to multiply the estimated uncertainty. By default this value is
1.0which results in the plotted errorbars showing one standard-deviation. E.g.confidence=1.96would then reflect an approximate 95% confidence interval.Default value
1.0save_loc (Union[str, bool]) –
Boolean or string to indicate whether and where to to save the plot. If
Falseno plot is saved, otherwise: The naming scheme follows: save_loc+’slice_1D_Sx_{varied_feature}.pdfDefault value
False
- Return type:
None