-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
same recommendations to all the users #6
Comments
Here the recommender for user 35 as well as user 15 above giving same recommendation and i tested for other users ids as well the result is still the same :( Please help |
Check this screenshot @takuti |
@yestoprince Sorry for the late response. Can you first check if julia> recommend(recommender, 1, k, candidates)
2-element Array{Pair{Int64,Float64},1}:
6 => 0.0890438
2 => 0.0465087
julia> recommend(recommender, 2, k, candidates)
2-element Array{Pair{Int64,Float64},1}:
6 => 0.207168
2 => 0.108206
julia> recommend(recommender, 3, k, candidates)
2-element Array{Pair{Int64,Float64},1}:
6 => 0.0890386
2 => 0.0465061 In this case, recommender works fine, and problem is just a lack of training samples or inappropriate configuration of Also, please make sure if all users and items have at least 1 rating event. To give an example, the README example has no events for user 4 and 5: const n_user = 5
const n_item = 10
events = [Event(1, 2, 1), Event(3, 2, 1), Event(2, 6, 4)]
da = DataAccessor(events, n_user, n_item) Consequently, both prediction and recommendation results for those two users become same, because there is no chance to update their model parameters: julia> recommend(recommender, 4, k, candidates)
2-element Array{Pair{Int64,Float64},1}:
6 => 0.0643689
2 => 0.0336207
julia> recommend(recommender, 5, k, candidates)
2-element Array{Pair{Int64,Float64},1}:
6 => 0.0643689
2 => 0.0336207 Note that missing events are equally filled by Recommendation.jl/src/model/mf.jl Lines 25 to 28 in 1828df9
For further investigation, we need to take a look at your data and implementation detail of |
Ok thanks but now i moved to Python for building recommendation engine. Do you have experience in that ? i also have set of errors in that too ? |
Yes I do. As long as dataset is same, I believe you'll face the same situation. Otherwise, it's a bug of Recommendation.jl. If so, it'd be appreciated if you could report the issue. |
Feel free to reopen this issue if you have additional comments on this package. |
@takuti
I tried to build a recommendation engine using matrix factorization but after training my model i found that it is giving same recommendations to all the users is there any issue with it i followed all the instructions as per your tutorial.
can you please check my code to see is there any issue with the code ? or with your prediction method.
Thanks :)
Here is my code
`using CSV
train = CSV.read("training_data_book.csv", delim = ',', escapechar = '\' )
test = CSV.read("testing_data_book.csv", delim=',', escapechar='\')
Created dictionaries in below code for mapping the original ids with sequential ids
user_mappings = Dict{Int, Int}()
book_mappings = Dict{String, Int}()
user_counter, book_counter = 0,0
events = Event[]
for row in eachrow(train)
global user_counter, book_counter
user_id, book_id, rating = row[:UserID], row[:ISBN], row[:Rating]
haskey(user_mappings, user_id) || (user_mappings[user_id] = (user_counter += 1))
haskey(book_mappings, book_id) || (book_mappings[book_id] = (book_counter += 1))
push!(events, Event(user_mappings[user_id], book_mappings[book_id], rating))
end
Calling to data Accessor
da = DataAccessor(events, user_counter, book_counter)
recommender = MF(da, Parameters(:k => 2))
Here i build my model
build(recommender, learning_rate=15e-4, max_iter=100)
Predicting 5 recommendation of user whose sequential id is 10
for i in recommendations_to_books(recommend(recommender, 35, 10, [1:book_counter...]))
main_data[main_data.ISBN .== i, :BookTitle] |> println
end
for i in recommendations_to_books(recommend(recommender, 15, 10, [1:book_counter...]))
main_data[main_data.ISBN .== i, :BookTitle] |> println
end
`
The text was updated successfully, but these errors were encountered: