Skip to content

#coefficients output type #33

Description

@lokeshh

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?

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions