← Back to all sparks
T

themis

ANALYTICS
Velocity2.5

Recipe steps for dealing with unbalanced data in R classification models

themis is back to adding real resampling algorithms after a documentation-heavy stretch.

rtidymodelsclass-imbalanceresamplingmachine-learning
Current state
themis supplies recipes steps for handling class imbalance in tidymodels. The 1.0.x line was consumed by documentation accuracy, message translation and internal consistency work. Version 1.1.0 returns to substance with two new under-sampling methods.
Where it's heading
The package grows by adding algorithms rather than restructuring itself. tomek() was rewritten to handle multiple classes and drop the unbalanced dependency, case weights arrived at 1.0.0, and cluster-centroid and condensed-nearest-neighbour under-sampling arrive now — each shipped as both a recipes step and a direct-implementation function.
Prediction
Expect further under- and over-sampling methods in the same paired form, as the package fills out coverage of the standard class-imbalance literature.

Recent moves

  1. 10d ago

    themis 1.1.0 adds cluster-centroid and CNN under-sampling

    Two new under-sampling steps land together: step_cluster_centroids() runs k-means within each majority class and keeps one representative per cluster, either the centroid or its nearest observation, and step_cnn() adds condensed nearest neighbour. Both follow the package's convention of a recipes step plus a standalone function.

    View source ↗
  2. 1y ago

    themis 1.0.3 corrects resampling direction in documentation

    Documentation accuracy work — correcting majority-to-minority direction, routing tidy method help to the right topic, describing return values properly — plus message translation. No behavioural change.

    View source ↗
  3. 2y ago

    themis 1.0.2 makes internal consistency and speed changes

    Internal consistency changes with slight speed gains, described in a single line. Nothing users would notice beyond marginally faster steps.

    View source ↗
  4. 3y ago

    themis 1.0.1 fixes upsampling errors when none is needed

    Fixes upsampling functions erroring when no upsampling was actually needed, and documents which step arguments are tunable. Small but the error case would have broken pipelines on already-balanced data.

    View source ↗
  5. 4y ago

    themis 1.0.0 adds case weights to up- and down-sampling

    Case weights support arrives for step_upsample() and step_downsample(), aligning themis with the case-weight capability tidymodels was adding across the board at the time.

    View source ↗
  6. 4y ago

    themis 0.2.2 rewrites tomek() for multiclass, drops a dependency

    tomek() is added and rewritten to apply across multiple classes, which removes the unbalanced package as a dependency entirely. A reimplementation that buys both wider applicability and a lighter dependency tree.

    View source ↗