Skip to content
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

Read in dataframe instead of file #27

Closed
kenoung opened this issue May 3, 2017 · 4 comments
Closed

Read in dataframe instead of file #27

kenoung opened this issue May 3, 2017 · 4 comments

Comments

@kenoung
Copy link

kenoung commented May 3, 2017

Hi!

Are there any plans to allow reading in pandas dataframes or numpy matrices or even strings instead of files?

Thanks!
Ken

@NicolasHug
Copy link
Owner

Hi Ken,

I provided an example to read ratings from a pandas dataframe in a previous issue #20.

If there is a strong need to read ratings from different inputs I can try to work on that. May I ask how such use-cases would be useful to you? Also, what would reading ratings from still look like?

Thanks,
Nicolas

@kenoung
Copy link
Author

kenoung commented May 4, 2017

Hi thanks for the link.

I'm currently using a custom dataset that takes a random split, then trains the SVD on it. To do this, I'm getting the relevant columns then writing them to disk before providing the file path to the reader. The workflow would be slightly smoother without having to write the data to disk.

I'm currently using a pandas dataframe, so maybe a method where we could load_from_df? I'm not sure what others are using though.

Thanks for the quick response. I'm not desperate for this right now. Just pointing it out as a possible feature request.

@NicolasHug
Copy link
Owner

I see. I will add an entry to the FAQ following the main lines of #20 to build a dataset from a dataframe. As you can see it all boils down to building the raw_ratings attribute. The dummy reader object is only here to specify the rating scale.

Have you been able to work out a solution for your specific case?

Don't hesitate to come back if you need help.
Nicolas

@kenoung
Copy link
Author

kenoung commented May 5, 2017

Yup it's working now. Thanks!

Ken

@kenoung kenoung closed this as completed May 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants