Created
October 28, 2019 15:11
-
-
Save MariaLavrovskaya/c9c2dc0ef01a86340a81926cc38b98b4 to your computer and use it in GitHub Desktop.
svm_1
This file contains hidden or 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
#Data preparation | |
data_1 = data.drop(['id', 'name', 'host_id','host_name','neighbourhood','latitude', 'last_review', 'longitude', 'room_type'], axis =1) | |
data_1.dropna(how='any', inplace=True) | |
data_1.head() | |
#Label Encoding of the labels | |
from sklearn.preprocessing import LabelEncoder | |
area_encoder = LabelEncoder() | |
data_y = data_1['neighbourhood_group'] | |
y = area_encoder.fit_transform(data_y) | |
#Label Encdoing of the given variables | |
from sklearn.preprocessing import StandardScaler | |
data_2 = data_1.drop(['neighbourhood_group'], axis=1) | |
scaler = StandardScaler() | |
scaler.fit(data_2) | |
X = scaler.transform(data_2) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment