Skip to content

Commit

Permalink
Merge branch 'main' into parameterise-distance
Browse files Browse the repository at this point in the history
  • Loading branch information
itsdivya1309 authored Aug 5, 2024
2 parents 5df6685 + f314320 commit da2467d
Show file tree
Hide file tree
Showing 10 changed files with 8 additions and 611 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/periodic_github_maintenace.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
private-key: ${{ secrets.PR_APP_KEY }}

- name: Stale Branches
uses: crs-k/stale-branches@v5.0.2
uses: crs-k/stale-branches@v6.0.1
with:
repo-token: ${{ steps.app-token.outputs.token }}
days-before-stale: 140
Expand Down
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ repos:
args: [ "--create", "--python-folders", "aeon" ]

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.5.5
rev: v0.5.6
hooks:
- id: ruff
args: [ "--fix"]
Expand All @@ -48,14 +48,14 @@ repos:
args: [ "--profile=black", "--multi-line=3" ]

- repo: https://github.com/pycqa/flake8
rev: 7.1.0
rev: 7.1.1
hooks:
- id: flake8
additional_dependencies: [ flake8-bugbear, flake8-print, Flake8-pyproject ]
args: [ "--max-line-length=88", "--extend-ignore=E203" ]

- repo: https://github.com/psf/black
rev: 24.4.2
rev: 24.8.0
hooks:
- id: black
language_version: python3
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import numpy as np
import pytest
from sklearn.pipeline import make_pipeline
from sklearn.preprocessing import FunctionTransformer
from sklearn.tree import DecisionTreeClassifier

from aeon.base._base import _clone_estimator
Expand All @@ -14,7 +15,6 @@
Catch22,
SevenNumberSummaryTransformer,
)
from aeon.transformations.func_transform import FunctionTransformer
from aeon.utils.numba.stats import row_mean, row_numba_min


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def test_univariate():
"""Test that the function gives appropriate error message."""
X, y = load_unit_test()
X_multivariate = X.reshape((-1, 2, 12))
clf = ProximityForest(n_trees=5, random_state=42, n_jobs=-1)
clf = ProximityForest(n_trees=5)
with pytest.raises(ValueError):
clf.fit(X_multivariate, y)

Expand All @@ -20,7 +20,7 @@ def test_proximity_forest():
"""Test the fit method of ProximityTree."""
X_train, y_train = load_unit_test()
X_test, y_test = load_unit_test(split="test")
clf = ProximityForest(n_trees=5, n_splitters=3, max_depth=4)
clf = ProximityForest(n_trees=5, n_splitters=3, max_depth=4, random_state=42)
clf.fit(X_train, y_train)
y_pred = clf.predict(X_test)
score = accuracy_score(y_test, y_pred)
Expand Down
75 changes: 0 additions & 75 deletions aeon/transformations/collection/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ class name: BaseCollectionTransformer

import numpy as np
import pandas as pd
from deprecated.sphinx import deprecated

from aeon.base import BaseCollectionEstimator
from aeon.transformations.base import BaseTransformer
Expand Down Expand Up @@ -273,80 +272,6 @@ def inverse_transform(self, X, y=None):

return Xt

# TODO: remove in v0.11.0
@deprecated(
version="0.10.0",
reason="The update method will be removed in version 0.11.0.",
category=FutureWarning,
)
@final
def update(self, X, y=None, update_params=True):
"""Update transformer with X, optionally y.
State required:
Requires state to be "fitted".
Accesses in self:
_is_fitted : must be True
fitted model attributes (ending in "_") : must be set, accessed by _update
Writes to self:
_X : set to be X, if remember_data tag is True, potentially used in _update
fitted model attributes (ending in "_") : only if update_params=True
type and nature of update are dependent on estimator
Parameters
----------
X : np.ndarray or list
Input data, any number of channels, equal length series of shape ``(
n_cases, n_channels, n_timepoints)``
or list of numpy arrays (any number of channels, unequal length series)
of shape ``[n_cases]``, 2D np.array ``(n_channels, n_timepoints_i)``,
where ``n_timepoints_i`` is length of series ``i``. Other types are
allowed and converted into one of the above.
Different estimators have different capabilities to handle different
types of input. If `self.get_tag("capability:multivariate")`` is False,
they cannot handle multivariate series. If ``self.get_tag(
"capability:unequal_length")`` is False, they cannot handle unequal
length input. In both situations, a ``ValueError`` is raised if X has a
characteristic that the estimator does not have the capability to handle.
Data to fit transform to, of valid collection type.
y : np.ndarray, default=None
1D np.array of float or str, of shape ``(n_cases)`` - class labels
(ground truth) for fitting indices corresponding to instance indices in X.
If None, no labels are used in fitting.
update_params : bool, default=True
whether the model is updated. Yes if true, if false, simply skips call.
argument exists for compatibility with forecasting module.
Returns
-------
self : a fitted instance of the estimator
"""
# check whether is fitted
self.check_is_fitted()

# if requires_y is set, y is required in fit and update
if self.get_tag("requires_y") and y is None:
raise ValueError(f"{self.__class__.__name__} requires `y` in `update`.")

# check and convert X/y
X_inner = self._preprocess_collection(X, store_metadata=False)
y_inner = y

# update memory of X, if remember_data exists and is set to True
if self.get_tag("remember_data", tag_value_default=False):
self._X = X_inner

# skip everything if update_params is False or fit_is_empty is present and True
if not update_params or self.get_tag("fit_is_empty", tag_value_default=False):
return self

self._update(X=X_inner, y=y_inner)

return self

def _fit(self, X, y=None):
"""Fit transformer to X and y.
Expand Down
223 changes: 0 additions & 223 deletions aeon/transformations/feature_selection.py

This file was deleted.

Loading

0 comments on commit da2467d

Please sign in to comment.