pytorch 矩阵分解_使用pytorch的推荐系统矩阵分解

本文介绍了如何使用PyTorch进行矩阵分解,这是推荐系统中的一个重要技术。通过矩阵分解,可以有效地处理大规模数据并为用户推荐个性化内容。
摘要由CSDN通过智能技术生成

pytorch 矩阵分解

We come across recommendations multiple times a day — while deciding what to watch on Netflix/Youtube, item recommendations on shopping sites, song suggestions on Spotify, friend recommendations on Instagram, job recommendations on LinkedIn…the list goes on! Recommender systems aim to predict the “rating” or “preference” a user would give to an item. These ratings are used to determine what a user might like and make informed suggestions.

我们每天都会遇到很多建议-在决定在Netflix / Youtube上观看什么,在购物网站上推荐商品,在Spotify上推荐歌曲,在Instagram上推荐朋友,在LinkedIn上推荐工作...等等! 推荐系统旨在预测用户对某项商品的“评价”或“偏好”。 这些评分用于确定用户可能喜欢的内容并提出明智的建议。

There are two broad types of Recommender systems:

推荐系统分为两种:

  1. Content-Based systems: These systems try to match users with items based on items’ content (genre, color, etc) and users’ profiles (likes, dislikes, demographic information, etc). For example, Youtube might suggest me cooking videos based on the fact that I’m a chef, and/or that I’ve watched a lot of baking videos in the past, hence utilizing the information it has about a video’s content and my profile.

    基于内容的系统 :这些系统尝试根据项目的内容(类型,颜色等)和用户的个人资料(喜欢,不喜欢,人口统计信息等)为用户匹配项目。 例如,Youtube可能会基于我是厨师和/或我过去看过很多烘焙视频的事实而建议我烹饪视频,从而利用其有关视频内容和个人资料的信息。

  2. Collaborative filtering: They rely on the assumption that similar users like similar items. Similarity measures between users and/or items are used to make recommendations.

    协同过滤 :他们基于类似用户喜欢类似项目的假设。 用户和/或项目之间的相似性度量用于提出建议。

This article talks about a very popular collaborative filtering technique called Matrix factorization.

本文讨论了一种非常流行的协作过滤技术,称为矩阵分解。

矩阵分解 (Matrix Factorization)

A recommender system has two entities — users and items. Let’s say we have m users and n items. The goal of our recommendation system is to build an mxn matrix (called the utility matrix) which consists of the rating (or preference) for each user-item pair. Initially, this matrix is usually very sparse because we only have ratings for a limited number of user-item pairs.

推荐系统具有两个实体-用户和项目。 假设我们有m用户和n项目。 我们的推荐系统的目标是构建一个mxn矩阵(称为效用矩阵 ),该矩阵由每个用户项对的评分(或偏好)组成。 最初,此矩阵通常非常稀疏,因为我们仅对有限数量的用户项对进行评级。

Here’s an example. Say we have 4 users and 5 superheroes and we’re trying to predict the rating each user would give to each superhero. This is what our utility matrix initially looks like:

这是一个例子。 假设我们有4个用户和5个超级英雄,我们正在尝试预测每个用户对每个超级英雄的评价。 这是我们的效用矩阵最初的样子:

Image for post
4x5 utility matrix for superhero ratings (Image by author)
超级英雄评级的4x5实用矩阵(作者提供)

Now, our goal is to populate this matrix by finding similarities between users and items. To get an intuition, for example, we see that User3 and User4 gave the same rating to Batman, so we can assume the users are similar and they’d feel the same way about Spiderman and predict that User3 would give a rating of 4 to Spiderman. In practice, however, this is not as straightforward because there are multiple users interacting with many different items.

现在,我们的目标是通过查找用户和项目之间的相似性来填充此矩阵。 例如,为了获得直觉,我们看到User3和User4对蝙蝠侠给予了相同的评分,因此我们可以假设用户相似并且他们对Spiderman的感受相同,并预测User3给予4的评分。蜘蛛侠。 但是,实际上,这并不是那么简单,因为有多个用户与许多不同的项目进行交互。

In practice, The matrix is populated by decomposing (or factorizing) the Utility matrix into two tall and skinny matrices. Th

  • 2
    点赞
  • 10
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值