GithubHelp home page GithubHelp logo

hellohktk / feature_selection_gaalgorithm Goto Github PK

View Code? Open in Web Editor NEW

This project forked from rogeroyer/feature_selection_gaalgorithm

0.0 1.0 0.0 63 KB

基于遗传算法的特征选择

License: MIT License

Python 100.00%

feature_selection_gaalgorithm's Introduction

基于遗传算法做特征选择

运行环境

  • python3.5+
  • numpy
  • pandas
  • matplotlib
  • sklearn
  • LightGBM

使用手册

  • 更换dataSet目录里面的数据集(数据集过大我只上传了一小部分)

    • train_feature.csv : 训练集
    • validate_feature.csv : 验证集
    • 注:两个数据集内的维度要一致。且包含一个标签列,并命名为“target”
  • 更换self.columns为train_feature.csv内的属性名,且第一个元素必须为标签名“target”,其它全为特征名称

  • Genetic_algorithm.py众初始化种群initPopulation那里也要做相应修改

  • 修改self.ga类参数(可选)

  • 修改主函数里的群体个数和迭代次数(可选)


模型及评价指标

  • 评价指标:auc (可修改)
  • 模型:LightGBM (可修改)

结果

程序运行过程会打印出中间过程,最终会绘出迭代次数与最优个体适应图的折线图以及打印出最有个体及其适应度。


Attention

经过两个不同比赛的尝试,评价指标分别是f1_score和auc,线上线下同增减的使用本算法才能收获一个好的结果。

feature_selection_gaalgorithm's People

Contributors

rogeroyer avatar

Watchers

James Cloos avatar

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.