nannyml.performance_estimation.confidence_based.results module¶
Module containing CBPE estimation results and plotting implementations.
- class nannyml.performance_estimation.confidence_based.results.Result(results_data: pandas.core.frame.DataFrame, metrics: List[nannyml.performance_estimation.confidence_based.metrics.Metric], y_pred: str, y_pred_proba: Union[str, Dict[str, str]], y_true: str, chunker: nannyml.chunk.Chunker, problem_type: nannyml._typing.ProblemType, timestamp_column_name: Optional[str] = None)[source]¶
Bases:
nannyml.base.Abstract1DResult
,nannyml.plots.blueprints.comparisons.ResultCompareMixin
Contains results for CBPE estimation and adds plotting functionality.
Creates a new
AbstractCalculatorResult
instance.- Parameters
results_data (pd.DataFrame) – The data returned by the Calculator.
- plot(kind: str = 'performance', *args, **kwargs) plotly.graph_objs._figure.Figure [source]¶
Render plots based on CBPE estimation results.
This function will return a
plotly.graph_objects.Figure
object. The following kinds of plots are available:performance
: a line plot rendering the estimated performance perChunk
afterapplying the
calculate()
method on a chunked dataset.
- Returns
fig – A
Figure
object containing the requested drift plot.Can be saved to disk using the
write_image()
method or shown rendered on screen using theshow()
method.- Return type
plotly.graph_objs._figure.Figure
Examples
>>> import nannyml as nml >>> >>> reference_df, analysis_df, target_df = nml.load_synthetic_binary_classification_dataset() >>> >>> estimator = nml.CBPE( >>> y_true='work_home_actual', >>> y_pred='y_pred', >>> y_pred_proba='y_pred_proba', >>> timestamp_column_name='timestamp', >>> metrics=['f1', 'roc_auc'] >>> ) >>> >>> estimator.fit(reference_df) >>> >>> results = estimator.estimate(analysis_df) >>> results.plot().show()