Git Product home page Git Product logo

deep-rec's Introduction

deep-rec

  • 基于tensorflow实现的推荐系统的经典模型
  • 依赖
    • python: 3.6.11
    • tensorflow: 1.15.0 gpu
  • 数据集:criteo

运行

准备数据

  • 下载数据并解压
  • 统计离散特征的出现次数,过滤掉低频特征(次数小于10),保留离散特征列表至data/criteo/ids.txt文件下,以便做编码;执行如下命令
    • cut -f15- /pathOfcriteo/train.txt | sed 's/\t/\n/g' | awk '{if($1!=""){cnt[$1]+=1}}END{for(k in cnt){print k","cnt[k]}}' > data/criteo/ids.cnt
    • awk -F, '{if($2>=10){print $1}}' data/criteo/ids.cnt > data/criteo/ids.txt
  • 调用util/split.py将数据文件拆成多个小文件,并将训练文件拆出的小文件按9:1划分为训练集、验证集,将其绝对路径分别写入data/train.txtdata/train.txt
    • 由于原始训练集的文件很大,有4kw+行,为了加快数据加载数据,这里将文件拆分成多个小文件,以便多进程加载
    • python util/split.py /pathOfcriteo/train.txt data/criteo/train/part 100
    • for f in $(ls data/criteo/train/part*);do echo $(pwd)/$f >> data/files.txt;done
    • head -n90 data/files.txt > data/train.txt; tail -n10 data/files > data/val.txt

进行训练

  • python run.py deepfm

执行预测评估

  • python predict.py mdls/deepfm/model.h5

模型

deep-rec's People

Contributors

phxtu avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

jasontuzq wanesta

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.