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

rake aborted! marshal data too short #9

Open
hinagiku opened this issue Nov 6, 2014 · 1 comment
Open

rake aborted! marshal data too short #9

hinagiku opened this issue Nov 6, 2014 · 1 comment

Comments

@hinagiku
Copy link

hinagiku commented Nov 6, 2014

Hi, after i installed the gem, i got the 'marshal data too short' error when i ran any rake tasks.
The message below

rake aborted!
marshal data too short
/home/cl/.rvm/gems/ruby-2.0.0-p353@sasac_wan/gems/activesupport-4.0.2/lib/active_support/core_ext/marshal.rb:6:in load' /home/cl/.rvm/gems/ruby-2.0.0-p353@sasac_wan/gems/activesupport-4.0.2/lib/active_support/core_ext/marshal.rb:6:inload_with_autoloading'
/home/cl/.rvm/gems/ruby-2.0.0-p353@sasac_wan/gems/naive_bayes-0.0.3/lib/naive_bayes.rb:26:in load' /home/cl/.rvm/gems/ruby-2.0.0-p353@sasac_wan/gems/finmodeling-0.2.1/lib/finmodeling/has_string_classifer.rb:22:inblock in _load_vectors_and_train'
/home/cl/.rvm/gems/ruby-2.0.0-p353@sasac_wan/gems/finmodeling-0.2.1/lib/finmodeling/has_string_classifer.rb:18:in `each'

The code at naive_bayes.rb:26 is Marshal.load(data), the date is a string read from /home/cl/.finmodeling/classifiers/ai_oa.db
but this file is empty.
What can i do to fix the problem?(version:0.2.1 ubuntu14.04 ruby2.0.0)

@jimlindstrom
Copy link
Owner

Hi Liang - I'm pretty swamped by other obligations right now and am not sure I'm going to able to fix this for you quickly. But if you're motivated, I can potentially help you fix it, and would definitely accept any pull requests.

Here's my initial take:

This gem uses Bayesian classifiers to classify financial statement items (e.g., as financial assets vs. operating assets, on the balance sheet). Bayesian classifiers require training. I forget whether I pre-trained the classifiers and commited the parameters to the repo, but I kind of doubt it. My guess is there's a rakefile with a task that lets you run the trainer. And probably I have the code saving those results to somewhere in your home directory. I'm guessing the code you're running blindly assumes that training data exists and is trying to read it in.

... Let me know if that helps, and if you can figure out any way of improving the codebase so others don't run into this in the future. I'd love to merge in any PRs you can come up with to help address this.

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