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

initial multiclass support #191

Merged
merged 3 commits into from
Jul 9, 2024
Merged

initial multiclass support #191

merged 3 commits into from
Jul 9, 2024

Conversation

zachmayer
Copy link
Owner

Initial working version of multiclass ensembling. Work to be done:

  • predict.caretList return a matrix of probs, not a vector for the positive class.
  • predict.caretStack return a matrix of probs, not a vector for the positive class.
  • Internally, makePredObsMatrix just uses positive class probs. Make it use ALL class probs so we can do proper ensembling.
  • Fix the test to do a train/test split and make a confusion matrix

@coveralls
Copy link

Coverage Status

Coverage increased (+32.5%) to 96.934% when pulling dd523fa on multiclass into 27a4555 on master.

@dmpe
Copy link

dmpe commented Feb 4, 2018

@zachmayer still would like to see this being merged :) someday

@zachmayer
Copy link
Owner Author

Closing in favor of #260

@zachmayer zachmayer closed this Jun 21, 2024
@zachmayer zachmayer deleted the multiclass branch June 26, 2024 01:07
@zachmayer zachmayer mentioned this pull request Jul 9, 2024
4 tasks
@zachmayer
Copy link
Owner Author

rebase here: #279

@zachmayer zachmayer reopened this Jul 9, 2024
Copy link
Contributor

coderabbitai bot commented Jul 9, 2024

Walkthrough

The update encompasses several enhancements and fixes, including adjusting the order of Makefile targets to ensure operations run in a cleaner, more organized manner. Documentation within the R scripts has been corrected to accurately reference functions from the caret package. Additionally, functionality for multiclass problems has been streamlined, with associated tests improved and new ones added to ensure robust performance.

Changes

File(s) / Group Summary
Makefile Adjusted target order, added coverage target, updated .PHONY list.
R/caretEnsemble.R, R/caretList.R, man/caretList.Rd, man/metrics.Rd, man/predict.caretStack.Rd, man/varImp.caretEnsemble.Rd Updated doc comments to reference caret package functions correctly.
R/helpers_functions.R, tests/testthat/test-helper_functions.R, tests/testthat/test-multiclass.R Updated handling and tests for multiclass problems, including removing deprecated error check.
R/caretStack.R Clarified documentation to reference predict.train from caret.

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

‼️ IMPORTANT
Auto-reply has been disabled for this repository in the CodeRabbit settings. The CodeRabbit bot will not respond to your replies unless it is explicitly tagged.

  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 63602eb and b8ec20c.

Files selected for processing (12)
  • Makefile (2 hunks)
  • R/caretEnsemble.R (2 hunks)
  • R/caretList.R (1 hunks)
  • R/caretStack.R (1 hunks)
  • R/helper_functions.R (2 hunks)
  • cobertura.xml (15 hunks)
  • man/caretList.Rd (2 hunks)
  • man/metrics.Rd (1 hunks)
  • man/predict.caretStack.Rd (1 hunks)
  • man/varImp.caretEnsemble.Rd (1 hunks)
  • tests/testthat/test-helper_functions.R (1 hunks)
  • tests/testthat/test-multiclass.R (1 hunks)
Files not summarized due to errors (1)
  • cobertura.xml: Error: Message exceeds token limit
Files skipped from review due to trivial changes (6)
  • R/caretEnsemble.R
  • man/caretList.Rd
  • man/metrics.Rd
  • man/predict.caretStack.Rd
  • man/varImp.caretEnsemble.Rd
  • tests/testthat/test-multiclass.R
Additional comments not posted (9)
Makefile (2)

3-3: LGTM! Addition of the coverage target.

The addition of the coverage target is correctly implemented and follows the existing conventions in the Makefile.

Also applies to: 58-58


6-6: LGTM! Update to the all target.

Including clean and coverage in the all target is a good practice to ensure a clean build and generate coverage reports.

R/caretStack.R (1)

46-47: LGTM! Update to documentation references for predict.train.

The documentation now correctly references the caret package, ensuring accuracy.

tests/testthat/test-helper_functions.R (1)

32-32: LGTM! Removal of expect_error check.

The function check_caretList_model_types is called directly, indicating improved handling or validation. Ensure that test coverage is sufficient to verify this change.

R/helper_functions.R (1)

Line range hint 195-195:
LGTM! Removal of multiclass check.

The function check_caretList_model_types no longer checks for multiclass problems, aligning with the PR objectives of adding multiclass support. Ensure that multiclass handling is verified.

R/caretList.R (2)

160-161: Approve documentation updates.

The updates to the documentation comments correctly reference the train and trainControl functions from the caret package.

Also applies to: 165-165


Line range hint 168-219:
Verify caretList function for multiclass support.

Ensure that the caretList function correctly handles multiclass ensembling as per the new requirements. Specifically, verify that it can process and return models for multiclass problems.

cobertura.xml (2)

3-3: Verify the accuracy of the coverage data.

Ensure that the coverage data, including lines covered, lines valid, branches covered, and branches valid, is accurate and reflects the current state of the codebase.


3-3: Timestamp update.

The timestamp has been updated to reflect the current date and time.

R/helper_functions.R Show resolved Hide resolved
@zachmayer zachmayer merged commit c5c9c6f into main Jul 9, 2024
8 checks passed
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.

3 participants