Skip to content

Instantly share code, notes, and snippets.

@megha444
Created October 13, 2020 12:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save megha444/c96a819b37706485e1323faabe5381c4 to your computer and use it in GitHub Desktop.
Save megha444/c96a819b37706485e1323faabe5381c4 to your computer and use it in GitHub Desktop.
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