Closed YiranZhang1014 closed 1 year ago
I got some new discoveries on this issue.
This problem was caused by the type of perimeters. When I imported the data form files, I needed to use str
type, for example:
model.predict(str(1), str(2))
However, when I imported the data from a DataFrame, I needed to use int
:
model.predict(1, 2)
I guess the question is when programme read a file, it regard all attribues as str
, while reading a DataFrame will regard the attributes as the original types.
when programme read a file, it regard all attribues as str, while reading a DataFrame will regard the attributes as the original types
You are correct @Alaskyed. There are more details in https://surprise.readthedocs.io/en/stable/FAQ.html#what-are-raw-and-inner-ids
Description
When importing data using DataFrame, all estimated rating equal to the mean value, not really predict the rating. But if importing the same data set from file, it works as normal.
Steps/Code to Reproduce
Expected Results
The result were different if predict each user and item.
Actual Results
But the actual result was that all predict ratings equal to the mean value (2.6)
Versions
Windows-10-10.0.22621-SP0 Python 3.8.13 (default, Mar 28 2022, 06:59:08) [MSC v.1916 64 bit (AMD64)] surprise 1.1.3