Skip to Content
Web机器学习
book

Web机器学习

by Posts & Telecom Press, Andrea Isoni
May 2024
Intermediate to advanced
234 pages
3h 58m
Chinese
Packt Publishing
Content preview from Web机器学习

第7章 电影推荐系统Web应用

本章讲解如何用Django框架搭建一个真实的推荐系统。该系统的主要功能是,根据用户的喜好(第5章讲过),向订阅了推荐服务的用户推荐电影,我们沿用第5章的电影评分数据:603部电影的打分数据,其中每部电影的打分人次在50次以上,共有942位用户参与打分。为了能够得到系统提供的电影推荐服务,每位用户需要为一定数量的电影打分,我们特意讲解信息检索系统的实现(第4章),以帮助用户检索电影、完成打分。我们还将讨论Django应用的不同部分:setting、model、用户登录/登出、命令、信息检索系统、推荐系统、管理后台和API(所有代码均已放到作者GitHub仓库chapter_7文件夹:https://github.com/ ai2010/machine_learning_for_the_web/tree/master/chapter_7)。因为第6章只介绍了Django的主要功能,所以在开发电影推荐系统过程中,每遇到一个新功能,我们都会讲解其技术细节。现在我们开始介绍推荐系统这个Web应用的初始化配置,让它先跑起来。

按照之前的做法,新建一个Django项目:

django-admin startproject server_movierecsys

在server_movierecsys文件夹下,新建一个应用:

python manage.py startapp books_recsys_app

接下来,对settings.py里面的各项内容进行设置。仿照第6章的做法,安装应用,指定HTML模板和样式文件的路径,指定使用SQLite数据库:

INSTALLED_APPS = (   'django.contrib.admin', ...
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

人工智能技术与大数据

人工智能技术与大数据

Posts & Telecom Press, Anand Deshpande, Manish Kumar
神经网络算法与Java编程

神经网络算法与Java编程

Posts & Telecom Press, Fabio M. Soares, Alan M. F. Souza
Python图像处理实战

Python图像处理实战

Posts & Telecom Press, Sandipan Dey
面向MapReduce的Hadoop优化

面向MapReduce的Hadoop优化

Posts & Telecom Press, Khaled Tannir

Publisher Resources

ISBN: 9781836203612