Kaggle competition: Don't Overfit! II
train_X = sparse.hstack([train_df[features_to_use], tr_sparse] ).tocsr()
test_X = sparse.hstack([test_df[features_to_use], te_sparse] ).tocsr()
target_num_map = {'high':0, 'medium':1, 'low':2}
train_y = np.array(train_df['interest_level'].apply(lambda x: target_num_map[x]))
print(train_X.shape, test_X.shape )<compute_train_metric>
x_train=train.drop(['target','id'],axis=1)
 y_train=train['target']
scaler=StandardScaler()
x_train=scaler.fit_transform(x_train)
 model=LogisticRegression(class_weight='balanced', solver='liblinear', penalty ='l1', C= 0.1, max_iter=10000)
 model.fit(x_train,y_train)
 print("Score on training data: " + str(model.score(x_train,y_train)*100)+ "%" )
<save_to_csv><EOS> 
x_test=test.drop('id',axis=1)
 x_test=scaler.fit_transform(x_test)
 y_test=model.predict_proba(x_test)
 print(y_test)
 ans=pd.DataFrame({'id':test['id'],'target':y_test[:,1]})
 ans.to_csv('output.csv',index=False )