Files
Data-Mining-Mushrooms/notebooks/mushroom_analysis.ipynb
2026-10-09 15:16:03 +00:00

3.9 KiB

In [5]:
from sklearn.datasets import fetch_openml

mushroom = fetch_openml(data_id=43922, as_frame=True)

X = mushroom.data
y = mushroom.target

print("Feature data:", X.shape)
print("Target data:", y.shape)
display(X.head())
display(y.head())
print(y.value_counts())
---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
Cell In[5], line 1
----> 1 from sklearn.datasets import fetch_openml
      3 mushroom = fetch_openml(data_id=43922, as_frame=True)
      5 X = mushroom.data

ModuleNotFoundError: No module named 'sklearn'
In [3]:
print("Missing cells:", X.isna().sum().sum())
print("Rows with missing cells:", X.isna().any(axis=1).sum())
print(X["stalk_root"].value_counts(dropna=False))
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
Cell In[3], line 1
----> 1 print("Missing cells:", X.isna().sum().sum())
      2 print("Rows with missing cells:", X.isna().any(axis=1).sum())
      3 print(X["stalk_root"].value_counts(dropna=False))

NameError: name 'X' is not defined
In [1]:
a = "hello"
print(a)
hello