cinnamon.plot.drift.plot_drift.plot_feature_drift¶
- cinnamon.plot.drift.plot_drift.plot_feature_drift(drift_explainer: AbstractDriftExplainer, feature: Union[int, str], max_n_cat: int = 20, figsize: Tuple[int, int] = (7, 5), as_discrete: bool = False, bins=10, legend_labels: Tuple[str, str] = ('Dataset 1', 'Dataset 2'))¶
Plot distributions of a given feature in order to visualize a potential data drift of this feature.
Parameters¶
- drift_explainer: AbstractDriftExplainer
A AbstractDriftExplainer object.
- featureUnion[int, str]
Either the column index or the name of the feature.
- max_n_catint (default=20)
Maximum number of classes to represent on the plot (used only for categorical feature (not supported currently) or if as_discrete == True
- binsint or sequence of scalars or str, optional (default=10)
For regression only. ‘two_heads’ corresponds to a number of bins which is the minimum of of the optimal number of bins for dataset 1 and dataset 2 taken separately. Other value of “bins” parameter passed to matplotlib.pyplot.hist function are also accepted.
- figsizeTuple[int, int] (default=(7, 5))
Graphic size passed to matplotlib
- as_discrete: bool (default=False)
If a numerical feature is discrete (has few unique values), consider it discrete to make the plot.
- legend_labelsTuple[str, str] (default=(‘Dataset 1’, ‘Dataset 2’))
Legend labels used for dataset 1 and dataset 2
Returns¶
None