From 96e8ed429ee651a8c8fda66e9e79d0f5e2d14f27 Mon Sep 17 00:00:00 2001 From: hvrai Date: Wed, 20 Sep 2023 17:24:36 +0530 Subject: [PATCH] Addressing review comments --- THIRD_PARTY_LICENSES.txt | 6 ++++++ ads/feature_store/statistics/charts/box_plot.py | 10 ++++++++++ ads/feature_store/statistics/statistics.py | 6 ++++++ 3 files changed, 22 insertions(+) diff --git a/THIRD_PARTY_LICENSES.txt b/THIRD_PARTY_LICENSES.txt index 404fedace..d81f2bdd5 100644 --- a/THIRD_PARTY_LICENSES.txt +++ b/THIRD_PARTY_LICENSES.txt @@ -229,6 +229,12 @@ pandavro * Source code: https://github.com/ynqa/pandavro * Project home: https://github.com/ynqa/pandavro +plotly +* Copyright (c) 2016-2018 Plotly, Inc +* License: MIT License +* Source code: https://github.com/plotly/plotly.py +* Project home: https://plotly.com/ + protobuf * Copyright 2008 Google Inc. All rights reserved. * License: Google Protobuf License 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()