Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def send_log(msg: str):
send_log("Start setup PyLib")
setup(
name="upgini",
version="1.1.15",
version="1.1.16",
description="Low-code feature search and enrichment library for machine learning",
long_description=(here / "README.md").read_text(encoding="utf-8"),
long_description_content_type="text/markdown",
Expand Down
12 changes: 10 additions & 2 deletions src/upgini/features_enricher.py
Original file line number Diff line number Diff line change
Expand Up @@ -703,18 +703,26 @@ def __inner_fit(

if isinstance(y, pd.Series):
y_array = y.values
else:
elif isinstance(y, np.ndarray):
y_array = y
else:
y_array = np.array(y)

if len(np.unique(y_array)) < 2:
raise ValueError("y is a constant, please check your training dataset")

if X.shape[0] != len(y_array):
raise ValueError("X and y should be the same size")

if len(set(X.columns)) != len(X.columns):
raise ValueError("X contains duplicating columns names, please check your training dataset")

self.__prepare_search_keys(X)

df: pd.DataFrame = X.copy() # type: ignore
df[self.TARGET_NAME] = y_array

self.logger.info(f"First dataset row:\n{df.head(1)}")
self.logger.info(f"First 10 rows of the dataset:\n{df.head(10)}")

df = self.__handle_index_search_keys(df)

Expand Down