Skip to content

Instantly share code, notes, and snippets.

@megha444

megha444/scikit.py

Created Oct 13, 2020
Embed
What would you like to do?
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
You can’t perform that action at this time.