-
Notifications
You must be signed in to change notification settings - Fork 9
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
Refactor some code #28
Conversation
.new(@data_set, @dependent, @opts) | ||
@regression = ['Statsample', 'GLM', algorithm, method] | ||
.reduce(Module, :const_get) | ||
.new @data_set, @dependent, @opts | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@v0dro I see your comment to remove const_get. Is there a way to do it without using const_get?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove the need of chaining basically.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the current change fine or should I change to something like Object.const_get('Daru::Vector')
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keep a single const_get
. In other words go with the SO answer.
Changed Should I add the tests? Also should I print a error message to tell that the old names will be removed? |
Aren't these the tests you're looking for? Yes print an error message into $stderr. |
I saw too that not every method is tested for every model (logistic, probit, normal etc.), and in general there is a lot of room for improvement of the tests. For example |
Ah yes there's no tests but those for logit. And new tests should be a separate commit. |
I think this is ready to be merged now. Here are the changes:
|
I had a look at some places where code can be improved while documenting the functions. This PR is for that purpose.