Skip to content
This repository has been archived by the owner on Dec 21, 2023. It is now read-only.

TCRecommender uses string keys to refer to int item IDs #832

Closed
znation opened this issue Jul 9, 2018 · 0 comments
Closed

TCRecommender uses string keys to refer to int item IDs #832

znation opened this issue Jul 9, 2018 · 0 comments
Assignees

Comments

@znation
Copy link
Contributor

znation commented Jul 9, 2018

The TCRecommender implementation always returns a dictionary with string keys, even if the model used int item IDs. So for models trained with int item IDs, the resulting Core ML model will throw (unwrapping optional nil) when accessed from Swift, since the cast to [Int64: Double] will fail.

@znation znation self-assigned this Jul 9, 2018
znation added a commit that referenced this issue Jul 9, 2018
* Use NSNumber for item IDs in TCRecommender

When the model uses int64 item IDs, we should use NSNumber as the key
type in the output dictionaries.

Fixes #832

* Remove unneeded assert statement
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant