zoukankan      html  css  js  c++  java
  • Kaggle教程——大神教你上分

    本文记录笔者在观看Coursera上国立经济大学HLE的课程 How to win a data science competetion中的收获,和大家分享。课程的这门课的讲授人是Kaggle的大牛,内容详实,需要一定的python和机器学习基础。笔者只记录了一部分,许多细节都被省略了,详细内容各位看官还请移步课程链接

    1. Week1

    Feature Preprocessing 特征预处理

    数值型 Numerical

    1. Tree-Based 模型不依赖于归一化(scaling),Non-tree-based 很依赖归一化
      2.最常用的归一化方法
      • MinmaxScaler to [0,1]
      • StandardScaler to mean0,std1
      • Rank 让有序的值之间的间距相等
      • np.log(1+x) 和 np.sqrt(1+x)缩放
        3.生成新的特征依赖于
      • 业务知识
      • 探索性的数据分析(Explotary data analysis)

    分类型 Categorical

    1. Ordinal的特征的顺序是有意义的
      2.label encoding 能把categorical变成数值,什么是label encoding,见图1
      3.Frequency encoding可以把类别变成频数
      4,label encoding 和frequency encoding常用于 tree-based models
    2. one-hot常用于非树的模型
    3. categorical变量进行组合生成新的categorical变量,有助于线性模型和KNN
      图1
      label encoding

    时间和坐标

    1. 时间
      从时间戳产生新的变量
      • 周期性
      • 某一事件之后经过了多久
      • 日期差
    2. 坐标
      从坐标产生新的特征
      • 附近有意思的地方
      • 聚集中心的坐标
      • 聚合统计量

    缺失值

    1. 根据情况选择填补方法
    2. 常用方法:mean,median,-999
      3.分类型变量"is_null"可能会有用
      4.在生成特征前,避免fill na
      5.xgboost能自己搞定Nans

    特征处理

    图像和文本

    1.文本
    使用bag of words
    1. 预处理:stemming lowercase lemmazation stopwords
    2. n-grams
    3. tf-idf
    4.Word2vec
    2. 图像
    1. 可以从网络的不同的层抽取特征
    2. 精心选取pre-trianed 网络
    3. 手工增加样本数量

  • 相关阅读:
    Shared Memory in Windows NT
    Layered Memory Management in Win32
    软件项目管理的75条建议
    Load pdbs when you need it
    Stray pointer 野指针
    About the Rebase and Bind operation in the production of software
    About "Serious Error: No RTTI Data"
    Realizing 4 GB of Address Space[MSDN]
    [bbk4397] 第1集 第一章 AMS介绍
    [bbk3204] 第67集 Chapter 17Monitoring and Detecting Lock Contention(00)
  • 原文地址:https://www.cnblogs.com/yuuken/p/9232477.html
Copyright © 2011-2022 走看看