Skip to content

Update categoricaldistributions#142

Merged
pat-alt merged 4 commits intomainfrom
update-categoricaldistributions
Dec 19, 2025
Merged

Update categoricaldistributions#142
pat-alt merged 4 commits intomainfrom
update-categoricaldistributions

Conversation

@pasq-cat
Copy link
Member

@pasq-cat pasq-cat commented Dec 8, 2025

i am bit rusty on this so there may be issues (i hope not).
first thing, i had to temporarely remove TaijaData because it caused compatibility issues with the new version of CategoricalDistribution 0.2 and didn't allow me to update Laplaceredux.jl.
after this , i updated the package, used unwrap as suggested and solved a name conflict in pytorch_comparison.jl by explicitly calling LapaceRedux.Laplace instead of just using Laplace

@codecov
Copy link

codecov bot commented Dec 8, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.39%. Comparing base (cecd31b) to head (3333383).
⚠️ Report is 5 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #142   +/-   ##
=======================================
  Coverage   96.39%   96.39%           
=======================================
  Files          22       22           
  Lines         776      776           
=======================================
  Hits          748      748           
  Misses         28       28           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the CategoricalDistributions package from version 0.1.15 to 0.2.1 and makes necessary code changes to accommodate the new API. TaijaData support has been temporarily removed due to compatibility issues with the updated package. The changes include using the unwrap function for categorical data processing and resolving name conflicts by using fully qualified names for the Laplace constructor.

  • Updated CategoricalDistributions to version 0.2.1 and added unwrap calls for categorical data handling
  • Removed TaijaData dependency from test suite due to compatibility issues
  • Resolved name conflicts by using fully qualified LaplaceRedux.Laplace instead of Laplace in tests

Reviewed changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated 13 comments.

Show a summary per file
File Description
Project.toml Updated CategoricalDistributions version constraint to 0.2.1 and MLJBase to 1.11
test/Project.toml Added CategoricalDistributions dependency and removed TaijaData
test/laplace.jl Added CategoricalDistributions import and applied unwrap to categorical data
test/pytorch_comparison.jl Applied unwrap to categorical data and used fully qualified LaplaceRedux.Laplace
docs/src/tutorials/multi.qmd Applied unwrap to categorical data in tutorial examples
docs/src/tutorials/multi.md Applied unwrap to categorical data in rendered tutorial
CHANGELOG.md Documented the changes in version 1.3.0

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

CHANGELOG.md Outdated
Comment on lines 9 to 10
- temporarely removed the support to taijadata due to issues with CategoricalDistribution 0.2
- updated the package CategoricalDistribution to 0.2
Copy link

Copilot AI Dec 8, 2025

Choose a reason for hiding this comment

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

Inconsistent naming: "CategoricalDistribution" should be "CategoricalDistributions" (plural) to match the actual package name.

Suggested change
- temporarely removed the support to taijadata due to issues with CategoricalDistribution 0.2
- updated the package CategoricalDistribution to 0.2
- temporarely removed the support to taijadata due to issues with CategoricalDistributions 0.2
- updated the package CategoricalDistributions to 0.2

Copilot uses AI. Check for mistakes.
CHANGELOG.md Outdated

*Note*: We try to adhere to these practices as of version [v0.2.1].
## Version [1.3.0] - 2025-12-08
- temporarely removed the support to taijadata due to issues with CategoricalDistribution 0.2
Copy link

Copilot AI Dec 8, 2025

Choose a reason for hiding this comment

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

Grammar: The word "taijadata" should be capitalized as "TaijaData" to match the package name convention.

Suggested change
- temporarely removed the support to taijadata due to issues with CategoricalDistribution 0.2
- temporarely removed the support to TaijaData due to issues with CategoricalDistribution 0.2

Copilot uses AI. Check for mistakes.

X = hcat(x...)
y_train = Flux.onehotbatch(y, unique(y))
y_train = Flux.onehotbatch(y, unwrap.(unique(y)))
Copy link

Copilot AI Dec 8, 2025

Choose a reason for hiding this comment

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

Missing import: unwrap is used here but CategoricalDistributions is not imported in this file. Add using CategoricalDistributions to the imports at the top of the file to make unwrap available.

