Giter Site home page Giter Site logo

ml_01's Introduction

天池新人赛【快来一起挖掘幸福感!】



网址:https://tianchi.aliyun.com/competition/entrance/231702/information


数据清洗

  1. happiness出现异常值,比较少,把出现异常的行删除
  2. 缺失值 使用中值代替
  3. 异常值 使用IsolationForest 删除异常数据

特征处理

  1. 连续值处理
    1. seaborn直方图统计手动分割
    2. 根据客观判断离散化,比如年龄通过10年一代来划分
    3. 对数据进行变换(比如log2处理)在用1进行处理
  2. 特征选择
    1. 通过xgboost查看每一个特征的importance,然后删除不重要的特征

算法选择

  1. XGBoost

     clf3 = xgb.XGBClassifier(n_estimators=500,
                              learning_rate=0.1,
                              n_jobs=8,
                              objective='multi:softmax',
                              max_depth=8,
                              subsample=0.8,
                              colsample_bytree=0.8,
                              reg_lambda=1,
                              reg_alpha=0,
                              feval=myFeval,
                              maximize=True,
                              gamma=0.1,
                              min_child_weight=4)
     

    主要调的参数有:

    1. n_estimators
    2. max_depth
    3. gamma
    4. min_child_weight
    5. learning_rate

      可以使用类似下面的代码逐个调(因为联合调试需要很长时间,对及其性能有很大的要求)
     param = {"max_depth": [6, 8, 10]}
     gsc = GridSearchCV(estimator=clf3,
                         param_grid=param,
                         n_jobs=8,
                         scoring=my_score_func)
     gsc.fit(train_x, train_y)
     print(gsc.grid_scores_)
     print(gsc.best_params_, gsc.best_score_)
     

    本地测试结果:0.5471392587261605

  2. RandomForestClassifier

    待续

  3. StackingClassifier

    待续

ml_01's People

Contributors

muzhailong avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Forkers

jolosjoestar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.