Giter VIP home page Giter VIP logo

Comments (4)

shenweichen avatar shenweichen commented on May 24, 2024

Hello,感谢您的关注
这个包是支持多值特征的,但没有在主要models里支持(因为paper本身并没有采用多值特征),主要是在sequence模块提供支持,具体如下可以参考文档中这个部分 https://deepctr-doc.readthedocs.io/en/latest/deepctr.sequence.html

下面以简单的pooling操作为例说明,
这里比如说我们输入一个含有多值电影标签的含有两个样本batch数据为

from deepctr.sequence import SequencePoolingLayer
#首先对变长多值特征进行padding,比如这里我们padding到长度为7
movie_tags = [ [0,1,2,0,0,0,0],#movie1 具有0,1,2 一共3个标签
 [0,1,2,3,4,0,0]]#movie2 具有0,1,2,3,4 一共5个标签
tags_len = [[3],[5]]#这里记得输入变长特征的有效长度
model_input = [movie_tags,tags_len]
#之后我们可以根据输入拿到对应的embeddding矩阵tag_embedding
#按照API的要求输入embedding矩阵和长度
tags_pooling = SequencePoolingLayer(seq_len_max=7, mode='mean',)([tag_embedding,tags_len_input])
#这样就得到了对变长多值特征的一个定长表示,后续可以进行其他操作

image

from deepctr.

mathlf2015 avatar mathlf2015 commented on May 24, 2024

谢谢啦。我可以理解为包里面的模型不支持这种多值embeding的特征吗?因为多值不定长的特征在实际做ctr时中还是很常见的。如果我想把这类特征加入到模型有其他办法不?。顺便问下。这个deepctr的模型存储和加载是和keras中的模型储存和加载操作一样的不。

from deepctr.

shenweichen avatar shenweichen commented on May 24, 2024

目前models中只有DIN是原生支持多值embedding输入的。目前除了用DIN的话就只能去修改一下models里的代码,如果你熟悉tensorflow或者Keras的话应该改起来还是蛮快的。

后续我也会给其他model添加一下多值特征的支持,目前主要还没想好一个简洁通用的方式,另外是否能够提供一个含有多值特征的公开数据集?我可以简单的加个demo。

模型的存储和加载操作是和keras models一样的,但是因为modelsl里用了很多自定义的Layer,在load_model的时候如果提示找不到Layer在custom_objects指定一下就可以了~(这个后续我也会更新到文档里)
感谢你的关注~

from deepctr.

mathlf2015 avatar mathlf2015 commented on May 24, 2024

谢谢解答。数据的话tencent2018的广告算法大赛和ijcai2018的数据应该可以用吧。。再次感谢。。

from deepctr.

Related Issues (20)

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.