Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warning during fit #742

Closed
maciekmalachowski opened this issue Aug 14, 2024 · 4 comments
Closed

Warning during fit #742

maciekmalachowski opened this issue Aug 14, 2024 · 4 comments

Comments

@maciekmalachowski
Copy link
Contributor

All values are strings

\\?\[C:\Users\Maciek\AppData\Roaming\mljar-studio\jlab_server\Lib\site-packages\supervised\preprocessing\preprocessing_categorical.py:74](file:///C:/Users/Maciek/AppData/Roaming/mljar-studio/jlab_server/Lib/site-packages/supervised/preprocessing/preprocessing_categorical.py#line=73): FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value '[1 1 1 ... 0 1 1]' has dtype incompatible with category, please explicitly cast to a compatible dtype first.

Dataset: https://www.openml.org/search?type=data&status=active&sort=runs&id=40536

@pplonski
Copy link
Contributor

Thank you @maciekmalachowski for reporting, could you please provide full code to reproduce the issue?

@maciekmalachowski
Copy link
Contributor Author

maciekmalachowski commented Aug 20, 2024

@pplonski Sure, here it is:

# import packages
from sklearn.datasets import fetch_openml
from sklearn.model_selection import train_test_split
from supervised import AutoML
from sklearn.metrics import accuracy_score

# read data from openml page
data = fetch_openml(data_id=40536, as_frame=True)
X = data.data
y = data.target
y = y.astype("int")
# display data shape
print(f"Loaded X shape {X.shape}")
print(f"Loaded y shape {y.shape}")
# display first rows
X.head()

# split data
X_train, X_test, y_train, y_test = train_test_split(X, y, train_size=0.90, shuffle=True, stratify=y, random_state=42)
# display data shapes
print(f"X_train shape {X_train.shape}")
print(f"X_test shape {X_test.shape}")
print(f"y_train shape {y_train.shape}")
print(f"y_test shape {y_test.shape}")

# create automl object
automl = AutoML(total_time_limit=300, mode="Explain")
# train automl
automl.fit(X_train, y_train)

# predict with AutoML
predictions = automl.predict(X_test)
# predicted values
print(predictions)

@pplonski
Copy link
Contributor

Could you please take a look at it @Marchlak

Marchlak added a commit to Marchlak/mljar-supervised that referenced this issue Sep 25, 2024
pplonski added a commit that referenced this issue Sep 25, 2024
@pplonski
Copy link
Contributor

good job @Marchlak 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants