nannyml.data_quality.unseen.result module
Contains the results of the univariate statistical drift calculation and provides plotting functionality.
- class nannyml.data_quality.unseen.result.Result(results_data: DataFrame, column_names: List[str], data_quality_metric: str, timestamp_column_name: Optional[str], chunker: Chunker)[source]
Bases:
PerColumnResult
,ResultCompareMixin
Contains the results of the univariate statistical drift calculation and provides plotting functionality.
Creates a new
AbstractCalculatorResult
instance.- Parameters:
results_data (pd.DataFrame) – The data returned by the Calculator.
- plot(*args, **kwargs) Figure [source]
- 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, analysis, _ = nml.load_synthetic_car_price_dataset() >>> column_names = [col for col in reference.columns if col not in [ .... 'car_age', 'km_driven', 'price_new', 'accident_count', 'door_count','timestamp', 'y_pred', 'y_true']] >>> calc = nml.UnseenValuesCalculator( ... column_names=column_names, ... timestamp_column_name='timestamp', ... ).fit(reference) >>> res = calc.calculate(analysis) >>> res.filter(period='analysis').plot().show()