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

Regression with categorical data and introducing formula language #51

Merged
merged 12 commits into from Sep 29, 2016

Conversation

Projects
None yet
3 participants
@lokeshh

lokeshh commented Jul 15, 2016

Introduce formula language for regression and add support for category variables.

@lokeshh lokeshh changed the title from Regression with categorical data and introducing formula language to [WIP] Regression with categorical data and introducing formula language Jul 15, 2016

@lokeshh

This comment has been minimized.

Show comment
Hide comment
@lokeshh

lokeshh Jul 15, 2016

@v0dro , @agarie , @zverok Should I write the specs in Rspec or in MiniTest which Statsample currently uses? If in the future we are going to turn to Rspec from MiniTest then its better to write the tests in Rspec now.

lokeshh commented Jul 15, 2016

@v0dro , @agarie , @zverok Should I write the specs in Rspec or in MiniTest which Statsample currently uses? If in the future we are going to turn to Rspec from MiniTest then its better to write the tests in Rspec now.

@@ -1,4 +1,5 @@
$:.unshift File.expand_path("../lib/", __FILE__)
lib_folder = File.expand_path("../lib", __FILE__)

This comment has been minimized.

@lokeshh

lokeshh Jul 15, 2016

Perhaps line 2 is not required. Any suggestions?

@lokeshh

lokeshh Jul 15, 2016

Perhaps line 2 is not required. Any suggestions?

Show outdated Hide outdated test/test_fit_model.rb
@model = Statsample::FitModel.new @formula, @df
@model.df_for_regression.vectors.to_a.sort.must_equal @vectors.sort
end

This comment has been minimized.

@lokeshh

lokeshh Jul 16, 2016

It doesn't seem to work. Giving me the following error:

  1) Error:
Statsample::FitModel#test_0001_gives correct dataframe when no interaction:
ArgumentError: comparison of Symbol with String failed
    test/test_fit_model.rb:16:in `sort'
    test/test_fit_model.rb:16:in `block (3 levels) in <main>'

1 runs, 0 assertions, 0 failures, 1 errors, 0 skips
@lokeshh

lokeshh Jul 16, 2016

It doesn't seem to work. Giving me the following error:

  1) Error:
Statsample::FitModel#test_0001_gives correct dataframe when no interaction:
ArgumentError: comparison of Symbol with String failed
    test/test_fit_model.rb:16:in `sort'
    test/test_fit_model.rb:16:in `block (3 levels) in <main>'

1 runs, 0 assertions, 0 failures, 1 errors, 0 skips

This comment has been minimized.

@lokeshh

lokeshh Jul 17, 2016

Resolved.

@lokeshh
@zverok

This comment has been minimized.

Show comment
Hide comment
@zverok

zverok Jul 17, 2016

BTW, as far as I understand, newest RSpec (3.5.0) has support for MiniTest: you can use RSpec matchers in MiniTest-tested code. Maybe this possibility could be investigated, for gradual and smooth transition.

zverok commented Jul 17, 2016

BTW, as far as I understand, newest RSpec (3.5.0) has support for MiniTest: you can use RSpec matchers in MiniTest-tested code. Maybe this possibility could be investigated, for gradual and smooth transition.

@v0dro

This comment has been minimized.

Show comment
Hide comment
@v0dro

v0dro Aug 31, 2016

Member

@lokeshh since statsample-glm's regression is slow, we'll just stick to statsample for now and think of removing regression from statsample sometime later.

Can you fix this PR so that I can merge it? Let the regression and formula language remain in statsample the way it is now.

Member

v0dro commented Aug 31, 2016

@lokeshh since statsample-glm's regression is slow, we'll just stick to statsample for now and think of removing regression from statsample sometime later.

Can you fix this PR so that I can merge it? Let the regression and formula language remain in statsample the way it is now.

@lokeshh

This comment has been minimized.

Show comment
Hide comment
@lokeshh

lokeshh Aug 31, 2016

Ok. I will finish it.

lokeshh commented Aug 31, 2016

Ok. I will finish it.

@lokeshh

This comment has been minimized.

Show comment
Hide comment
@lokeshh

lokeshh Sep 6, 2016

Hmm... its not running the Travis tests at the bottom. Any ideas why?

lokeshh commented Sep 6, 2016

Hmm... its not running the Travis tests at the bottom. Any ideas why?

@v0dro

This comment has been minimized.

Show comment
Hide comment
@v0dro

v0dro Sep 6, 2016

Member

Did you try restarting the build?

Member

v0dro commented Sep 6, 2016

Did you try restarting the build?

@lokeshh lokeshh closed this Sep 7, 2016

@lokeshh lokeshh reopened this Sep 7, 2016

@lokeshh

This comment has been minimized.

Show comment
Hide comment
@lokeshh

lokeshh Sep 7, 2016

Its working now. Thanks

lokeshh commented Sep 7, 2016

Its working now. Thanks

@v0dro

This comment has been minimized.

Show comment
Hide comment
@v0dro

v0dro Sep 7, 2016

Member

That's a weird failure lol. Can you modify the failing test and just introduce some sort of tolerance level?

Member

v0dro commented Sep 7, 2016

That's a weird failure lol. Can you modify the failing test and just introduce some sort of tolerance level?

@lokeshh

This comment has been minimized.

Show comment
Hide comment
@lokeshh

lokeshh Sep 14, 2016

This is weird. I just ran the tests in my system with Ruby 2.0 and all tests are passing.

lokeshh commented Sep 14, 2016

This is weird. I just ran the tests in my system with Ruby 2.0 and all tests are passing.

@lokeshh

This comment has been minimized.

Show comment
Hide comment
@lokeshh

lokeshh Sep 14, 2016

Tried it on another computer with Ruby 2.2.4, there also it pases all the tests. Let me run the Travis again.

lokeshh commented Sep 14, 2016

Tried it on another computer with Ruby 2.2.4, there also it pases all the tests. Let me run the Travis again.

@lokeshh lokeshh closed this Sep 14, 2016

@lokeshh lokeshh reopened this Sep 14, 2016

@lokeshh

This comment has been minimized.

Show comment
Hide comment
@lokeshh

lokeshh Sep 28, 2016

@v0dro Any idea how I may go ahead with this. The Travis is failing but the same is passing on my and some other system I tried.

lokeshh commented Sep 28, 2016

@v0dro Any idea how I may go ahead with this. The Travis is failing but the same is passing on my and some other system I tried.

@v0dro

This comment has been minimized.

Show comment
Hide comment
@v0dro

v0dro Sep 29, 2016

Member

Let me have a look hold on.

Member

v0dro commented Sep 29, 2016

Let me have a look hold on.

@v0dro

This comment has been minimized.

Show comment
Hide comment
@v0dro

v0dro Sep 29, 2016

Member

In .../statsample/test/test_factor_pa.rb:42, make a small change to the test.

Instead of having the error tolerance at 0.05, make it 0.07. I think that should resolve it.

Member

v0dro commented Sep 29, 2016

In .../statsample/test/test_factor_pa.rb:42, make a small change to the test.

Instead of having the error tolerance at 0.05, make it 0.07. I think that should resolve it.

@lokeshh

This comment has been minimized.

Show comment
Hide comment
@lokeshh

lokeshh Sep 29, 2016

Thanks! It worked 👍 This can be merged now.

lokeshh commented Sep 29, 2016

Thanks! It worked 👍 This can be merged now.

@lokeshh

This comment has been minimized.

Show comment
Hide comment
@lokeshh

lokeshh commented Sep 29, 2016

No wait.

@lokeshh lokeshh changed the title from [WIP] Regression with categorical data and introducing formula language to Regression with categorical data and introducing formula language Sep 29, 2016

@lokeshh

This comment has been minimized.

Show comment
Hide comment
@lokeshh

lokeshh Sep 29, 2016

This can be merged now.

lokeshh commented Sep 29, 2016

This can be merged now.

@v0dro v0dro merged commit 0f283e2 into SciRuby:master Sep 29, 2016

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment