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

Rating prediction could support writing to stdout #433

Open
jkleint opened this issue Aug 1, 2013 · 5 comments
Open

Rating prediction could support writing to stdout #433

jkleint opened this issue Aug 1, 2013 · 5 comments
Assignees
Labels

Comments

@jkleint
Copy link

jkleint commented Aug 1, 2013

When trying to use the rating prediction tool with --prediction-file=/dev/stdout, it crashes trying to seek, similar to #430.

@ghost ghost assigned zenogantner Aug 1, 2013
@zenogantner
Copy link
Owner

Works for me, did you use the latest version from GitHub?

@jkleint
Copy link
Author

jkleint commented Aug 10, 2013

I'm probably making some newbie mistake, but I can't seem to compile it from source:

Build FAILED.

Warnings:

/home/jk/software/MyMediaLite/src/MyMediaLite-nogui.sln:  warning : Failed to find project 309290e3-e52b-4e67-9f6e-2a67b5d54320
/home/jk/software/MyMediaLite/src/MyMediaLite-nogui.sln:  warning : Failed to find project 4d4feab8-30ae-449a-bed5-98074fc9bbf2
/home/jk/software/MyMediaLite/src/MyMediaLite-nogui.sln:  warning : Failed to find project c475abe7-84b0-4427-987b-b06e8548676f
/home/jk/software/MyMediaLite/src/MyMediaLite-nogui.sln:  warning : Failed to find project db4c4882-dd1d-42fb-8f23-5c269c36a0b3
/home/jk/software/MyMediaLite/src/MyMediaLite-nogui.sln:  warning : Failed to find project dfdfc30f-6bde-4d8b-bf84-ce958dd662c3

/home/jk/software/MyMediaLite/src/MyMediaLite-nogui.sln (default targets) ->
(Build target) ->
/home/jk/software/MyMediaLite/src/MyMediaLite/MyMediaLite.csproj (default targets) ->
/mnt/ebs-vol1b/mono-3.1.2/lib/mono/4.0/Microsoft.Common.targets (ResolveAssemblyReferences target) ->

        /mnt/ebs-vol1b/mono-3.1.2/lib/mono/4.0/Microsoft.Common.targets:  warning : Reference 'zlib.net, Version=1.0.3.0, Culture=neutral, PublicKeyToken=47d7877cb3620160' not resolved

/home/jk/software/MyMediaLite/src/MyMediaLite-nogui.sln (default targets) ->
(Build target) ->
/home/jk/software/MyMediaLite/src/Tests/Tests.csproj (default targets) ->
/mnt/ebs-vol1b/mono-3.1.2/lib/mono/4.0/Microsoft.Common.targets (ResolveAssemblyReferences target) ->

        /mnt/ebs-vol1b/mono-3.1.2/lib/mono/4.0/Microsoft.Common.targets:  warning : Reference 'zlib.net, Version=1.0.3.0, Culture=neutral, PublicKeyToken=47d7877cb3620160' not resolved

/home/jk/software/MyMediaLite/src/MyMediaLite-nogui.sln (default targets) ->
(Build target) ->
/home/jk/software/MyMediaLite/src/Programs/CommandLineProgram/CommandLineProgram.csproj (default targets) ->
/mnt/ebs-vol1b/mono-3.1.2/lib/mono/4.0/Microsoft.Common.targets (ResolveAssemblyReferences target) ->

        /mnt/ebs-vol1b/mono-3.1.2/lib/mono/4.0/Microsoft.Common.targets:  warning : Reference 'zlib.net, Version=1.0.3.0, Culture=neutral, PublicKeyToken=47d7877cb3620160' not resolved

Errors:

/home/jk/software/MyMediaLite/src/MyMediaLite-nogui.sln (default targets) ->
(Build target) ->
/home/jk/software/MyMediaLite/src/Tests/Tests.csproj (default targets) ->
/mnt/ebs-vol1b/mono-3.1.2/lib/mono/4.0/Microsoft.CSharp.targets (CoreCompile target) ->

        Correlation/BinaryCosineTest.cs(85,22): error CS0012: The type `System.Collections.Generic.ISet`1<T>' is defined in an assembly that is not referenced. Consider adding a reference to assembly `System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'

         8 Warning(s)
         1 Error(s)

Time Elapsed 00:00:01.0946800
make: *** [all] Error 1

Any suggestions? Thanks!

@zenogantner
Copy link
Owner

Hi, I think it would be better to open a separate ticket for this: #434

@jkleint
Copy link
Author

jkleint commented Aug 14, 2013

Works with system mono 2.10.8.1; crashes (running) with mono 3.1.2:

An exception was thrown by the type initializer for Mono.Unix.Native.Syscall  at MyMediaLite.IO.FileSystem.CreateUnixAppendStreamWriter (System.String filename) [0x00006] in /home/jk/software/MyMediaLite/src/MyMediaLite/IO/FileSystem.cs:53 
  at MyMediaLite.IO.FileSystem.CreateStreamWriter (System.String filename) [0x0001a] in /home/jk/software/MyMediaLite/src/MyMediaLite/IO/FileSystem.cs:70 
  at MyMediaLite.RatingPrediction.Extensions.WritePredictions (IRecommender recommender, IRatings ratings, System.String filename, IMapping user_mapping, IMapping item_mapping, System.String line_format, System.String header) [0x00000] in /home/jk/software/MyMediaLite/src/MyMediaLite/RatingPrediction/Extensions.cs:92 
  at RatingPrediction.<Run>m__E () [0x00000] in /home/jk/software/MyMediaLite/src/Programs/RatingPrediction/RatingPrediction.cs:327 
  at MyMediaLite.Wrap.MeasureTime (System.Action t) [0x00006] in /home/jk/software/MyMediaLite/src/MyMediaLite/Wrap.cs:31 
  at RatingPrediction.Run (System.String[] args) [0x0075b] in /home/jk/software/MyMediaLite/src/Programs/RatingPrediction/RatingPrediction.cs:326 
  at RatingPrediction.Main (System.String[] args) [0x00006] in /home/jk/software/MyMediaLite/src/Programs/RatingPrediction/RatingPrediction.cs:141 
Terminate on unhandled exception.

Maybe we could special-case the filename - to mean standard output instead? Also, I noticed now that the training status info gets written to stdout as well, mixed up with the predictions output (and there's no --quiet option or anything). Maybe that status info could go to stderr?

@jkleint jkleint closed this as completed Aug 14, 2013
@jkleint jkleint reopened this Aug 14, 2013
@zenogantner
Copy link
Owner

Interesting -- never saw such an error message before.
Could it be that this is also

So far, the library was not developed for streaming to STDOUT, that is why certain reporting stuff goes there, and lower-level debug/progress output goes to STDERR.

The library also lacks a proper logging framework, which then could be used to avoid noise on STDOUT.

Using - for STDOUT will not fix the too-much-noise problem, btw.

But we can try to explicitly write to STDOUT instead.
Will try this out on the weekend (no time before that, too much work ;-)

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

No branches or pull requests

2 participants