Skip to Content
数据科学实战手册
book

数据科学实战手册

by Posts & Telecom Press, Tony Ojeda, Sean Patrick Murphy, Bengfort Benjamin
May 2024
Intermediate to advanced
357 pages
5h 3m
Chinese
Packt Publishing
Content preview from 数据科学实战手册

第9章 大规模电影推荐(Python)

本章介绍如下内容。

  • 对偏好建模
  • 理解数据
  • 加载电影评分数据
  • 寻找高评分电影
  • 提升电影评分系统
  • 计算用户在偏好空间中的距离
  • 计算用户相关性
  • 为特定用户寻找最好的影评人
  • 预测用户评分
  • 基于物品的协同过滤
  • 建立非负矩阵分解模型
  • 将数据集载入内存
  • 导出SVD模型至硬盘
  • 训练SVD模型
  • 测试SVD模型

从图书到电影再到Twitter上的关注,推荐系统把我们从洪水般泛滥的信息中解放出来,为我们定制了个性化的信息流。电子商务、网络以及社交应用都从推荐系统中获益颇多。鉴于亚马逊推荐系统以及Netfix Prize所带来的成功,没有人会对在个性化以及基于数据的预测中需要一个推荐系统而感到惊奇。令人们感到惊奇的是,推荐系统的实现是如此简单,但是在数据量稀疏时很容易产生怪异的结果和过拟合。

首先让我们想一下不用算法该如何提供推荐。最简单的方法是看一下所信赖的人有哪些偏好,从中得到我们的推荐。潜意识中我们会将自己的偏好与他人做对比,如果彼此之间已有的共同偏好越多,那么彼此之间就越有可能发现更多新的共同偏好。但是每个人都是独特的,我们的偏好也是各种各样的,并且可能分布在多个不同的领域。如果能够将所信赖人之外的其他大量人的偏好和我们的偏好做比较,又会怎样呢?汇总的结果是你可能会发现一些模式,不只是发现那些和你相似的人,还会发现那些和你相反的不相似的人。你能从这些人中找到那些最好不要被推荐的物品,还有可能从那些拥有共同偏好空间的人身上发现你们有着共同的特殊经历。

协同过滤是这一类推荐系统技术的基础。简单来说,它是基于这样一个假设:那些和你有共同偏好的人将来也会和你拥有共同的偏好。这是从人的角度来看。从这个假设出发的另一个推论是基于物品的角度——那些被同一个人所喜爱的物品和有可能同时出现在另一个人喜爱的物品中。这就是在文献中通常所说的基于人的协同过滤以及基于物品的协同过滤。 ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Python编程入门与实战

Python编程入门与实战

Posts & Telecom Press, Fabrizio Romano
软件开发实践:项目驱动式的Java开发指南

软件开发实践:项目驱动式的Java开发指南

Raoul-Gabriel Urma, Richard Warburton
编写整洁的Python代码(第2版)

编写整洁的Python代码(第2版)

Posts & Telecom Press, Mariano Anaya

Publisher Resources

ISBN: 9781836206774