Spaces:
Build error
Build error
| from sklearn.datasets import load_iris | |
| from sklearn.preprocessing import OneHotEncoder, StandardScaler | |
| import numpy as np | |
| def iris() -> tuple[np.array]: | |
| """ | |
| returns a tuple of numpy arrays containing the | |
| iris dataset split into training and testing sets | |
| after being normalized and one-hot encoded | |
| """ | |
| iris = load_iris() | |
| scaler = StandardScaler() | |
| x = scaler.fit_transform(iris.data) | |
| y = OneHotEncoder().fit_transform(iris.target.reshape(-1, 1)).toarray() | |
| return x, y | |