diff --git a/ads/feature_store/statistics/charts/box_plot.py b/ads/feature_store/statistics/charts/box_plot.py index 9a07e69e6..0923a8412 100644 --- a/ads/feature_store/statistics/charts/box_plot.py +++ b/ads/feature_store/statistics/charts/box_plot.py @@ -66,6 +66,16 @@ def __init__( self.box_points = box_points super().__init__() + def __validate__(self): + if ( + self.q1 is None + or self.q3 is None + or self.iqr is None + or type(self.box_points) is not list + or len(self.box_points) == 0 + ): + return self.ValidationFailedException() + def add_to_figure(self, fig: Figure, xaxis: int, yaxis: int): xaxis_str, yaxis_str, x_str, y_str = self.get_x_y_str_axes(xaxis, yaxis) fig.add_box( diff --git a/ads/feature_store/statistics/statistics.py b/ads/feature_store/statistics/statistics.py index 8fee043f3..f8b09ff0c 100644 --- a/ads/feature_store/statistics/statistics.py +++ b/ads/feature_store/statistics/statistics.py @@ -27,6 +27,12 @@ def kind(self) -> str: return "statistics" def to_viz(self, feature_list: List[str] = None): + """Visualises statistics inside notebook + Parameters + ---------- + feature_list: (str, optional). Defaults to `None`. + The specific features of the FeatureGroup or Dataset we want to visualise + """ if self.content is not None: [ FeatureStatistics.from_json(feature, stat).to_viz()