Exemplo n.º 1
0
__author__ = 'SejongPark'

from chapter2 import recommendations

movies = recommendations.transform_prefs(recommendations.critics)

result1 = recommendations.top_matches(movies, 'Superman Returns')
result2 = recommendations.top_matches(movies, 'Superman Returns', 5,
                                      recommendations.sim_distance)

print(result1)
print(result2)
# coding=utf-8
__author__ = "SejongPark"

from chapter2 import recommendations


# 유클리디안 계산 결과 계산하기
print(recommendations.sim_distance(recommendations.critics, "Lisa Rose", "Gene Seymour"))

# 피어슨 결과...
print(recommendations.sim_pearson(recommendations.critics, "Lisa Rose", "Gene Seymour"))

# 평론가 순위 매기기
print(recommendations.top_matches(recommendations.critics, "Toby"))
# coding=utf-8
__author__ = 'SejongPark'

from chapter2 import recommendations

# 유클리디안 계산 결과 계산하기
print(
    recommendations.sim_distance(recommendations.critics, 'Lisa Rose',
                                 'Gene Seymour'))

# 피어슨 결과...
print(
    recommendations.sim_pearson(recommendations.critics, 'Lisa Rose',
                                'Gene Seymour'))

# 평론가 순위 매기기
print(recommendations.top_matches(recommendations.critics, 'Toby'))
__author__ = 'SejongPark'

from chapter2 import recommendations

movies = recommendations.transform_prefs(recommendations.critics)

result1 = recommendations.top_matches(movies, 'Superman Returns')
result2 = recommendations.top_matches(movies, 'Superman Returns', 5, recommendations.sim_distance)

print(result1)
print(result2)