Collaborative filtering for recommendation systems in Python, Nicolas Hug

Pôle Systematic Paris-Region
Pôle Systematic Paris-RegionPôle Systematic Paris-Region
An	introduction	to
COLLABORATIVE	FILTERING	IN
PYTHON
and	an	overview	of	Surprise
1
WHAT	SHOULD	I
READ?
2
WHAT	SHOULD	I
SEE?
3
WHERE	SHOULD	I
EAT?
4
TAXONOMY
Content-based
Leverage	information	about	the	items	content	
Based	on	item	profiles	(metadata).
Collaborative	filtering
Leverage	social	information	(user-item	interactions)
E.g.:	recommend	items	liked	by	my	peers.	Usually	yields	better	results.
Knowledge-based
Leverage	users	requirements	
Used	for	cars,	loans,	real	estate...	Very	task-specific.
5
Collaborative	filtering
Leverage	social	information	(user-item	interactions)
E.g.:	recommend	items	liked	by	my	peers.	Usually	yields	better	results.
5
RATING	PREDICTION
Rows	are	users,	columns	are	items
~	99%	of	the	entries	are	missing
Your	mission:	predict	the	
6
ABOUT	ME
Nicolas	Hug
PhD	Student	(University	of	Toulouse	III)
Needed	a	Python	library	for	RS	research...	Did	it.
7
OUTLINE
1.	 THE	NEIGHBORHOOD	METHOD	(K-NN)
8
OUTLINE
1.	 THE	NEIGHBORHOOD	METHOD	(K-NN)
2.	 OVERVIEW	OF	
( )
SURPRISE
http://surpriselib.com
8
OUTLINE
1.	 THE	NEIGHBORHOOD	METHOD	(K-NN)
2.	 OVERVIEW	OF	
( )
SURPRISE
http://surpriselib.com
3.	 MATRIX	FACTORIZATION
8
1.	 THE	NEIGHBORHOOD	METHOD	(K-NN)
8
NEIGHBORHOOD
METHODS
9
NEIGHBORHOOD	METHOD
We	have	a	history	of	past	ratings
We	need	to	predict	Alice's	rating	for	Titanic
1.	 Find	the	users	that	have	the	same	tastes	as	Alice
(using	the	rating	history)
2.	 Average	their	ratings	for	Titanic
That's	it
10
1.	 Find	the	users	that	have	the	same	tastes	as	Alice
(using	the	rating	history)
10
WE	NEED	A	SIMILARITY	MEASURE
11
WE	NEED	A	SIMILARITY	MEASURE
	number	of	common	rated	items
11
WE	NEED	A	SIMILARITY	MEASURE
	number	of	common	rated	items
	average	absolute	difference	between	ratings	(it's	actually	a
distance)
11
WE	NEED	A	SIMILARITY	MEASURE
	number	of	common	rated	items
	average	absolute	difference	between	ratings	(it's	actually	a
distance)
	cosine	angle	between	 	and	
11
WE	NEED	A	SIMILARITY	MEASURE
	number	of	common	rated	items
	average	absolute	difference	between	ratings	(it's	actually	a
distance)
	cosine	angle	between	 	and	
	Pearson	correlation	coefficient	between	 	and	
11
WE	NEED	A	SIMILARITY	MEASURE
	number	of	common	rated	items
	average	absolute	difference	between	ratings	(it's	actually	a
distance)
	cosine	angle	between	 	and	
	Pearson	correlation	coefficient	between	 	and	
About	3	millions	other	measures
11
NEIGHBORHOOD	METHOD
We	have	a	history	of	past	ratings
We	need	to	predict	Alice's	rating	for	Titanic
1.	 Find	the	users	that	have	the	same	tastes	as	Alice
(using	the	rating	history)
2.	 Average	their	ratings	for	Titanic
That's	it
12
2.	 Average	their	ratings	for	Titanic
12
AGGREGATING	THE	NEIGHBORS'
RATINGS
Alice	is	close	to	Bob.	Her	rating	for	Titanic	is
probably	close	to	Bob's	(1).	So	
13
AGGREGATING	THE	NEIGHBORS'
RATINGS
Alice	is	close	to	Bob.	Her	rating	for	Titanic	is
probably	close	to	Bob's	(1).	So	
But	we	should	of	course	look	at	more	than	one
neighbor!
13
LET'S	CODE!
												
def	predict_rating(u,	i):
				'''Return	estimated	rating	of	user	u	for	item	i.
							rating_hist	is	a	list	of	tuples	(user,	item,	rating)'''
				#	Retrieve	users	having	rated	i
				neighbors	=	[(sim[u,	v],	r_vj)
																	for	(v,	j,	r_vj)	in	rating_hist	if	(i	==	j)]
				#	Sort	them	by	similarity	with	u
				neighbors.sort(key=lambda	tple:	tple[0],	reversed=True)
				#	Compute	weighted	average	of	the	k-NN's	ratings
				num	=	sum(sim_uv	*	r_vi	for	(sim_uv,	r_vi)	in	neighbors[:k])
				denum	=	sum(sim_uv	for	(sim_uv,	_)	in	neighbors[:k])
				return	num	/	denum
												
14
LET'S	CODE!
												
def	predict_rating(u,	i):
				'''Return	estimated	rating	of	user	u	for	item	i.
							rating_hist	is	a	list	of	tuples	(user,	item,	rating)'''
				#	Retrieve	users	having	rated	i
				neighbors	=	[(sim[u,	v],	r_vj)
																	for	(v,	j,	r_vj)	in	rating_hist	if	(i	==	j)]
				#	Sort	them	by	similarity	with	u
				neighbors.sort(key=lambda	tple:	tple[0],	reversed=True)
				#	Compute	weighted	average	of	the	k-NN's	ratings
				num	=	sum(sim_uv	*	r_vi	for	(sim_uv,	r_vi)	in	neighbors[:k])
				denum	=	sum(sim_uv	for	(sim_uv,	_)	in	neighbors[:k])
				return	num	/	denum
												
14
NEIGHBORHOOD	METHOD
We	have	a	history	of	past	ratings
We	need	to	predict	Alice's	rating	for	Titanic	
1.	 Find	the	users	that	have	the	same	tastes	as	Alice
(using	the	rating	history)
2.	 Average	their	ratings	for	Titanic
That's	it...	 	
15
NEIGHBORHOOD	METHOD
We	have	a	history	of	past	ratings
We	need	to	predict	Alice's	rating	for	Titanic	
1.	 Find	the	users	that	have	the	same	tastes	as	Alice
(using	the	rating	history)
2.	 Average	their	ratings	for	Titanic
That's	it...	?	
15
THERE	ARE	(APPROXIMATELY)	HALF	A	BILLION
VARIANTS
Normalize	the	ratings
16
THERE	ARE	(APPROXIMATELY)	HALF	A	BILLION
VARIANTS
Normalize	the	ratings
Remove	bias	(some	users	are	mean)
16
THERE	ARE	(APPROXIMATELY)	HALF	A	BILLION
VARIANTS
Normalize	the	ratings
Remove	bias	(some	users	are	mean)
Use	a	fancier	aggregation
16
THERE	ARE	(APPROXIMATELY)	HALF	A	BILLION
VARIANTS
Normalize	the	ratings
Remove	bias	(some	users	are	mean)
Use	a	fancier	aggregation
Discount	similarities	(give	them	more	or	less
confidence)
16
THERE	ARE	(APPROXIMATELY)	HALF	A	BILLION
VARIANTS
Normalize	the	ratings
Remove	bias	(some	users	are	mean)
Use	a	fancier	aggregation
Discount	similarities	(give	them	more	or	less
confidence)
Use	item-item	similarity	instead
16
THERE	ARE	(APPROXIMATELY)	HALF	A	BILLION
VARIANTS
Normalize	the	ratings
Remove	bias	(some	users	are	mean)
Use	a	fancier	aggregation
Discount	similarities	(give	them	more	or	less
confidence)
Use	item-item	similarity	instead
Or	use	both	kinds	of	similarities!
16
THERE	ARE	(APPROXIMATELY)	HALF	A	BILLION
VARIANTS
Normalize	the	ratings
Remove	bias	(some	users	are	mean)
Use	a	fancier	aggregation
Discount	similarities	(give	them	more	or	less
confidence)
Use	item-item	similarity	instead
Or	use	both	kinds	of	similarities!
Cluster	users	and/or	items
16
THERE	ARE	(APPROXIMATELY)	HALF	A	BILLION
VARIANTS
Normalize	the	ratings
Remove	bias	(some	users	are	mean)
Use	a	fancier	aggregation
Discount	similarities	(give	them	more	or	less
confidence)
Use	item-item	similarity	instead
Or	use	both	kinds	of	similarities!
Cluster	users	and/or	items
Learn	the	similarities
16
THERE	ARE	(APPROXIMATELY)	HALF	A	BILLION
VARIANTS
Normalize	the	ratings
Remove	bias	(some	users	are	mean)
Use	a	fancier	aggregation
Discount	similarities	(give	them	more	or	less
confidence)
Use	item-item	similarity	instead
Or	use	both	kinds	of	similarities!
Cluster	users	and/or	items
Learn	the	similarities
Blah	blah	blah...
16
OUTLINE
1.	 THE	NEIGHBORHOOD	METHOD	(K-NN)
2.	 OVERVIEW	OF	
( )
3.	 MATRIX	FACTORIZATION
SURPRISE
http://surpriselib.com
17
2.	 OVERVIEW	OF	
( )
SURPRISE
http://surpriselib.com
17
SURPRISE
A	Python	library	for	recommender	systems	
(Or	rather:	a	Python	library	for	rating	prediction	algorithms)
18
WHY?
Needed	a	Python	lib	for	quick	and	easy	prototyping
Needed	to	control	my	experiments
19
SO	WHY	NOT	SCIKIT-LEARN?
20
SO	WHY	NOT	SCIKIT-LEARN?
Rating	prediction	≠	regression	or	classification	
20
YES	:)
NO	:(
												
clf	=	MyClassifier()
clf.fit(X_train,	y_train)
clf.predict(X_test)
										
												
rec	=	MyRecommender()
rec.fit(X_train,	y_train)
rec.predict(X_test)
										
21
BASIC	USAGE
												
from	surprise	import	KNNBasic
from	surprise	import	Dataset
data	=	Dataset.load_builtin('ml-100k')		#	download	dataset
trainset	=	data.build_full_trainset()		#	build	trainset
algo	=	KNNBasic()		#	use	built-in	prediction	algorithm
algo.train(trainset)		#	fit	data
algo.predict('Alice',	'Titanic')
algo.predict('Bob',	'Toy	Story')
#	...
										
22
MAIN	FEATURES
Easy	dataset	handling
23
DATASET	HANDLING
												
#	Built-in	datasets	(movielens,	Jester)
data	=	Dataset.load_builtin('ml-100k')
#	Custom	datasets	(from	file)
file_path	=	os.path.expanduser('./my_data')
reader	=	Reader(line_format='user	item	rating	timestamp',
																sep='t')
data	=	Dataset.load_from_file(file_path,	reader=reader)
#	Custom	datasets	(from	pandas	dataframe)
reader	=	Reader(rating_scale=(1,	5))
data	=	Dataset.load_from_df(df[['uid',	'iid',	'r_ui']],
																												reader)
										
24
MAIN	FEATURES
Built-in	prediction	algorithms	(SVD,	k-NN,	many
others)
Built-in	similarity	measures	(Cosine,	Pearson...)
25
BUILT-IN	ALGORITHMS	AND
SIMILARITIES
SVD,	SVD++,	NMF,	 -NN	(with	variants),	Slope	One,
some	baselines...
Cosine,	Pearson,	MSD	(between	users	or	items)
												
sim_options	=	{'name':	'cosine',
															'user_based':	False,
															'min_support':	10
															}
algo	=	KNNBasic(sim_options=sim_options)
										
26
MAIN	FEATURES
Custom	algorithms	are	easy	to	implement
27
CUSTOM	PREDICTION	ALGORITHM
												
class	MyRatingPredictor(AlgoBase):
				def	estimate(self,	u,	i):
								return	3
algo	=	MyRatingPredictor()
algo.train(trainset)
pred	=	algo.predict('Alice',	'Titanic')		#	will	call	estimate
										
28
CUSTOM	PREDICTION	ALGORITHM
												
class	MyRatingPredictor(AlgoBase):
				def	train(self,	trainset):
								'''Fit	your	data	here.'''
								self.mean	=	np.mean([r_ui	for	(u,	i,	r_ui)
																													in	trainset.all_ratings()])
				def	estimate(self,	u,	i):
								return	self.mean
										
29
CUSTOM	PREDICTION	ALGORITHM
												
class	MyRatingPredictor(AlgoBase):
				def	train(self,	trainset):
								'''Fit	your	data	here.'''
								self.mean	=	np.mean([r_ui	for	(u,	i,	r_ui)
																													in	trainset.all_ratings()])
				def	estimate(self,	u,	i):
								return	self.mean
										
trainset	object:
Iterators	over	the	rating	history	(user-wise,	item-wise,	or	unordered)
Iterators	over	users	and	items	ids
Other	useful	methods/attributes
29
class	MyKNN(AlgoBase):
				def	train(self,	trainset):
								self.trainset	=	trainset
								self.sim	=	...		#	Compute	similarity	matrix
				def	estimate(self,	u,	i):
								neighbors	=	[(self.sim[u,	v],	r_vi)	for	(v,	r_vj)
																						in	self.trainset.ur[u]]
								neighbors	=	sorted(neighbors,
																											key=lambda	tple:	tple[0],
																											reverse=True)
								sum_sim	=	sum_ratings	=	0
								for	(sim_uv,	r_vi)	in	neighbors[:self.k]:
												sum_sim	+=	sim
												sum_ratings	+=	sim	*	r
								return	sum_ratings	/	sum_sim
										
30
MAIN	FEATURES
Cross-validation,	grid-search
31
TYPICAL	EVALUATION	PROTOCOL
Hide	some	of	the	 	(they	become	 )	
Use	the	remaining	 	to	predict	the	
32
TYPICAL	EVALUATION	PROTOCOL
Hide	some	of	the	 	(they	become	 )	
Use	the	remaining	 	to	predict	the	
RMSE	=	 	
The	average	error,	where	big	errors	are	heavily	penalized	(squared)	
32
TYPICAL	EVALUATION	PROTOCOL
Hide	some	of	the	 	(they	become	 )	
Use	the	remaining	 	to	predict	the	
RMSE	=	 	
The	average	error,	where	big	errors	are	heavily	penalized	(squared)	
Do	that	many	times	with	different	subsets:	this	is	cross-validation
32
CROSS	VALIDATION
												
data	=	Dataset.load_builtin('ml-100k')		#	download	dataset
data.split(n_folds=3)		#	3-folds	cross	validation
algo	=	SVD()
for	trainset,	testset	in	data.folds():
				algo.train(trainset)		#	fit	data
				predictions	=	algo.test(testset)		#	predict	ratings
				accuracy.rmse(predictions,	verbose=True)		#	print	RMSE
										
33
GRID-SEARCH
												
param_grid	=	{'n_epochs':	[5,	10],	'lr_all':	[0.002,	0.005],
														'reg_all':	[0.4,	0.6]}
grid_search	=	GridSearch(SVD,	param_grid,
																									measures=['RMSE',	'FCP'])
data	=	Dataset.load_builtin('ml-100k')
data.split(n_folds=3)
grid_search.evaluate(data)		#	will	evaluate	each	combination
print(grid_search.best_score['RMSE'])
print(grid_search.best_params['RMSE'])
algo	=	grid_search.best_estimator['RMSE'])
										
34
MAIN	FEATURES
Built-in	evaluation	measures	(RMSE,	MAE...)
35
EVALUATION	TOOLS
Can	also	compute	Recall,	Precision	and	top-N	related
measures	easily
												
for	trainset,	testset	in	data.folds():
				algo.train(trainset)		#	fit	data
				predictions	=	algo.test(testset)		#	predict	ratings
				accuracy.rmse(predictions)
				accuracy.mae(predictions)
				accuracy.fcp(predictions)
										
36
MAIN	FEATURES
Model	persistence
37
MODEL	PERSISTENCE
Can	also	dump	the	predictions	to	analyze	and
carefully	compare	algorithms	with	pandas
												
#	...	grid	search
algo	=	grid_search.best_estimator['RMSE'])
#	dump	algorithm
file_name	=	os.path.expanduser('~/dump_file')
dump.dump(file_name,	algo=algo)
#	...
#	Close	Python,	go	to	bed
#	...
#	Wake	up,	reload	algorithm,	profit
_,	algo	=	dump.load(file_name)
										
38
OUTLINE
1.	 THE	NEIGHBORHOOD	METHOD	(K-NN)
2.	 OVERVIEW	OF	
( )
3.	 MATRIX	FACTORIZATION
SURPRISE
http://surpriselib.com
39
3.	 MATRIX	FACTORIZATION
39
MATRIX
FACTORIZATION
40
MATRIX	FACTORIZATION
A	lot	of	hype	during	the	Netflix	Prize	
(2006-2009:	improve	our	system,	get	rich)
Model	the	ratings	in	an	insightful	way
Takes	its	root	in	dimensional	reduction	and	SVD
41
BEFORE	SVD:	PCA
Here	are	400	greyscale	images	(64	x	64):
	 	 	 	 	 	 	 	 	
Put	them	in	a	400	x	4096	matrix	 :
42
PCA	also	gives	you	the	 .	
In	advance:	you	don't	need	all	the	400	guys
	
BEFORE	SVD:	PCA
PCA	will	reveal	400	of	those	creepy	typical	guys:	
	 	 	 	 	 	 	 	 	 	
These	guys	can	build	back	all	of	the	original	faces	
43
PCA	ON	A	RATING	MATRIX?	SURE!
Assume	all	ratings	are	known	
	
Exact	same	thing!	We	just	have	ratings	instead	of	pixels.	
PCA	will	reveal	typical	users.
44
PCA	ON	A	RATING	MATRIX?	SURE!
Assume	all	ratings	are	known	
	
Exact	same	thing!	We	just	have	ratings	instead	of	pixels.	
PCA	will	reveal	typical	users.
	 	 	 	 	 	 	 	
44
PCA	ON	A	RATING	MATRIX?	SURE!
Assume	all	ratings	are	known.	Transpose	the	matrix	
	
Exact	same	thing!	PCA	will	reveal	typical	movies.
45
PCA	ON	A	RATING	MATRIX?	SURE!
Assume	all	ratings	are	known.	Transpose	the	matrix	
	
Exact	same	thing!	PCA	will	reveal	typical	movies.
	 	 	 	 	 	 	 	
Note:	in	practice,	the	factors	semantic	is	not	clearly	defined.
45
SVD	IS	PCA2
PCA	on	 	gives	you	the	typical	users	
PCA	on	 	gives	you	the	typical	movies	
SVD	gives	you	both	in	one	shot! 	
46
SVD	IS	PCA2
PCA	on	 	gives	you	the	typical	users	
PCA	on	 	gives	you	the	typical	movies	
SVD	gives	you	both	in	one	shot! 	
	is	diagonal,	it's	just	a	scaler.
This	is	our	matrix	factorization!
46
THE	MODEL	OF	SVD
47
THE	MODEL	OF	SVD
47
THE	MODEL	OF	SVD
47
THE	MODEL	OF	SVD
Rating(Alice,	Titanic)	will	be	high
Rating(Bob,	Titanic)	will	be	low
47
SO	HOW	TO	COMPUTE	 	AND	 ?
Columns	of	 	are	the	eigenvectors	of	
Columns	of	 	are	the	eigenvectors	of	
Associated	eigenvalues	make	up	the	diagonal	of	
There	are	very	efficient	algorithms	in	the	wild
	
48
SO	HOW	TO	COMPUTE	 	AND	 ?
Columns	of	 	are	the	eigenvectors	of	
Columns	of	 	are	the	eigenvectors	of	
Associated	eigenvalues	make	up	the	diagonal	of	
There	are	very	efficient	algorithms	in	the	wild
	
Alternate	option:	find	the	 s	and	the	 s	that	minimize	the	reconstruction	error
(With	some	orthogonality	constraints).	There	are	also	very	efficient	algorithms	in	the	wild
48
SO	HOW	TO	COMPUTE	 	AND	 ?
Columns	of	 	are	the	eigenvectors	of	
Columns	of	 	are	the	eigenvectors	of	
Associated	eigenvalues	make	up	the	diagonal	of	
There	are	very	efficient	algorithms	in	the	wild
	
Alternate	option:	find	the	 s	and	the	 s	that	minimize	the	reconstruction	error
(With	some	orthogonality	constraints).	There	are	also	very	efficient	algorithms	in	the	wild
So,	piece	of	cake	right?
48
OOPS!
49
WE	ASSUMED	THAT	 	WAS	DENSE
But	it's	not!	99%	are	missing
	and	 	are	not	even	defined
So	 	and	 	are	not	defined	either
There	is	no	SVD	
50
WE	ASSUMED	THAT	 	WAS	DENSE
But	it's	not!	99%	are	missing
	and	 	are	not	even	defined
So	 	and	 	are	not	defined	either
There	is	no	SVD	
Two	options:
Fill	the	missing	entries	with	a	simple	heuristic
"	Let's	just	not	give	a	damn	"	--	Simon	Funk	(ended-
up	top-3	of	the	Netflix	Prize	for	some	time)
50
Dense	case:	find	the	 s
and	the	 s	that	minimize
the	total	reconstruction
error	
(With	orthogonality
constraints)
Sparse	case:	find	the	 s
and	the	 s	that	minimize
the	partial	reconstruction
error	
(Forget	about
orthogonality)
APPROXIMATION
51
Dense	case:	find	the	 s
and	the	 s	that	minimize
the	total	reconstruction
error	
(With	orthogonality
constraints)
Sparse	case:	find	the	 s
and	the	 s	that	minimize
the	partial	reconstruction
error	
(Forget	about
orthogonality)
APPROXIMATION
Basically	the	same,	except	we	don't	have	all	the
ratings	(and	we	don't	care)
51
We	want	the	value	 	such	that	
is	minimal:
Compute	
Randomly	initialize	
	(do	this
until	you're	fed	up)
MINIMIZATION	BY	GRADIENT	DESCENT
52
MINIMIZATION	BY	(STOCHASTIC)	GRADIENT	DESCENT
Our	parameter	 	is	 	for	all	 	and	 .	The	function	 	to	be	minimized	is:
												
def	compute_SVD():
				'''Fit	pu	and	qi	to	known	ratings	by	SGD'''
				p	=	np.random.normal(size=F)
				q	=	np.random.normal(size=F)
				for	iter	in	range(n_max_iter):
								for	u,	i,	r_ui	in	rating_hist:
												err	=	r_ui	-	np.dot(p[u],	q[i])
												p[u]	=	p[u]	+	learning_rate	*	err	*	q[i]
												q[i]	=	q[i]	+	learning_rate	*	err	*	p[u]
def	estimate_rating(u,	i):
				return	np.dot(p[u],	q[i])
										
53
SOME	LAST	DETAILS
Unbias	the	ratings,	add	regularization:	you	get	"SVD":	
54
SOME	LAST	DETAILS
Unbias	the	ratings,	add	regularization:	you	get	"SVD":	
Good	ol'	fashioned	ML	paradigm:
Assume	a	model	for	your	data	( )
Fit	your	model	parameters	to	the	observed	data
Praise	the	Lord	and	hope	for	the	best
54
A	FEW	REMARKS
	is	mostly	a	tool	for	algorithms	that	predict
ratings.	RS	do	much	more	than	that.
Focus	on	explicit	ratings	(implicit	ratings	algorithms
will	come,	hopefully)
Not	aimed	to	be	a	complete	tool	for	building	RS
from	A	to	Z	(check	out	 )
Not	aimed	to	be	the	most	efficient	implementation
(check	out	 )
Surprise
Mangaki
LightFM
55
SOME	REFERENCES
Can't	recommend	enough	(pun	intended)
Aggarwal's	Recommender	Systems	-	The	Textbook
Jeremy	Kun's	 	(great	insights	on	 	and	 )blog PCA SVD
56
THANKS!
57
1 of 96

Recommended

Recommender system algorithm and architecture by
Recommender system algorithm and architectureRecommender system algorithm and architecture
Recommender system algorithm and architectureLiang Xiang
40.7K views39 slides
Recommender Systems by
Recommender SystemsRecommender Systems
Recommender SystemsCarlos Castillo (ChaTo)
2.8K views67 slides
How to Build Recommender System with Content based Filtering by
How to Build Recommender System with Content based FilteringHow to Build Recommender System with Content based Filtering
How to Build Recommender System with Content based FilteringVõ Duy Tuấn
8.1K views27 slides
Recommender Systems by
Recommender SystemsRecommender Systems
Recommender SystemsFrancesco Casalegno
2.3K views35 slides
Recommender systems: Content-based and collaborative filtering by
Recommender systems: Content-based and collaborative filteringRecommender systems: Content-based and collaborative filtering
Recommender systems: Content-based and collaborative filteringViet-Trung TRAN
11.4K views42 slides
Recommender Systems by
Recommender SystemsRecommender Systems
Recommender SystemsGirish Khanzode
8.7K views96 slides

More Related Content

What's hot

Matrix Factorization In Recommender Systems by
Matrix Factorization In Recommender SystemsMatrix Factorization In Recommender Systems
Matrix Factorization In Recommender SystemsYONG ZHENG
26.2K views57 slides
Travelling Salesman Problem using Partical Swarm Optimization by
Travelling Salesman Problem using Partical Swarm OptimizationTravelling Salesman Problem using Partical Swarm Optimization
Travelling Salesman Problem using Partical Swarm OptimizationIlgın Kavaklıoğulları
1.4K views22 slides
Natural Language Processing: L02 words by
Natural Language Processing: L02 wordsNatural Language Processing: L02 words
Natural Language Processing: L02 wordsananth
3.5K views32 slides
Recommendation System by
Recommendation SystemRecommendation System
Recommendation SystemAnamta Sayyed
491 views27 slides
Recommendation System Explained by
Recommendation System ExplainedRecommendation System Explained
Recommendation System ExplainedCrossing Minds
10.8K views64 slides
Content based recommendation systems by
Content based recommendation systemsContent based recommendation systems
Content based recommendation systemsAravindharamanan S
283 views29 slides

What's hot(20)

Matrix Factorization In Recommender Systems by YONG ZHENG
Matrix Factorization In Recommender SystemsMatrix Factorization In Recommender Systems
Matrix Factorization In Recommender Systems
YONG ZHENG26.2K views
Natural Language Processing: L02 words by ananth
Natural Language Processing: L02 wordsNatural Language Processing: L02 words
Natural Language Processing: L02 words
ananth3.5K views
Recommendation System Explained by Crossing Minds
Recommendation System ExplainedRecommendation System Explained
Recommendation System Explained
Crossing Minds10.8K views
How to build a recommender system? by blueace
How to build a recommender system?How to build a recommender system?
How to build a recommender system?
blueace25.6K views
An introduction to Recommender Systems by David Zibriczky
An introduction to Recommender SystemsAn introduction to Recommender Systems
An introduction to Recommender Systems
David Zibriczky2.3K views
Udacity webinar on Recommendation Systems by Axel de Romblay
Udacity webinar on Recommendation SystemsUdacity webinar on Recommendation Systems
Udacity webinar on Recommendation Systems
Axel de Romblay742 views
Calibrated Recommendations by Harald Steck
Calibrated RecommendationsCalibrated Recommendations
Calibrated Recommendations
Harald Steck4.2K views
Example of iterative deepening search & bidirectional search by Abhijeet Agarwal
Example of iterative deepening search & bidirectional searchExample of iterative deepening search & bidirectional search
Example of iterative deepening search & bidirectional search
Abhijeet Agarwal6.9K views
Netflix Global Search - Lucene Revolution by ivan provalov
Netflix Global Search - Lucene RevolutionNetflix Global Search - Lucene Revolution
Netflix Global Search - Lucene Revolution
ivan provalov2.5K views
Deep learning for audio-based music recommendation by Russia.AI
Deep learning for audio-based music recommendationDeep learning for audio-based music recommendation
Deep learning for audio-based music recommendation
Russia.AI1.5K views
An Example of Predictive Analytics: Building a Recommendation Engine Using Py... by PyData
An Example of Predictive Analytics: Building a Recommendation Engine Using Py...An Example of Predictive Analytics: Building a Recommendation Engine Using Py...
An Example of Predictive Analytics: Building a Recommendation Engine Using Py...
PyData8K views
Deep Learning for Recommender Systems by Justin Basilico
Deep Learning for Recommender SystemsDeep Learning for Recommender Systems
Deep Learning for Recommender Systems
Justin Basilico21.1K views

Viewers also liked

PyParis 2017 / Un mooc python, by thierry parmentelat by
PyParis 2017 / Un mooc python, by thierry parmentelatPyParis 2017 / Un mooc python, by thierry parmentelat
PyParis 2017 / Un mooc python, by thierry parmentelatPôle Systematic Paris-Region
2.5K views29 slides
Rekomendujemy - Szybkie wprowadzenie do systemów rekomendacji oraz trochę wie... by
Rekomendujemy - Szybkie wprowadzenie do systemów rekomendacji oraz trochę wie...Rekomendujemy - Szybkie wprowadzenie do systemów rekomendacji oraz trochę wie...
Rekomendujemy - Szybkie wprowadzenie do systemów rekomendacji oraz trochę wie...Bartlomiej Twardowski
4.5K views65 slides
How To Implement a CMS by
How To Implement a CMSHow To Implement a CMS
How To Implement a CMSJonathan Smith
7K views58 slides
Content based filtering by
Content based filteringContent based filtering
Content based filteringBendito Freitas Ribeiro
8.4K views13 slides
How to build a Recommender System by
How to build a Recommender SystemHow to build a Recommender System
How to build a Recommender SystemVõ Duy Tuấn
8.8K views38 slides
Systemy rekomendacji by
Systemy rekomendacjiSystemy rekomendacji
Systemy rekomendacjiAdam Kawa
6.7K views45 slides

Viewers also liked(7)

Similar to Collaborative filtering for recommendation systems in Python, Nicolas Hug

Capstone Project Essay by
Capstone Project EssayCapstone Project Essay
Capstone Project EssayKrystal Ellison
2 views85 slides
The hunt for the perfect interface in a googlified world by
The hunt for the perfect interface in a googlified worldThe hunt for the perfect interface in a googlified world
The hunt for the perfect interface in a googlified worldnabot
798 views50 slides
Research Of Restaraunt For Business Research Essay by
Research Of Restaraunt For Business Research EssayResearch Of Restaraunt For Business Research Essay
Research Of Restaraunt For Business Research EssayPamela Caluso
3 views47 slides
Essay About Research Methodology Report by
Essay About Research Methodology ReportEssay About Research Methodology Report
Essay About Research Methodology ReportWrite My Economics Paper UK
4 views24 slides
Penguins in-sweaters-or-serendipitous-entity-search-on-user-generated-content by
Penguins in-sweaters-or-serendipitous-entity-search-on-user-generated-contentPenguins in-sweaters-or-serendipitous-entity-search-on-user-generated-content
Penguins in-sweaters-or-serendipitous-entity-search-on-user-generated-contentWenqiang Chen
394 views24 slides

Similar to Collaborative filtering for recommendation systems in Python, Nicolas Hug(20)

The hunt for the perfect interface in a googlified world by nabot
The hunt for the perfect interface in a googlified worldThe hunt for the perfect interface in a googlified world
The hunt for the perfect interface in a googlified world
nabot798 views
Research Of Restaraunt For Business Research Essay by Pamela Caluso
Research Of Restaraunt For Business Research EssayResearch Of Restaraunt For Business Research Essay
Research Of Restaraunt For Business Research Essay
Pamela Caluso3 views
Penguins in-sweaters-or-serendipitous-entity-search-on-user-generated-content by Wenqiang Chen
Penguins in-sweaters-or-serendipitous-entity-search-on-user-generated-contentPenguins in-sweaters-or-serendipitous-entity-search-on-user-generated-content
Penguins in-sweaters-or-serendipitous-entity-search-on-user-generated-content
Wenqiang Chen394 views
Aut tace, Aut Loquere meliora Silentio (and the Likes) by Alfonso Pierantonio
Aut tace, Aut Loquere meliora Silentio (and the Likes) Aut tace, Aut Loquere meliora Silentio (and the Likes)
Aut tace, Aut Loquere meliora Silentio (and the Likes)
Watching the workers: researching information behaviours in, and for, workplaces by Hazel Hall
Watching the workers: researching information behaviours in, and for, workplacesWatching the workers: researching information behaviours in, and for, workplaces
Watching the workers: researching information behaviours in, and for, workplaces
Hazel Hall2.7K views
Upgrading the Scholarly Infrastructure by Björn Brembs
Upgrading the Scholarly InfrastructureUpgrading the Scholarly Infrastructure
Upgrading the Scholarly Infrastructure
Björn Brembs195 views
AI Driven Product Innovation by ebelani
AI Driven Product InnovationAI Driven Product Innovation
AI Driven Product Innovation
ebelani15 views
AI-driven product innovation: from Recommender Systems to COVID-19 by Xavier Amatriain
AI-driven product innovation: from Recommender Systems to COVID-19AI-driven product innovation: from Recommender Systems to COVID-19
AI-driven product innovation: from Recommender Systems to COVID-19
Xavier Amatriain864 views
Discovering the future of podcasting by Amber Parkin
Discovering the future of podcastingDiscovering the future of podcasting
Discovering the future of podcasting
Amber Parkin635 views
ESSAY ON SECTION 5 INFORMAL PROCESSES AND DISCRETION (Due 11.docx by theodorelove43763
ESSAY ON SECTION 5 INFORMAL PROCESSES AND DISCRETION (Due 11.docxESSAY ON SECTION 5 INFORMAL PROCESSES AND DISCRETION (Due 11.docx
ESSAY ON SECTION 5 INFORMAL PROCESSES AND DISCRETION (Due 11.docx
Evaluating Explainable Interfaces for a Knowledge Graph-Based Recommender System by Erasmo Purificato
Evaluating Explainable Interfaces for a Knowledge Graph-Based Recommender SystemEvaluating Explainable Interfaces for a Knowledge Graph-Based Recommender System
Evaluating Explainable Interfaces for a Knowledge Graph-Based Recommender System
Personalizing the web building effective recommender systems by Aravindharamanan S
Personalizing the web building effective recommender systemsPersonalizing the web building effective recommender systems
Personalizing the web building effective recommender systems
Statistical Analysis of Results in Music Information Retrieval: Why and How by Julián Urbano
Statistical Analysis of Results in Music Information Retrieval: Why and HowStatistical Analysis of Results in Music Information Retrieval: Why and How
Statistical Analysis of Results in Music Information Retrieval: Why and How
Julián Urbano1.1K views

More from Pôle Systematic Paris-Region

OSIS19_IoT :Transparent remote connectivity to short-range IoT devices, by Na... by
OSIS19_IoT :Transparent remote connectivity to short-range IoT devices, by Na...OSIS19_IoT :Transparent remote connectivity to short-range IoT devices, by Na...
OSIS19_IoT :Transparent remote connectivity to short-range IoT devices, by Na...Pôle Systematic Paris-Region
686 views39 slides
OSIS19_Cloud : SAFC: Scheduling and Allocation Framework for Containers in a ... by
OSIS19_Cloud : SAFC: Scheduling and Allocation Framework for Containers in a ...OSIS19_Cloud : SAFC: Scheduling and Allocation Framework for Containers in a ...
OSIS19_Cloud : SAFC: Scheduling and Allocation Framework for Containers in a ...Pôle Systematic Paris-Region
293 views24 slides
OSIS19_Cloud : Qu’apporte l’observabilité à la gestion de configuration? par ... by
OSIS19_Cloud : Qu’apporte l’observabilité à la gestion de configuration? par ...OSIS19_Cloud : Qu’apporte l’observabilité à la gestion de configuration? par ...
OSIS19_Cloud : Qu’apporte l’observabilité à la gestion de configuration? par ...Pôle Systematic Paris-Region
349 views38 slides
OSIS19_Cloud : Performance and power management in virtualized data centers, ... by
OSIS19_Cloud : Performance and power management in virtualized data centers, ...OSIS19_Cloud : Performance and power management in virtualized data centers, ...
OSIS19_Cloud : Performance and power management in virtualized data centers, ...Pôle Systematic Paris-Region
288 views27 slides
OSIS19_Cloud : Des objets dans le cloud, et qui y restent -- L'expérience du ... by
OSIS19_Cloud : Des objets dans le cloud, et qui y restent -- L'expérience du ...OSIS19_Cloud : Des objets dans le cloud, et qui y restent -- L'expérience du ...
OSIS19_Cloud : Des objets dans le cloud, et qui y restent -- L'expérience du ...Pôle Systematic Paris-Region
271 views30 slides
OSIS19_Cloud : Attribution automatique de ressources pour micro-services, Alt... by
OSIS19_Cloud : Attribution automatique de ressources pour micro-services, Alt...OSIS19_Cloud : Attribution automatique de ressources pour micro-services, Alt...
OSIS19_Cloud : Attribution automatique de ressources pour micro-services, Alt...Pôle Systematic Paris-Region
229 views9 slides

More from Pôle Systematic Paris-Region(20)

Recently uploaded

Elevating Privacy and Security in CloudStack - Boris Stoyanov - ShapeBlue by
Elevating Privacy and Security in CloudStack - Boris Stoyanov - ShapeBlueElevating Privacy and Security in CloudStack - Boris Stoyanov - ShapeBlue
Elevating Privacy and Security in CloudStack - Boris Stoyanov - ShapeBlueShapeBlue
179 views7 slides
Network Source of Truth and Infrastructure as Code revisited by
Network Source of Truth and Infrastructure as Code revisitedNetwork Source of Truth and Infrastructure as Code revisited
Network Source of Truth and Infrastructure as Code revisitedNetwork Automation Forum
52 views45 slides
Backup and Disaster Recovery with CloudStack and StorPool - Workshop - Venko ... by
Backup and Disaster Recovery with CloudStack and StorPool - Workshop - Venko ...Backup and Disaster Recovery with CloudStack and StorPool - Workshop - Venko ...
Backup and Disaster Recovery with CloudStack and StorPool - Workshop - Venko ...ShapeBlue
144 views12 slides
CloudStack and GitOps at Enterprise Scale - Alex Dometrius, Rene Glover - AT&T by
CloudStack and GitOps at Enterprise Scale - Alex Dometrius, Rene Glover - AT&TCloudStack and GitOps at Enterprise Scale - Alex Dometrius, Rene Glover - AT&T
CloudStack and GitOps at Enterprise Scale - Alex Dometrius, Rene Glover - AT&TShapeBlue
112 views34 slides
Uni Systems for Power Platform.pptx by
Uni Systems for Power Platform.pptxUni Systems for Power Platform.pptx
Uni Systems for Power Platform.pptxUni Systems S.M.S.A.
61 views21 slides
Transitioning from VMware vCloud to Apache CloudStack: A Path to Profitabilit... by
Transitioning from VMware vCloud to Apache CloudStack: A Path to Profitabilit...Transitioning from VMware vCloud to Apache CloudStack: A Path to Profitabilit...
Transitioning from VMware vCloud to Apache CloudStack: A Path to Profitabilit...ShapeBlue
117 views25 slides

Recently uploaded(20)

Elevating Privacy and Security in CloudStack - Boris Stoyanov - ShapeBlue by ShapeBlue
Elevating Privacy and Security in CloudStack - Boris Stoyanov - ShapeBlueElevating Privacy and Security in CloudStack - Boris Stoyanov - ShapeBlue
Elevating Privacy and Security in CloudStack - Boris Stoyanov - ShapeBlue
ShapeBlue179 views
Backup and Disaster Recovery with CloudStack and StorPool - Workshop - Venko ... by ShapeBlue
Backup and Disaster Recovery with CloudStack and StorPool - Workshop - Venko ...Backup and Disaster Recovery with CloudStack and StorPool - Workshop - Venko ...
Backup and Disaster Recovery with CloudStack and StorPool - Workshop - Venko ...
ShapeBlue144 views
CloudStack and GitOps at Enterprise Scale - Alex Dometrius, Rene Glover - AT&T by ShapeBlue
CloudStack and GitOps at Enterprise Scale - Alex Dometrius, Rene Glover - AT&TCloudStack and GitOps at Enterprise Scale - Alex Dometrius, Rene Glover - AT&T
CloudStack and GitOps at Enterprise Scale - Alex Dometrius, Rene Glover - AT&T
ShapeBlue112 views
Transitioning from VMware vCloud to Apache CloudStack: A Path to Profitabilit... by ShapeBlue
Transitioning from VMware vCloud to Apache CloudStack: A Path to Profitabilit...Transitioning from VMware vCloud to Apache CloudStack: A Path to Profitabilit...
Transitioning from VMware vCloud to Apache CloudStack: A Path to Profitabilit...
ShapeBlue117 views
Keynote Talk: Open Source is Not Dead - Charles Schulz - Vates by ShapeBlue
Keynote Talk: Open Source is Not Dead - Charles Schulz - VatesKeynote Talk: Open Source is Not Dead - Charles Schulz - Vates
Keynote Talk: Open Source is Not Dead - Charles Schulz - Vates
ShapeBlue210 views
CloudStack Managed User Data and Demo - Harikrishna Patnala - ShapeBlue by ShapeBlue
CloudStack Managed User Data and Demo - Harikrishna Patnala - ShapeBlueCloudStack Managed User Data and Demo - Harikrishna Patnala - ShapeBlue
CloudStack Managed User Data and Demo - Harikrishna Patnala - ShapeBlue
ShapeBlue94 views
The Role of Patterns in the Era of Large Language Models by Yunyao Li
The Role of Patterns in the Era of Large Language ModelsThe Role of Patterns in the Era of Large Language Models
The Role of Patterns in the Era of Large Language Models
Yunyao Li80 views
Hypervisor Agnostic DRS in CloudStack - Brief overview & demo - Vishesh Jinda... by ShapeBlue
Hypervisor Agnostic DRS in CloudStack - Brief overview & demo - Vishesh Jinda...Hypervisor Agnostic DRS in CloudStack - Brief overview & demo - Vishesh Jinda...
Hypervisor Agnostic DRS in CloudStack - Brief overview & demo - Vishesh Jinda...
ShapeBlue120 views
VNF Integration and Support in CloudStack - Wei Zhou - ShapeBlue by ShapeBlue
VNF Integration and Support in CloudStack - Wei Zhou - ShapeBlueVNF Integration and Support in CloudStack - Wei Zhou - ShapeBlue
VNF Integration and Support in CloudStack - Wei Zhou - ShapeBlue
ShapeBlue163 views
DRBD Deep Dive - Philipp Reisner - LINBIT by ShapeBlue
DRBD Deep Dive - Philipp Reisner - LINBITDRBD Deep Dive - Philipp Reisner - LINBIT
DRBD Deep Dive - Philipp Reisner - LINBIT
ShapeBlue140 views
Updates on the LINSTOR Driver for CloudStack - Rene Peinthor - LINBIT by ShapeBlue
Updates on the LINSTOR Driver for CloudStack - Rene Peinthor - LINBITUpdates on the LINSTOR Driver for CloudStack - Rene Peinthor - LINBIT
Updates on the LINSTOR Driver for CloudStack - Rene Peinthor - LINBIT
ShapeBlue166 views
Import Export Virtual Machine for KVM Hypervisor - Ayush Pandey - University ... by ShapeBlue
Import Export Virtual Machine for KVM Hypervisor - Ayush Pandey - University ...Import Export Virtual Machine for KVM Hypervisor - Ayush Pandey - University ...
Import Export Virtual Machine for KVM Hypervisor - Ayush Pandey - University ...
ShapeBlue79 views
"Surviving highload with Node.js", Andrii Shumada by Fwdays
"Surviving highload with Node.js", Andrii Shumada "Surviving highload with Node.js", Andrii Shumada
"Surviving highload with Node.js", Andrii Shumada
Fwdays53 views
CloudStack Object Storage - An Introduction - Vladimir Petrov - ShapeBlue by ShapeBlue
CloudStack Object Storage - An Introduction - Vladimir Petrov - ShapeBlueCloudStack Object Storage - An Introduction - Vladimir Petrov - ShapeBlue
CloudStack Object Storage - An Introduction - Vladimir Petrov - ShapeBlue
ShapeBlue93 views
Business Analyst Series 2023 - Week 4 Session 7 by DianaGray10
Business Analyst Series 2023 -  Week 4 Session 7Business Analyst Series 2023 -  Week 4 Session 7
Business Analyst Series 2023 - Week 4 Session 7
DianaGray10126 views

Collaborative filtering for recommendation systems in Python, Nicolas Hug