V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
wh0syourda66y
V2EX  ›  Python

用机器学习预测薪水

  •  1
     
  •   wh0syourda66y · 2015-07-30 15:57:52 +08:00 · 5661 次点击
    这是一个创建于 3195 天前的主题,其中的信息可能已经有所发展或是发生改变。

    互联网薪水预测

    先保证安装了必要的软件库

    git clone https://github.com/origingod/salary-prediction-with-machine-learning
    pip install -r requirements.txt
    

    首先,先抓取数据,目前我的记录是抓取了10w条,大概有100w~500w条记录

    前置性能优化:

    • 1.启动redis
    $ redis-server
    
    • 2.启动celery
    $ celery -A Tasks worker --loglevel=info
    

    运行

    python DataCrawer.py
    

    会在目录下面生成一个带时间标识的csv文件

    接下来,生成数据训练集

    运行

    python DataAnalyser.py
    

    上一步会自动处理数据并生成一个预测子名为clf.pkl存放于当前目录,看到clf知道怎么用的都不用说了吧,接下来主要调准精度。

    训练模式 输入:

    • 数据1: Job Description
    • 数据2: 薪水数量

    最后

    预测模式 输入:

    • 数据1: Job Description

    输出:

    • 数据1: 薪水数量

    链接: https://github.com/origingod/salary-prediction-with-machine-learning 可以友情加Star~

    第 1 条附言  ·  2015-07-31 10:31:52 +08:00
    数据来源:拉钩网
    数据量:10w~500w
    分词:结巴分词:https://github.com/fxsjy/jieba
    数据整理方式:筛选高频词组成jd向量,同时提取出salary
    X格式:array/list([...],[...],[...])
    Y格式:array/list([...])
    算法参考:http://scikit-learn.org/stable/auto_examples/plot_rbm_logistic_classification.html
    参数优化:无
    21 条回复    2015-08-30 15:04:00 +08:00
    hitmanx
        1
    hitmanx  
       2015-07-30 16:06:02 +08:00
    数据是从哪里抓取的?
    wh0syourda66y
        2
    wh0syourda66y  
    OP
       2015-07-30 16:08:28 +08:00
    @hitmanx 爬了拉勾的数据,不好直接贴出来哈
    scream7
        3
    scream7  
       2015-07-30 16:19:33 +08:00
    找了好久发现是逻辑斯蒂回归,可以试试SVM等其他的比较下
    wh0syourda66y
        4
    wh0syourda66y  
    OP
       2015-07-30 16:28:54 +08:00
    @scream7 是RBM+Logistic 回归
    julyclyde
        5
    julyclyde  
       2015-07-30 17:40:53 +08:00
    看到Celery觉得好亲切。最近正在玩Sentry呐
    wh0syourda66y
        6
    wh0syourda66y  
    OP
       2015-07-30 18:03:07 +08:00
    @julyclyde 然而跟Celery没什么关系,只是拿来当任务队列而已
    wudikua
        7
    wudikua  
       2015-07-30 21:03:02 +08:00
    能分享一下预测完的结论么
    mahone3297
        8
    mahone3297  
       2015-07-30 21:35:30 +08:00
    拉钩的数据,会不会不准?不是都说是偏高的么?
    TakanashiAzusa
        9
    TakanashiAzusa  
       2015-07-30 21:37:06 +08:00 via Android
    拉勾的普遍偏高。。。
    pp3182429
        10
    pp3182429  
       2015-07-30 21:56:15 +08:00
    用机器学习聚类萌妹纸
    https://github.com/albin3/black-and-white-photo
    ==#
    wh0syourda66y
        11
    wh0syourda66y  
    OP
       2015-07-30 23:01:01 +08:00
    @pp3182429 乱入了。。
    bbking
        12
    bbking  
       2015-07-30 23:33:00 +08:00
    lz可以说一下思路不?
    wh0syourda66y
        13
    wh0syourda66y  
    OP
       2015-07-31 00:10:21 +08:00
    @bbking 数据获取——数据整理——持久化——数据分割——(建模&调优的循环)——出成果
    pp3182429
        14
    pp3182429  
       2015-07-31 10:10:30 +08:00
    @wh0syourda66y 哈哈~
    pp3182429
        15
    pp3182429  
       2015-07-31 10:11:10 +08:00
    @wh0syourda66y 楼主建模用的是函数拟合么?
    wh0syourda66y
        16
    wh0syourda66y  
    OP
       2015-08-03 10:48:52 +08:00
    @pp3182429 恩,比较粗糙,你有兴趣的话,把参数调少一点跑一跑。
    yhxx
        17
    yhxx  
       2015-08-06 21:31:19 +08:00
    不管输入什么都是15K?
    freezhan
        18
    freezhan  
       2015-08-06 21:49:32 +08:00
    @yhxx 真输入自己的简历只有 11K (比实际的高...) 乱输入的都是 15k, 哭瞎~
    wh0syourda66y
        19
    wh0syourda66y  
    OP
       2015-08-06 21:50:34 +08:00
    @freezhan 摸头,不哭不哭
    wh0syourda66y
        20
    wh0syourda66y  
    OP
       2015-08-06 21:51:20 +08:00
    @freezhan 对了可以跳槽了。哈哈
    mingyun
        21
    mingyun  
       2015-08-30 15:04:00 +08:00
    star +1
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   3191 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 12:39 · PVG 20:39 · LAX 05:39 · JFK 08:39
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.