-
Notifications
You must be signed in to change notification settings - Fork 4.8k
/
Copy pathclasses.py
36 lines (29 loc) · 805 Bytes
/
classes.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/usr/bin/env python
# coding: utf-8
# In[ ]:
from util import random_vector
class user:
def __init__(self, userid):
self.userid = userid
self.movies_train = dict()
self.movies_test = dict()
self.movies_all = dict()
self.factor = random_vector()
class movie:
def __init__(self, movieid, rating=0, title=None, genres=None):
self.movieid = movieid
self.rating = rating
self.title = title
self.genres = genres
self.factor = random_vector()
class ret:
def __init__(self):
self.userid = None
self.movieid = None
self.isuser = True
self.retvalue = []
class usermovie:
def __init__(self):
self.userid = None
self.movieid = None
self.rating = 0