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

Item recommendation could support streaming output, simple format #430

Closed
jkleint opened this issue Jul 22, 2013 · 4 comments
Closed

Item recommendation could support streaming output, simple format #430

jkleint opened this issue Jul 22, 2013 · 4 comments

Comments

@jkleint
Copy link

jkleint commented Jul 22, 2013

Being able to stream recommendations to another process would save the time required to write out and read back in large temp files. Unfortunately, the I/O routines used don't seem to support streaming writes. For example, running item_recommendation with --prediction-file=/dev/stdout crashes with The stream does not support seeking at System.IO.FileStream.SetLength in MyMediaLite.ItemRecommendation.Extensions.WritePredictions. There doesn't seem to be any need for seeking here, but I'm unfamiliar with the .NET I/O subsystem.

It would also be nice to have the output in a form that's easy to parse, say maybe one user item score triple to a line.

@ghost ghost assigned zenogantner Jul 24, 2013
@zenogantner
Copy link
Owner

Will have a look at this.

@zenogantner
Copy link
Owner

So, there is seeking, because files are not opened for appending by StreamWriter() when using the default constructor. Just opening with the append flag does not seem to work, so I created a fix that uses Mono's Unix API to open files in /dev.

Can you verify the fix, please?

Maybe we should also think about generally offering appending instead of overwriting.
What do you think?

@zenogantner
Copy link
Owner

I moved the second thing to a separate issue, closing this ticket.
Please re-open if the solution does not work for you.

@jkleint
Copy link
Author

jkleint commented Aug 1, 2013

Thanks, I will give it a try. If you can write to stdout, you can already append with the shell: >>. No need to complicate the code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants