Skip to content

Commit

Permalink
v0 (#1304)
Browse files Browse the repository at this point in the history
  • Loading branch information
JKL98ISR committed Apr 24, 2022
1 parent b5409ad commit 80f1b37
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
4 changes: 2 additions & 2 deletions deepchecks/core/check_result.py
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,7 @@ def to_json(self, with_display: bool = True):
"""
result_json = self._get_metadata()
if with_display:
result_json['display'] = [('str', str(self.exception))]
result_json['display'] = [('html', f'<p style="color:red">{self.exception}</p>')]
return jsonpickle.dumps(result_json, unpicklable=False)

def to_wandb(self, dedicated_run: bool = True, **kwargs: Any):
Expand Down Expand Up @@ -546,7 +546,7 @@ def _ipython_display_(self):
if hasattr(self.check.__class__, '__doc__'):
summary = get_docs_summary(self.check)
check_html += f'<p>{summary}</p>'
check_html += f'<p style="color:red"> {self.exception}</p>'
check_html += f'<p style="color:red">{self.exception}</p>'
display_html(check_html, raw=True)

def print_traceback(self):
Expand Down
9 changes: 5 additions & 4 deletions deepchecks/tabular/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,9 @@ class Dataset:
Parameters
----------
df : pd.DataFrame
A pandas DataFrame containing data relevant for the training or validating of a ML models.
df : Any
An object that can be casted to a pandas DataFrame
- containing data relevant for the training or validating of a ML models.
label : t.Union[Hashable, pd.Series, pd.DataFrame, np.ndarray] , default: None
label column provided either as a string with the name of an existing column in the DataFrame or a label
object including the label data (pandas Series/DataFrame or a numpy array) that will be concatenated to the
Expand Down Expand Up @@ -103,7 +104,7 @@ class Dataset:

def __init__(
self,
df: pd.DataFrame,
df: t.Any,
label: t.Union[Hashable, pd.Series, pd.DataFrame, np.ndarray] = None,
features: t.Optional[t.Sequence[Hashable]] = None,
cat_features: t.Optional[t.Sequence[Hashable]] = None,
Expand All @@ -121,7 +122,7 @@ def __init__(

if len(df) == 0:
raise DeepchecksValueError('Can\'t create a Dataset object with an empty dataframe')
self._data = df.copy()
self._data = pd.DataFrame(df).copy()

# Validations
if label is None:
Expand Down
2 changes: 1 addition & 1 deletion requirements/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@ importlib_resources>=1.3; python_version < '3.9'
statsmodels>=0.11.0
scipy>=1.4.1
dataclasses>=0.6; python_version < '3.7'
plotly>=5.5.0, <5.6
plotly>=5.5.0
matplotlib>=3.2.2

0 comments on commit 80f1b37

Please sign in to comment.