Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ENH] add type hints to _shapelet_transform.py __init__ method #1926

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import heapq
import math
import time
from typing import Optional

import numpy as np
from joblib import Parallel, delayed
Expand Down Expand Up @@ -63,10 +64,10 @@ class RandomShapeletTransform(BaseCollectionTransformer):
Upper bound on candidate shapelet lengths. If None no max length is used.
remove_self_similar : boolean, default=True
Remove overlapping "self-similar" shapelets when merging candidate shapelets.
time_limit_in_minutes : int, default=0
time_limit_in_minutes : float, default=0.0
Time contract to limit build time in minutes, overriding n_shapelet_samples.
Default of 0 means n_shapelet_samples is used.
contract_max_n_shapelet_samples : int, default=np.inf
contract_max_n_shapelet_samples : float, default=np.inf
Max number of shapelets to extract when time_limit_in_minutes is set.
n_jobs : int, default=1
The number of jobs to run in parallel for both `fit` and `transform`.
Expand Down Expand Up @@ -151,18 +152,18 @@ class RandomShapeletTransform(BaseCollectionTransformer):

def __init__(
self,
n_shapelet_samples=10000,
max_shapelets=None,
min_shapelet_length=3,
max_shapelet_length=None,
remove_self_similar=True,
time_limit_in_minutes=0.0,
contract_max_n_shapelet_samples=np.inf,
n_jobs=1,
n_shapelet_samples: int = 10000,
max_shapelets: Optional[int] = None,
min_shapelet_length: int = 3,
max_shapelet_length: Optional[int] = None,
remove_self_similar: bool = True,
time_limit_in_minutes: float = 0.0,
contract_max_n_shapelet_samples: float = np.inf,
n_jobs: int = 1,
parallel_backend=None,
batch_size=100,
random_state=None,
):
batch_size: Optional[int] = 100,
random_state: Optional[int] = None,
) -> None:
self.n_shapelet_samples = n_shapelet_samples
self.max_shapelets = max_shapelets
self.min_shapelet_length = min_shapelet_length
Expand Down