Created
October 13, 2020 12:47
-
-
Save megha444/c96a819b37706485e1323faabe5381c4 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
import numpy as np | |
from sklearn.preprocessing import MinMaxScaler | |
demo = np.random.randint(10, 200, (20 ,2)) | |
scalarModel = MinMaxScaler() | |
scalarModel.fit_transform(demo) | |
scalarModel = MinMaxScaler() | |
featureData = scalarModel.fit_transform(demo) | |
import pandas as pan | |
data = pan.DataFrame(data=featureData, columns=['c1', 'c2', 'c3', 'label']) | |
X = data[['c1', 'c2', 'c3']] | |
y = data['label'] | |
from sklearn.model_selection import train_test_split | |
Xtrain, Xtest, ytrain, ytest = train_test_split(X, y, test_size=0.30, random_state=42) | |
Xtrain.shape |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment