血流信号是什么意思| 什么叫三焦| 左胸下面是什么部位| 麦芽糊精是什么东西| 梦见鳝鱼是什么预兆| rhe阴性是什么意思| 毛豆有什么营养价值| 宫颈纳氏囊肿是什么意思| 人的舌头有什么作用| 唯爱是什么意思| 什么是玫瑰糠疹| 南宁有什么好玩的地方| 全身发黄是什么原因| 六月二七是什么星座| 检察院是做什么的| tc什么意思| 翡翠和玉有什么不同| 无垢是什么意思| 蛋白粉是什么| mz是什么意思| 路政属于什么单位| 头晕恶心是什么原因| 脑炎的后遗症是什么| 鸽子配什么煲汤最好| 元参别名叫什么| 调戏什么意思| 灵魂是什么| 什么晚霜比较好用| 现在什么最赚钱| co2是什么意思| 煞星是什么意思| 朱元璋是什么朝代| 什么是太岁| 主动脉弓钙化什么意思| 枫树叶子像什么| 男人眼袋大是什么原因造成的| 茜读什么| 超字五行属什么| 合菜是什么| 夏枯草是什么样子| 梦见牙套掉了是什么意思| 射手男和什么星座最配| gaba是什么| 贲临是什么意思| pt950是什么材质| 谷草转氨酶偏低是什么原因| 土地兼并是什么意思| 艾灸痒痒的是什么原因| 梦到鸡是什么意思| 白兰地是什么酒| pm2.5是什么| 璟五行属什么| 悠闲惬意什么意思| 刷牙时牙龈出血是什么原因| 尿检红细胞高是什么原因| 男人更年期在什么年龄| 眉毛淡的男人代表什么| 肌肉酸痛用什么膏药| 男人为什么喜欢胸| 维生素吃多了有什么副作用| 河南人喜欢吃什么菜| 蚩尤是什么| 考号是什么| sansui是什么牌子| 血糖查什么项目| 胸长什么样| 贱货是什么意思| 火药是什么时候发明的| 喜欢白色的女人是什么性格| 水鱼煲鸡汤放什么药材| 红袖什么意思| 载脂蛋白是什么意思| 饭后打嗝是什么原因| 乳腺癌长在什么位置| 脂蛋白高是什么意思| 北芪与黄芪有什么区别| 什么茶减肥效果好| 张飞穿针的歇后语是什么| 什么叫胆汁反流性胃炎| 大腿根疼挂什么科| 肆无忌惮是什么意思| 考虑是什么意思| 宫颈炎用什么药| 啸是什么生肖| 九月二十号是什么星座| 吃什么水果治便秘| 痔疮用什么药膏最好| 胰岛a细胞分泌什么激素| 丝袜是什么材质| 立夏什么时候| 曦字五行属什么| domyos是什么牌子| 暴力倾向的人有什么表现| 湖北人喜欢吃什么菜| lanvin是什么牌子| 晚上12点是什么时辰| 太阳又什么又什么| 欺山莫欺水是什么意思| 头孢是治疗什么病的| adh是什么激素| 女性尿频是什么原因| 弱碱性水是什么水| 推迟月经用什么药| pose是什么意思| 棠字五行属什么| ercp是什么意思| 蛇盘疮吃什么药好得快| 暇步士属于什么档次| 产妇吃什么下奶快又多| 脚脱皮用什么药膏| 为什么会有白带| 篮子房是什么意思| 牙龈有点发黑是什么原因| 农历五月的别称是什么| 做梦踩到屎是什么意思| 不完全性右束支阻滞是什么意思| 阑尾炎做什么检查| 牙医靠什么吃饭| 肛裂出血和痔疮出血有什么区别| 胃胀胃痛吃什么药| 反流性食管炎可以吃什么水果| 青口是什么东西| 中二病是什么意思| 果胶是什么东西| 血糖高什么水果不能吃| 1月24号什么星座| 阴道内壁是什么样的| 阳痿早泄吃什么药| prawn是什么意思| 公分是什么单位| 开胸手术吃什么补元气| 管教有方是什么意思| 梦见前夫是什么意思| 阄是什么意思| 孕妇什么情况容易早产| 什么盐好| 做梦梦见马是什么意思| 射手男和什么星座最配| 蝉是什么生肖| 女人吃桃子有什么好处和坏处| 肾结石用什么药| 悲伤是什么意思| 降结肠疼是什么原因| 什么叫甲亢病| 为什么会血压高| 牙龈肿胀吃什么药| 2002年什么年| 嘬是什么意思| 彩铃是什么意思| 燕窝是补什么的| 骨龄是什么| 亚麻籽油和胡麻油有什么区别| 6月什么星座| 二型血糖高吃什么药好| 手抖是什么情况| 甲状腺什么症状| 五月十三日是什么星座| eb病毒igg抗体阳性是什么意思| 石棉是什么| 肾脏不好吃什么食物好| 胃胀吃什么好| 第二职业干点什么好呢| 癌前病变是什么意思| 尿糖是什么意思| 肚子痛去医院挂什么科| 身上长扁平疣是什么原因造成的| 梦见蘑菇是什么预兆| 晚上睡觉流口水是什么病| 隐性梅毒是什么意思| 清水文是什么意思| 便秘喝什么茶最快排便| 人体消化道中最长的器官是什么| 什么是肌无力| 喝黑芝麻糊有什么好处| 蛔虫长什么样| 实字五行属什么| 女性阴道痒是什么原因| 补肾吃什么好| 碘伏用什么可以洗掉| 0l是什么意思| 学前教育学什么| 牛犇是什么意思| 瘴气是什么| lafuma是什么牌子| 中书舍人是什么官职| 头发里长痣代表什么| 摩什么接什么| 为什么突然长痣| 积劳成疾的疾是什么意思| 两边太阳胀痛什么原因引起的| 我追呀追呀是什么歌曲| 脚没有力气是什么原因| 果丹皮是用什么做的| 鳄梨是什么水果| 陈皮泡水喝有什么好处| ot是什么| 跃跃欲试什么意思| bishop是什么意思| rolex是什么牌子的手表| 7.20是什么星座| 杨梅什么时候上市| 上火流鼻血是什么原因| 化疗病人吃什么好| 大姨妈吃什么水果| 上午10点是什么时辰| 地贫和贫血有什么区别| 劣迹斑斑是什么意思| 软冷冻室一般放什么东西| 梦到头发长长了是什么意思| 夜未央什么意思| 番是什么意思| 户主有什么权利| 什么是介质| 前列腺是什么器官| 脚气用什么药好| 白头翁是什么生肖| 乌江鱼是什么鱼| 童心未眠什么意思| 红牛什么时候喝效果好| samedelman是什么牌子| 慢性宫颈炎吃什么药| 1953年属蛇的是什么命| 怀孕能吃什么水果| 松香对人体有什么危害| 髋关节在什么位置| 缓刑什么意思| 三级医院什么意思| 李世民的字是什么| smile是什么牌子| 姚明什么时候退役的| ckd3期是什么意思| 脚踝肿了是什么原因| 12月5号是什么星座| 被紫外线灯照到有什么后果呀| 断肠草长什么样| 阑尾炎可以吃什么| 经期肚子疼是什么原因| 最坚固的锁怕什么| 太阳是什么颜色的| 世界7大奇迹是什么| 自费是什么意思| 钢琴8级什么水平| 2014年属什么生肖| 眼睛干涩用什么眼药水| 国家为什么要扫黄| 夏至有什么习俗| 白血球低是什么原因| 医疗美容需要什么资质| 2028年属什么生肖| 营养师属于什么专业| 尿路感染吃什么| 粿是什么意思| 搪瓷杯为什么被淘汰了| 头皮结痂抠掉又结痂是什么病| 女人左眼跳是什么预兆| 胆固醇高不可以吃什么食物| 卵巢早衰有什么症状| 长湿疹是什么原因引起的| 153是什么意思| 槐子泡水喝有什么功效| prime是什么意思| 欲是什么意思| 水仙是什么| 吃什么对甲状腺有好处| 百度
Skip to content

mddunlap924/Ecommerce-Recommender-System

Folders and files

NameName
Last commit message
Last commit date

Latest commit

?

History

2 Commits
?
?
?
?
?
?
?
?
?
?
?
?
?
?
?
?
?
?
?
?

Repository files navigation

A Multi-Objective Ecommerce Recommender System

This repository provides the implementation of a multi-objective recommender system using candidate ranker models, optimized for large-scale e-commerce datasets, to predict user interactions such as clicks, carts, and orders.

Introduction

This repository contains code created during the Kaggle competition, OTTO - Multi-Objective Recommender System, held in January 2023 (Kaggle Profile for Myles Dunlap). My approach in this repo. allowed me to finish in the top 2% of 2,587 competing teams.

The objective of the competition was to predict e-commerce clicks, carts, and orders for a one-week period. The main approach I used was a Candidate Ranker model, commonly employed in large dataset recommender systems. Candidate reranker models are explained in the References section [1, 2].

The basic concept behind a candidate reranker model is illustrated in Figure 1 below.

Figure 1: A Large Dataset Candidate Ranker Process [1]

In candidate ranker models, the item corpus—often containing millions or billions of items—needs to be reduced so that items can be properly recommended to users. The process involves generating a set of candidate items (see Candidates Generation). For this competition, hand-crafted rules, Word2Vec, and Bayesian Personalized Ranking (BPR) were used to generate variable amounts of candidate-item pairs. The code for generating the candidates is located in the files co_vis_matrices.py and candidates.py.

Co-visitation matrices (source) describe products frequently viewed and bought together. Three co-visitation matrices were used to provide similar items that were:

  1. Clicked
  2. Clicked/Carted/Ordered
  3. Bought [3].

The RAPIDS cuDF GPU data science library was used to quickly process these matrices instead of relying on multi-core dataframe libraries.

Data

The competition provided a large dataset for training and testing, with a time span of approximately 6 weeks, sourced from OTTO, the largest German online shop. The dataset contains the following data points (in millions):

  • 12.9M sessions (user activity)
  • 1.8M items (products)
  • 194.7M clicks
  • 16.8M carts
  • 5.1M orders

The goal was to recommend the next 20 items a user would: click, cart, and order.

Libraries

  • Item and User Similarities:

  • RAPIDS AI: GPU acceleration for data science operations (e.g., dataframes).

  • POLARS: Fast dataframe library written in Rust. It supports lazy execution and is optimized for multi-threaded operations.

  • XGBoost: XGBoost was used to build an XGB Ranker model. The model used a pairwise objective function to refine item recommendations from the candidate generation stage. The XGB Ranker model code can be found in xgb_ranker.py. Additionally, the XGB model was trained on the GPU.

Model Setup Example:

# Model Setup
xgb_params = {'objective': 'rank:pairwise',
              'tree_method': 'gpu_hist',
              'learning_rate': hps.learning_rate,
              'max_depth': hps.max_depth,
              'colsample_bytree': hps.colsample_bytree,
             }
model = xgb.train(xgb_params, 
                  dtrain=dtrain,
                  evals=[(dtrain, 'train'),
                         (dvalid, 'valid')],
                  num_boost_round=hps.num_boost_round,
                  verbose_eval=hps.verbose_eval,
                  early_stopping_rounds=hps.early_stopping_rounds,
                 )

Due to the magnitude of the dataset, Out-of-Memory errors (e.g., insufficient RAM) were a common issue. To overcome this, data was loaded from disk in chunks, and the XGB model was trained in intervals. This technique is implemented in the following code, found in xgb_ranker.py.

class IterLoadForDMatrix(xgb.core.DataIter):
    def __init__(self, df=None, features=None, target=None, batch_size=256*1024):
        self.features = features
        self.target = target
        self.df = df
        self.it = 0 # set iterator to 0
        self.batch_size = batch_size
        self.batches = int( np.ceil( len(df) / self.batch_size ) )
        super().__init__()

    def reset(self):
        '''Reset the iterator'''
        self.it = 0

    def next(self, input_data):
        '''Yield next batch of data.'''
        if self.it == self.batches:
            return 0 # Return 0 when there's no more batch.
        
        a = self.it * self.batch_size
        b = min( (self.it + 1) * self.batch_size, len(self.df) )
        dt = cudf.DataFrame(self.df.iloc[a:b])
        input_data(data=dt[self.features], label=dt[self.target]) #, weight=dt['weight'])
        self.it += 1
        return 1


def stratify_folds(df):
    # Stratify Group K-Fold
    skf = GroupKFold(n_splits=5)

    strat = {}
    for fold,(train_idx, valid_idx) in enumerate(skf.split(df, df['target'], groups=df['session'])):
        strat[fold] = {'fold': fold,
                       'train_idx': train_idx,
                       'valid_idx': valid_idx,
                       'num_rows': len(df)}
    return strat

References

  1. Recommendation Systems for Large Datasets
  2. How to Build a GBT Ranker Model
  3. Candidate ReRank Model using Handcrafted Rules
barry什么意思 核辐射是什么意思 正常的精液是什么样的 尿白细胞弱阳性什么意思 顺从是什么意思
世界上最大的鱼是什么 桃花开在什么季节 作死是什么意思 梦见吃梨是什么意思 为什么会感染幽门螺旋杆菌
老夫聊发少年狂什么意思 毛孔大什么原因形成的 amber是什么意思 督邮相当于现在什么官 肥宅是什么意思
人为什么会咳嗽 引力是什么 疱疹性咽峡炎吃什么药 想一出是一出什么意思 喷昔洛韦乳膏治什么
做梦梦见自己生孩子是什么意思hcv9jop7ns5r.cn 挂号信什么意思hcv8jop1ns7r.cn 胃疼喝什么可以缓解hcv8jop9ns6r.cn 尿后余沥是什么意思hcv9jop8ns2r.cn 糖筛和糖耐有什么区别hcv8jop1ns6r.cn
自我是什么意思hcv8jop3ns6r.cn 鳞状上皮炎症反应性改变是什么意思hcv9jop4ns4r.cn 甲木命是什么意思hcv9jop3ns4r.cn 枸杞泡茶喝有什么功效hcv8jop4ns5r.cn 80年出生属什么生肖inbungee.com
受凉感冒吃什么药beikeqingting.com 七月半是什么节日jiuxinfghf.com 什么叫蛇胆疮hcv9jop5ns4r.cn 面包用什么面粉sanhestory.com 脸颊两边长痘痘是什么原因引起的hcv9jop6ns2r.cn
薏米长什么样子的图片hcv9jop4ns9r.cn 雷峰塔为什么叫雷峰塔hcv8jop4ns8r.cn 红烧肉是什么肉hcv9jop3ns2r.cn 奇点是什么意思hcv8jop3ns8r.cn 吃牛肉不能吃什么hcv9jop7ns5r.cn
百度