示例#1
0
 def build_model(self,train_set):
     i_model = None
     if self.friends_data:
         i_model = FriendsModel(train_set, self.friends_data)
     else:
         i_model = Model(train_set)
     return i_model
示例#2
0
def create_model():
    raw_data = get_user_item_matrix()
    friend_data = get_friends_data()
    i_model = FriendsModel(raw_data, friend_data)
    return i_model
示例#3
0
def get_similarity_matrix(data_set, friend_data):
    i_model = FriendsModel(data_set, friend_data)
    similarity = CosineSimilarity(i_model)

    return similarity
示例#4
0
 def build_model(self,train_set):
     i_model = FriendsModel(train_set, self.friends_data)
     return i_model
示例#5
0
import sys
sys.path.append("./src")
from similarities import CosineSimilarity, JaccardSimilarity
from dataset import get_friends_data, get_user_item_matrix
from models.friendsmodel import FriendsModel
#import matplotlib.pyplot as plt
from pylab import *

if __name__ == '__main__':
    raw_data = get_user_item_matrix()
    friend_data = get_friends_data()
    i_model = FriendsModel(raw_data, friend_data)
    data = i_model.get_data_matrix()

    figure(1)
    imshow(data,interpolation='bilinear')
    grid(True)
    show()
示例#6
0
import sys
sys.path.append("./src")
from similarities import CosineSimilarity, JaccardSimilarity
from dataset import get_friends_data, get_user_item_matrix
from models.friendsmodel import FriendsModel
#import matplotlib.pyplot as plt
from pylab import *

if __name__ == '__main__':
    raw_data = get_user_item_matrix()
    friend_data = get_friends_data()
    i_model = FriendsModel(raw_data, friend_data)
    data = i_model.get_data_matrix()

    figure(1)
    imshow(data, interpolation='bilinear')
    grid(True)
    show()