Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
chenyangkang committed May 3, 2024
1 parent 1f186c6 commit 36c4555
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions stemflow/utils/validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def check_X_train(X_train):
if not isinstance(X_train, pd.core.frame.DataFrame):
raise TypeError(f"Input X should be type 'pd.core.frame.DataFrame'. Got {str(type_X_train)}")

if np.sum(np.isnan(X_train)) > 0:
if np.sum(np.isnan(np.array(X_train))) > 0:
raise ValueError(
"NAs (missing values) detected in input data. stemflow do not support NAs input. Consider filling them with values (e.g., -1 or mean values) or removing the rows."
)
Expand All @@ -136,7 +136,7 @@ def check_y_train(y_train):
f"Input y_train should be type 'pd.core.frame.DataFrame' or 'pd.core.frame.Series', or 'np.ndarray'. Got {str(type_y_train)}"
)

if np.sum(np.isnan(y_train)) > 0:
if np.sum(np.isnan(np.array(y_train))) > 0:
raise ValueError("NAs (missing values) detected in input y data. Consider deleting these rows.")


Expand Down

1 comment on commit 36c4555

@chenyangkang
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.