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

side effects on input data frame #39

Open
agisga opened this issue Sep 13, 2016 · 0 comments
Open

side effects on input data frame #39

agisga opened this issue Sep 13, 2016 · 0 comments
Labels

Comments

@agisga
Copy link

agisga commented Sep 13, 2016

Statsample::GLM.compute unexpectedly removes the vector, that was used as the response variable, from the input data frame. Here is an example:

pry(main)> df.head
=> #<Daru::DataFrame(10x5)>
                     a          b          c          d          y
          0 0.27479519 1.80480199 -1.2751421 0.76081756          1
          1 0.17901102 0.00871009 1.76578726 0.16944012          0
          2 0.20252454 -0.3102766 0.82447408 -1.2664713          0
          3 -0.5319133 -1.0773630 0.17109189 -0.7032551          0
          4 1.45333302 -0.3011709 -1.3940893 -0.2989374          1
          5 2.06299880 -2.9378197 -0.7312268 -1.9596163          0
          6 0.74102859 0.51499638 2.05479393 -0.5436751          1
          7 -0.4118809 0.43495358 -1.1746620 1.28345001          1
          8 -0.6430840 -2.0152451 2.08489362 -1.8998193          0
          9 0.05172997 0.25161886 -0.3881732 0.03106442          1

pry(main)> opt = Statsample::GLM.compute df, :y, :logistic, algorithm: :mle

pry(main)> df.head
=> #<Daru::DataFrame(10x4)>
                     a          b          c          d
          0 0.27479519 1.80480199 -1.2751421 0.76081756
          1 0.17901102 0.00871009 1.76578726 0.16944012
          2 0.20252454 -0.3102766 0.82447408 -1.2664713
          3 -0.5319133 -1.0773630 0.17109189 -0.7032551
          4 1.45333302 -0.3011709 -1.3940893 -0.2989374
          5 2.06299880 -2.9378197 -0.7312268 -1.9596163
          6 0.74102859 0.51499638 2.05479393 -0.5436751
          7 -0.4118809 0.43495358 -1.1746620 1.28345001
          8 -0.6430840 -2.0152451 2.08489362 -1.8998193
          9 0.05172997 0.25161886 -0.3881732 0.03106442
@v0dro v0dro added the bug label Sep 20, 2016
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