Copilot uses AI. Check for mistakes.
x, y = Data.toy_data_multi(seed=seed)
X = hcat(x...)
y_onehot = Flux.onehotbatch(y, unique(y))
y_onehot = Flux.onehotbatch(y, unwrap.(unique(y)))
Copy link

Copilot AI Dec 8, 2025

Choose a reason for hiding this comment

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

Missing import: unwrap is used here but CategoricalDistributions is not imported in this file. Add using CategoricalDistributions to the imports section to make unwrap available.

Copilot uses AI. Check for mistakes.
#| output: true

_labels = sort(unique(y))
_labels = sort(unwrap.(unique(y)))
Copy link

Copilot AI Dec 8, 2025

Choose a reason for hiding this comment

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

Missing import: unwrap is used here but CategoricalDistributions is not imported in this file. Add using CategoricalDistributions to the imports section to make unwrap available.

Copilot uses AI. Check for mistakes.
n_hidden = 3
D = size(X,1)
out_dim = length(unique(y))
out_dim = length(unwrap.(unique(y)))
Copy link

Copilot AI Dec 8, 2025

Choose a reason for hiding this comment

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

Missing import: unwrap is used here but CategoricalDistributions is not imported in this file. Add using CategoricalDistributions to the imports section to make unwrap available.

Copilot uses AI. Check for mistakes.

``` julia
_labels = sort(unique(y))
_labels = sort(unwrap.(unique(y)))
Copy link

Copilot AI Dec 8, 2025

Choose a reason for hiding this comment

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

Missing import: unwrap is used here but CategoricalDistributions is not imported in this file. Add using CategoricalDistributions to the imports section to make unwrap available.

Copilot uses AI. Check for mistakes.

``` julia
_labels = sort(unique(y))
_labels = sort(unwrap.(unique(y)))
Copy link

Copilot AI Dec 8, 2025

Choose a reason for hiding this comment

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

Missing import: unwrap is used here but CategoricalDistributions is not imported in this file. Add using CategoricalDistributions to the imports section to make unwrap available.

Copilot uses AI. Check for mistakes.
CHANGELOG.md Outdated

*Note*: We try to adhere to these practices as of version [v0.2.1].
## Version [1.3.0] - 2025-12-08
- temporarely removed the support to taijadata due to issues with CategoricalDistribution 0.2
Copy link

Copilot AI Dec 8, 2025

Choose a reason for hiding this comment

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

Spelling error: "temporarely" should be "temporarily".

Suggested change
- temporarely removed the support to taijadata due to issues with CategoricalDistribution 0.2
- temporarily removed the support to taijadata due to issues with CategoricalDistribution 0.2

Copilot uses AI. Check for mistakes.
CHANGELOG.md Outdated
Comment on lines 9 to 10
- temporarely removed the support to taijadata due to issues with CategoricalDistribution 0.2
- updated the package CategoricalDistribution to 0.2
Copy link

Copilot AI Dec 8, 2025

Choose a reason for hiding this comment

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

Inconsistent capitalization: "CategoricalDistribution" should be "CategoricalDistributions" (plural) to match the actual package name used elsewhere in the codebase.

Suggested change
- temporarely removed the support to taijadata due to issues with CategoricalDistribution 0.2
- updated the package CategoricalDistribution to 0.2
- temporarely removed the support to taijadata due to issues with CategoricalDistributions 0.2
- updated the package CategoricalDistributions to 0.2

Copilot uses AI. Check for mistakes.
Copy link
Member

@pat-alt pat-alt left a comment

Choose a reason for hiding this comment

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

Thanks a lot @pasq-cat

Still only have access to this from my phone but this looks good to me. I can't right now think of a good reason for why TaijaData should be a dependency anyway, though I'm guessing that this might be why docs fail (can be fixed later).

Thanks for doing!

@pat-alt pat-alt merged commit 9ad4bdc into main Dec 19, 2025
8 of 9 checks passed
@pasq-cat
Copy link
Member Author

damn, i forgot to merge? sorry patrick, when i read the message on the phone i thought you had it merged automatically and then it slipped from my mind.

@pat-alt
Copy link
Member

pat-alt commented Dec 27, 2025

No worries @pasq-cat ! Hope you've been enjoying the holiday season

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.

2 participants