Skip to content

Commit

Permalink
Release v0.10.0 (#1782)
Browse files Browse the repository at this point in the history
* classification checks in progress

* changelog start

* changelog and fixes

* highlights

* organising class weights
  • Loading branch information
MatthewMiddlehurst authored Jul 11, 2024
1 parent 0b52cdf commit 0ab30bf
Show file tree
Hide file tree
Showing 16 changed files with 384 additions and 66 deletions.
29 changes: 18 additions & 11 deletions .github/workflows/pr_precommit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,8 @@ jobs:
runs-on: ubuntu-20.04

steps:
- name: Create app token
uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ vars.PR_APP_ID }}
private-key: ${{ secrets.PR_APP_KEY }}

- name: Checkout
uses: actions/checkout@v4
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.head_ref }}
token: ${{ steps.app-token.outputs.token }}

- name: Setup Python 3.10
uses: actions/setup-python@v5
Expand All @@ -43,6 +32,7 @@ jobs:
- name: List changed files
run: echo '${{ steps.changed-files.outputs.all_changed_files }}'

# only check the full repository if PR and correctly labelled
- if: ${{ github.event_name == 'pull_request_target' && contains(github.event.pull_request.labels.*.name, 'full pre-commit') }}
name: Full pre-commit
uses: pre-commit/action@v3.0.1
Expand All @@ -54,6 +44,23 @@ jobs:
with:
extra_args: --files ${{ steps.changed-files.outputs.all_changed_files }}

# push fixes if pre-commit fails and PR is eligible
- if: ${{ failure() && github.event_name == 'pull_request_target' && !github.event.pull_request.draft && !contains(github.event.pull_request.labels.*.name, 'stop pre-commit fixes') }}
name: Create app token
uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ vars.PR_APP_ID }}
private-key: ${{ secrets.PR_APP_KEY }}

- if: ${{ failure() && github.event_name == 'pull_request_target' && !github.event.pull_request.draft && !contains(github.event.pull_request.labels.*.name, 'stop pre-commit fixes') }}
name: Checkout
uses: actions/checkout@v4
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.head_ref }}
token: ${{ steps.app-token.outputs.token }}

- if: ${{ failure() && github.event_name == 'pull_request_target' && !github.event.pull_request.draft && !contains(github.event.pull_request.labels.*.name, 'stop pre-commit fixes') }}
name: Push pre-commit fixes
uses: stefanzweifel/git-auto-commit-action@v5
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ We strive to provide a broad library of time series algorithms including the
latest advances, offer efficient implementations using numba, and interfaces with other
time series packages to provide a single framework for algorithm comparison.

The latest `aeon` release is `v0.9.0`. You can view the full changelog
The latest `aeon` release is `v0.10.0`. You can view the full changelog
[here](https://www.aeon-toolkit.org/en/stable/changelog.html).

Our webpage and documentation is available at https://aeon-toolkit.org.
Expand Down
2 changes: 1 addition & 1 deletion aeon/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""aeon toolkit."""

__version__ = "0.9.0"
__version__ = "0.10.0"

__all__ = ["show_versions"]

Expand Down
26 changes: 13 additions & 13 deletions aeon/classification/convolution_based/_arsenal.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,17 @@ class Arsenal(BaseClassifier):
Default of 0 means n_estimators is used.
contract_max_n_estimators : int, default=100
Max number of estimators when time_limit_in_minutes is set.
class_weight{“balanced”, “balanced_subsample”}, dict or list of dicts, default=None
From sklearn documentation:
If not given, all classes are supposed to have weight one.
The “balanced” mode uses the values of y to automatically adjust weights
inversely proportional to class frequencies in the input data as
n_samples / (n_classes * np.bincount(y))
The “balanced_subsample” mode is the same as “balanced” except that weights
are computed based on the bootstrap sample for every tree grown.
For multi-output, the weights of each column of y will be multiplied.
Note that these weights will be multiplied with sample_weight (passed through
the fit method) if sample_weight is specified.
n_jobs : int, default=1
The number of jobs to run in parallel for both `fit` and `predict`.
``-1`` means using all processors.
Expand All @@ -76,17 +87,6 @@ class Arsenal(BaseClassifier):
The collections of estimators trained in fit.
weights_ : list of shape (n_estimators) of float
Weight of each estimator in the ensemble.
class_weight{“balanced”, “balanced_subsample”}, dict or list of dicts, default=None
From sklearn documentation:
If not given, all classes are supposed to have weight one.
The “balanced” mode uses the values of y to automatically adjust weights
inversely proportional to class frequencies in the input data as
n_samples / (n_classes * np.bincount(y))
The “balanced_subsample” mode is the same as “balanced” except that weights
are computed based on the bootstrap sample for every tree grown.
For multi-output, the weights of each column of y will be multiplied.
Note that these weights will be multiplied with sample_weight (passed through
the fit method) if sample_weight is specified.
n_estimators_ : int
The number of estimators in the ensemble.
Expand Down Expand Up @@ -147,10 +147,10 @@ def __init__(
self.n_features_per_kernel = n_features_per_kernel
self.time_limit_in_minutes = time_limit_in_minutes
self.contract_max_n_estimators = contract_max_n_estimators
self.class_weight = class_weight

self.random_state = random_state
self.class_weight = class_weight
self.n_jobs = n_jobs
self.random_state = random_state

self.n_cases_ = 0
self.n_channels_ = 0
Expand Down
2 changes: 1 addition & 1 deletion aeon/classification/convolution_based/_hydra.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ class HydraClassifier(BaseClassifier):
}

def __init__(
self, n_kernels=8, n_groups=64, n_jobs=1, class_weight=None, random_state=None
self, n_kernels=8, n_groups=64, class_weight=None, n_jobs=1, random_state=None
):
self.n_kernels = n_kernels
self.n_groups = n_groups
Expand Down
2 changes: 1 addition & 1 deletion aeon/classification/convolution_based/_mr_hydra.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class MultiRocketHydraClassifier(BaseClassifier):
}

def __init__(
self, n_kernels=8, n_groups=64, n_jobs=1, class_weight=None, random_state=None
self, n_kernels=8, n_groups=64, class_weight=None, n_jobs=1, random_state=None
):
self.n_kernels = n_kernels
self.n_groups = n_groups
Expand Down
15 changes: 8 additions & 7 deletions aeon/classification/convolution_based/_rocket_classifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,14 @@ class RocketClassifier(BaseClassifier):
For multi-output, the weights of each column of y will be multiplied.
Note that these weights will be multiplied with sample_weight (passed through
the fit method) if sample_weight is specified.
n_jobs : int, default=1
The number of jobs to run in parallel for both `fit` and `predict`.
``-1`` means using all processors.
random_state : int, RandomState instance or None, default=None
If `int`, random_state is the seed used by the random number generator;
If `RandomState` instance, random_state is the random number generator;
If `None`, the random number generator is the `RandomState` instance used
by `np.random`.
n_jobs : int, default=1
The number of jobs to run in parallel for both `fit` and `predict`.
``-1`` means using all processors.
Attributes
----------
Expand Down Expand Up @@ -116,19 +116,20 @@ def __init__(
rocket_transform="rocket",
max_dilations_per_kernel=32,
n_features_per_kernel=4,
class_weight=None,
estimator=None,
random_state=None,
class_weight=None,
n_jobs=1,
random_state=None,
):
self.num_kernels = num_kernels
self.rocket_transform = rocket_transform
self.max_dilations_per_kernel = max_dilations_per_kernel
self.n_features_per_kernel = n_features_per_kernel
self.random_state = random_state
self.class_weight = class_weight
self.estimator = estimator

self.class_weight = class_weight
self.n_jobs = n_jobs
self.random_state = random_state

super().__init__()

Expand Down
7 changes: 4 additions & 3 deletions aeon/classification/dictionary_based/_muse.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,19 +162,20 @@ def __init__(
self.word_lengths = [4, 6]
self.bigrams = bigrams
self.binning_strategies = ["equi-width", "equi-depth"]
self.random_state = random_state
self.min_window = 6
self.max_window = 100
self.window_inc = window_inc
self.window_sizes = []
self.SFA_transformers = []
self.clf = None
self.n_jobs = n_jobs
self.support_probabilities = support_probabilities
self.total_features_count = 0
self.class_weight = class_weight
self.feature_selection = feature_selection

self.class_weight = class_weight
self.n_jobs = n_jobs
self.random_state = random_state

super().__init__()

def _fit(self, X, y):
Expand Down
9 changes: 6 additions & 3 deletions aeon/classification/dictionary_based/_weasel.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,10 @@ def __init__(
window_inc=2,
p_threshold=0.05,
alphabet_size=4,
n_jobs=1,
feature_selection="chi2",
support_probabilities=False,
class_weight=None,
n_jobs=1,
random_state=None,
):
self.alphabet_size = alphabet_size
Expand All @@ -158,7 +158,6 @@ def __init__(
self.word_lengths = [4, 6]
self.bigrams = bigrams
self.binning_strategy = binning_strategy
self.random_state = random_state
self.min_window = 6
self.max_window = 100
self.feature_selection = feature_selection
Expand All @@ -169,10 +168,14 @@ def __init__(
self.n_cases = 0
self.SFA_transformers = []
self.clf = None
self.n_jobs = n_jobs
self.support_probabilities = support_probabilities

self.random_state = random_state
self.n_jobs = n_jobs
self.class_weight = class_weight

set_num_threads(n_jobs)

super().__init__()

def _fit(self, X, y):
Expand Down
13 changes: 5 additions & 8 deletions aeon/classification/dictionary_based/_weasel_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,24 +138,21 @@ def __init__(
use_first_differences=(True, False),
feature_selection="chi2_top_k",
max_feature_count=30_000,
random_state=None,
class_weight=None,
n_jobs=4,
n_jobs=1,
random_state=None,
):
self.norm_options = norm_options
self.word_lengths = word_lengths

self.random_state = random_state

self.min_window = min_window

self.max_feature_count = max_feature_count
self.use_first_differences = use_first_differences
self.feature_selection = feature_selection
self.class_weight = class_weight

self.clf = None

self.class_weight = class_weight
self.n_jobs = n_jobs
self.random_state = random_state

super().__init__()

Expand Down
4 changes: 2 additions & 2 deletions aeon/classification/interval_based/_quant.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,14 +91,14 @@ def __init__(
interval_depth=6,
quantile_divisor=4,
estimator=None,
random_state=None,
class_weight=None,
random_state=None,
):
self.interval_depth = interval_depth
self.quantile_divisor = quantile_divisor
self.estimator = estimator
self.random_state = random_state
self.class_weight = class_weight
self.random_state = random_state
super().__init__()

def _fit(self, X, y):
Expand Down
9 changes: 5 additions & 4 deletions aeon/classification/shapelet_based/_rdst.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ class RDSTClassifier(BaseClassifier):
estimator : BaseEstimator or None, default=None
Base estimator for the ensemble, can be supplied a sklearn `BaseEstimator`. If
`None` a default `RidgeClassifierCV` classifier is used with standard scalling.
save_transformed_data : bool, default=False
If True, the transformed training dataset for all classifiers will be saved.
class_weight{“balanced”, “balanced_subsample”}, dict or list of dicts, default=None
Only applies if estimator is None, and the default is used.
From sklearn documentation:
Expand All @@ -78,8 +80,6 @@ class RDSTClassifier(BaseClassifier):
For multi-output, the weights of each column of y will be multiplied.
Note that these weights will be multiplied with sample_weight (passed through
the fit method) if sample_weight is specified.
save_transformed_data : bool, default=False
If True, the transformed training dataset for all classifiers will be saved.
n_jobs : int, default=1
The number of jobs to run in parallel for both ``fit`` and ``predict``.
`-1` means using all processors.
Expand Down Expand Up @@ -147,10 +147,10 @@ def __init__(
threshold_percentiles=None,
alpha_similarity: float = 0.5,
use_prime_dilations: bool = False,
distance: str = "manhattan",
estimator=None,
save_transformed_data: bool = False,
class_weight=None,
distance: str = "manhattan",
n_jobs: int = 1,
random_state: Union[int, Type[np.random.RandomState], None] = None,
) -> None:
Expand All @@ -160,12 +160,13 @@ def __init__(
self.threshold_percentiles = threshold_percentiles
self.alpha_similarity = alpha_similarity
self.use_prime_dilations = use_prime_dilations
self.class_weight = class_weight
self.distance = distance
self.estimator = estimator
self.save_transformed_data = save_transformed_data
self.class_weight = class_weight
self.random_state = random_state
self.n_jobs = n_jobs

self.transformed_data_ = []

self._transformer = None
Expand Down
16 changes: 8 additions & 8 deletions build_tools/pr_labeler.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,17 @@
title = pr.title

title_regex_to_labels = [
(r"\bENH\b", "enhancement"),
(r"\bMNT\b", "maintenance"),
(r"\bBUG\b", "bug"),
(r"\bDOC\b", "documentation"),
(r"\bREF\b", "refactor"),
(r"\bDEP\b", "deprecation"),
(r"\bGOV\b", "governance"),
(r"\benh\b", "enhancement"),
(r"\bmnt\b", "maintenance"),
(r"\bbug\b", "bug"),
(r"\bdoc\b", "documentation"),
(r"\bref\b", "refactor"),
(r"\bdep\b", "deprecation"),
(r"\bgov\b", "governance"),
]

title_labels = [
label for regex, label in title_regex_to_labels if re.search(regex, title)
label for regex, label in title_regex_to_labels if re.search(regex, title.lower())
]
title_labels_to_add = list(set(title_labels) - set(labels))

Expand Down
5 changes: 3 additions & 2 deletions docs/changelog.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
# Changelog

All notable changes to this project will be documented in this file. The format is
based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) and we adhere
based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and we adhere
to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). The source code for
all [releases](https://github.com/aeon-toolkit/aeon/releases) is available on GitHub.

To stay up-to-date with aeon releases, subscribe to aeon
To stay up to date with aeon releases, subscribe to aeon
[here](https://libraries.io/pypi/aeon) or follow us on
[Twitter](https://twitter.com/aeon_toolbox).

- [Version 0.10.0](changelogs/v0.10.md)
- [Version 0.9.0](changelogs/v0.9.md)
- [Version 0.8.0](changelogs/v0.8.md)
- [Version 0.7.0](changelogs/v0.7.md)
Expand Down
Loading

0 comments on commit 0ab30bf

Please sign in to comment.