Skip to content

Instantly share code, notes, and snippets.

@arunm8489
Created August 1, 2020 13:55
Show Gist options
  • Save arunm8489/7d96aabf388ca876d81a12315d0651d1 to your computer and use it in GitHub Desktop.
Save arunm8489/7d96aabf388ca876d81a12315d0651d1 to your computer and use it in GitHub Desktop.
# handling numeric features
train_numeric = np.concatenate((X_train['price'].values.reshape(-1, 1),X_train['teacher_number_of_previously_posted_projects'].values.reshape(-1, 1),X_train['quantity'].values.reshape(-1,1),X_train['presence_of_num'].values.reshape(-1, 1)),axis=1)
test_numeric = np.concatenate((X_test['price'].values.reshape(-1, 1), X_test['teacher_number_of_previously_posted_projects'].values.reshape(-1, 1),X_test['quantity'].values.reshape(-1,1),X_test['presence_of_num'].values.reshape(-1, 1)),axis=1)
stndardscalar = StandardScaler()
std_train_numeric = stndardscalar.fit_transform(train_numeric)
std_test_numeric = stndardscalar.transform(test_numeric)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment