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

Unit tests and fixes for R/models.R #129

Merged
merged 11 commits into from Nov 5, 2019
Merged

Conversation

nikolase90
Copy link
Collaborator

@nikolase90 nikolase90 commented Nov 4, 2019

Summarized

  • Changes cases of 'something' to "something" in R/models.R
  • Modifies predict_model.* R/models.R so that it handles both data.frame and matrix as input.
  • Adds check for ranger. If you're passing a classification model it needs to be a probability forest (if that is not the case you'll only get predicted classes and not probabilities).
  • Adds tests in tests/testthat/test-models.R

@nikolase90 nikolase90 mentioned this pull request Nov 4, 2019
15 tasks
Copy link
Member

@martinju martinju left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is good to have.
Since we only support binary classification and not multiclass classification, we should probably have checks for that too. I.e. a stop in either the model_type (preferrably) or predict_model if a multiclass model is provided. Can you fix that?

R/models.R Outdated Show resolved Hide resolved
R/models.R Outdated Show resolved Hide resolved
@nikolase90
Copy link
Collaborator Author

This is good to have.
Since we only support binary classification and not multiclass classification, we should probably have checks for that too. I.e. a stop in either the model_type (preferrably) or predict_model if a multiclass model is provided. Can you fix that?

👍

@nikolase90
Copy link
Collaborator Author

@martinju Updated with tests for multi-classification.

Copy link
Member

@martinju martinju left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great! Just fix the typo and we are good.

R/models.R Outdated Show resolved Hide resolved
R/models.R Outdated Show resolved Hide resolved
@nikolase90
Copy link
Collaborator Author

Fixed typos with 7ed8625.

@nikolase90 nikolase90 merged commit f416669 into master Nov 5, 2019
@nikolase90 nikolase90 deleted the nikolai/tests_models branch November 5, 2019 11:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants