GithubHelp home page GithubHelp logo

jackking2333 / recommendation_system_sort_model Goto Github PK

View Code? Open in Web Editor NEW

This project forked from stephenbo-china/recommendation_system_sort_model

0.0 1.0 0.0 153 KB

推荐系统排序模型复现

Python 6.04% Jupyter Notebook 93.96%

recommendation_system_sort_model's Introduction

本项目将使用tensorflow2.0复现现在推荐系统中的主流排序模型

DIN:

论文链接: https://arxiv.org/pdf/1706.06978.pdf

数据集使用阿里数据集测试模型代码, 数据集链接: https://tianchi.aliyun.com/dataset/dataDetail?dataId=56

DIN调用方法:

0. 简介:

DIN的输入特征中主要包含三个部分特征: 用户历史行为序列, 目标商品特征, 用户画像特征。 用户历史行为序列需包含点击序列与非点击序列。 请按如下1~2方法处理输入特征。

1. 初始化:

初始化DIEN时需传入5个参数:

(注:feature_list中的特征名称,需要与embedding_dict中的特征名称一样)

  • embedding_count_dict:string->int格式,该变量记录需要embedding各个特征的词典个数,即最大整数索引+ 1的大小;

  • embedding_dim_dict:string->int格式,该变量记录需要embedding各个特征的输出维数,即密集嵌入的尺寸;

  • embedding_features_list:list(string)格式,该变量记录DIEN中user_profile部分所有需要embedding的feature名称;

  • user_behavior_features:list(string)格式,该变量记录DIEN中user_behavior与target_item部分所有需要embedding的feature名称

  • activation:string格式,默认值"PReLU",该变量空值全连接层激活函数,”PReLU“->PReLU,"Dice"->Dice

2. 模型调用:

模型调用需传入6个参数:

(注:feature_list中的特征名称,需要与dict中的特征名称一样)

  • user_profile_dict:dict:string->Tensor格式,记录user_profile部分的所有输入特征的训练数据;

  • user_profile_list:list(string)格式,记录user_profile部分的所有特征名称;

  • click_behavior_dict:dict:string->Tensor格式,记录user_behavior部分所有点击输入特征的训练数据;

  • noclick_behavior_dict:dict:string->Tensor格式,记录user_behavior部分所有未点击输入特征的训练数据;

  • target_item_dict:dict:string->Tensor格式,记录target_item部分输入特征的训练数据;

  • user_behavior_list:list(string)格式,记录user_behavior部分的所有特征名称。

DIEN:

论文链接: https://arxiv.org/pdf/1809.03672.pdf

数据集使用阿里数据集测试模型代码, 数据集链接: https://tianchi.aliyun.com/dataset/dataDetail?dataId=56

代码:

  • model: 定义模型代码

  • layers: 模型用到的自定义层

  • data_reader: 定义输入数据处理函数代码

调用演示代码:

DIEN:

DIEN_train_example.ipynb

DIN:

DIN_train_example.ipynb

recommendation_system_sort_model's People

Contributors

stephenbo-china 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.