forked from nishantrathi100/Yelp-Data-Mining
-
Notifications
You must be signed in to change notification settings - Fork 0
/
trainDataDirectory.py
54 lines (35 loc) · 1.16 KB
/
trainDataDirectory.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
from util import *
train_filename = 'pickle/train/uid/'
train_user = load_pickle(train_filename+'userid.pickle')
train_ratings = load_pickle(train_filename+'rating.pickle')
train_business = load_pickle(train_filename+'business.pickle')
train_docs_csr = load_pickle(train_filename+'docs_csr.pickle')
train_docs_full = load_pickle(train_filename+'docs_full.pickle')
train_unique_users = set(train_user)
train_unique_business = set(train_business)
def getTrainAllUsers():
return train_user
def getTrainAllBusiness():
return train_business
def getTrainAllActualRating():
return train_ratings
def getTrainAllDocCSR():
return train_docs_csr
def getTrainAllDocFull():
return train_docs_full
def getTrainAllDocFullI(indices):
return [train_docs_full[i] for i in indices]
def getTrainUser(i):
return train_user[i]
def getTrainBusiness(i):
return train_business[i]
def getTrainActualRating(i):
return train_ratings[i]
def getTrainDocFull(i):
return train_docs_full[i]
def getTrainDocCSR(i):
return train_docs_csr[i]
def getTrainUniqueUsers():
return train_unique_users
def getTrainUniqueBusiness():
return train_unique_business