Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

Pradyumn-cloud
Copy link
Contributor

@Pradyumn-cloud Pradyumn-cloud commented Jul 31, 2025

Fixes #8580

This pull request introduces a new feature to the IndividualBOSS classifier in the sktime library, allowing it to optionally store histograms of words during the fit process. This feature is controlled by a new parameter, store_histogram, and is accompanied by updates to the class attributes, methods, and corresponding tests.

Enhancements to IndividualBOSS:

  • New Parameter and Attribute:

    • Added the store_histogram parameter (default: False) to the __init__ method to control whether histograms of words are stored during fit. [1] [2]
    • Introduced a new attribute, histograms_, to store the word histograms for each time series instance when store_histogram is enabled. [1] [2]
  • New Method for Histogram Creation:

    • Added the _create_histograms method to generate and store histograms based on the transformed data, using the transformer's vocabulary. This method is invoked during _fit if store_histogram is True.

Unit Tests:

  • Testing store_histogram=True:

    • Added test_individual_boss_histograms to verify the type and size of the histograms_ attribute when store_histogram is enabled. It ensures that the histograms are stored as a list of dictionaries with valid keys and values.
  • Testing store_histogram=False:

    • Added test_individual_boss_no_histograms to confirm that the histograms_ attribute remains an empty list when store_histogram is disabled.Introduces the 'store_histogram' parameter to IndividualBOSS, allowing users to optionally store word histograms for each training instance. Updates the class to document and implement this feature, and adds tests to verify correct behavior when histograms are stored or omitted.
For all contributions
  • I've added myself to the list of contributors with any new badges I've earned :-)
    How to: add yourself to the all-contributors file in the sktime root directory (not the CONTRIBUTORS.md). Common badges: code - fixing a bug, or adding code logic. doc - writing or improving documentation or docstrings. bug - reporting or diagnosing a bug (get this plus code if you also fixed the bug in the PR).maintenance - CI, test framework, release.
    See here for full badge reference

Introduces the 'store_histogram' parameter to IndividualBOSS, allowing users to optionally store word histograms for each training instance. Updates the class to document and implement this feature, and adds tests to verify correct behavior when histograms are stored or omitted.
Copy link
Collaborator

@fkiraly fkiraly left a comment

Choose a reason for hiding this comment

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

Was already approved but then accidentally closed here: #8600

@fkiraly fkiraly changed the title Add optional histogram storage to IndividualBOSS [ENH] return histogram option in IndividualBOSS Aug 1, 2025
@fkiraly fkiraly merged commit 4c03b9f into sktime:main Aug 1, 2025
65 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Adding new functionality module:classification classification module: time series classification
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[ENH] Return word vocabulary/histogram when fitting IndividualBOSS
2 participants