Kaggle Brush the game's sharp weapon, lr,lgbm,xgboost,keras__ machine learning

Source: Internet
Author: User
Tags xgboost

Brush the Race tool, thank the people who share.

Summary

Recently played a variety of games, here to share some general Model, a little change can be used

Environment: Python 3.5.2

Xgboost: http://blog.csdn.net/han_xiaoyang/article/details/52665396
Xgboost Official API:
Http://xgboost.readthedocs.io/en/latest//python/python_api.htmlpreprocess[Python] View plain copy # Common preprocessing framework import pandas as PD import NumPy as NP import scipy as SP # file Read Def           Read_csv_file (F, Logging=false): Print ("========== read Data =========") data = Pd.read_csv (f) If logging: Print (Data.head (5)) print (F, "contains the following") print (data.columns.values) print (data.describe ()) Print (Data.info ()) Return data

Logistic regression [python]  View Plain  copy #  Universal logisticregression Framework       Import pandas  as pd   import numpy as np   from scipy import  sparse   from sklearn.preprocessing import onehotencoder   from  sklearn.linear_model import logisticregression   from sklearn.preprocessing  import standardscaler      # 1. load data   df_train =  PD. Dataframe ()    df_test  = pd. Dataframe ()    y_train = df_train[' label '].values      # 2.  process data   Ss = standardscaler ()          # 3.  feature engineering/encoding   # 3.1 for labeled feature   Enc = onehotencoder ()    feats = ["CreativEID ", " Adid ", " Campaignid "]   for i, feat in enumerate (feats):        x_train = enc.fit_transform (Df_train[feat].values.reshape ( -1, 1))        x_test = enc.fit_transform (Df_test[feat].values.reshape (-1),  1))        

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.