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

#coefficients output type #33

Open
lokeshh opened this issue Jul 14, 2016 · 1 comment
Open

#coefficients output type #33

lokeshh opened this issue Jul 14, 2016 · 1 comment

Comments

@lokeshh
Copy link
Member

lokeshh commented Jul 14, 2016

I want to talk about two things:

(1). #coefficients(:hash) return vector names mapping the coefficients but the type of vector names is not preserved. They are all converted to symbols. This leads to problem in prediction as the new_data has to contain all vector names as symbols.

[6] pry(main)> x.coefficients :hash
=> {:a=>1.144620819921843,
 :b=>-0.042921191993683674,
 :"a:b"=>-0.03010679572782158,
 :constant=>4.738219960853547}

(2). #coefficients(:vector) returns a vector as follow:

=> #<Daru::Vector(4)>
                    0    1.144620819921843
                    1 -0.04292119199368367
                    2 -0.03010679572782158
                    3    4.738219960853547

The vector is not indexed by vector names which is little inconvenient.

WDYT about these two?

@v0dro
Copy link
Member

v0dro commented Jul 21, 2016

(1). #coefficients(:hash) return vector names mapping the coefficients but the type of vector names is not preserved. They are all converted to symbols. This leads to problem in prediction as the new_data has to contain all vector names as symbols.

The keys should be of the same type as the names of the vector, i.e. symbol if it's originally a symbol and something else otherwise.

(2). #coefficients(:vector) returns a vector as follow:

Yes this should be indexed on the vector names.

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