Created
August 17, 2020 01:10
-
-
Save ahmadmustafaanis/e18afae3325bad03a8b2e68dbc025e47 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from sklearn.datasets import load_iris | |
from tensorflow.keras.models import Sequential | |
from tensorflow.keras.utils import to_categorical | |
from tensorflow.keras.layers import Dense | |
from sklearn.preprocessing import StandardScaler | |
from sklearn.model_selection import train_test_split | |
iris = load_iris() | |
X = iris.data | |
y = iris.target | |
y = to_categorical(y) #converting output to one-hot vector | |
ss = StandardScaler() #standardizing the data | |
X = ss.fit_transform(X) | |
X_train, X_test, y_train, y_test = train_test_split(X,y) #splitting dataset into 2 halves |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment