Skip to content

Commit

Permalink
Remove get_params and set_params
Browse files Browse the repository at this point in the history
The get_params and set_params methods from the parent BaseObject class
are sufficient.
  • Loading branch information
Alex-JG3 committed Oct 18, 2023
1 parent ffde895 commit f0e392b
Showing 1 changed file with 2 additions and 43 deletions.
45 changes: 2 additions & 43 deletions sktime/annotation/ggs.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@

import logging
import math
from dataclasses import asdict, dataclass, field
from typing import Dict, List, Tuple
from dataclasses import dataclass, field
from typing import List, Tuple

import numpy as np
import numpy.typing as npt
Expand Down Expand Up @@ -529,47 +529,6 @@ def fit_predict(self, X) -> npt.ArrayLike:
"""
return self.fit(X, None).predict(X)

def get_params(self, deep: bool = True) -> Dict:
"""Return initialization parameters.
Parameters
----------
deep: bool
Dummy argument for compatibility with sklearn-api, not used.
Returns
-------
params: dict
Dictionary with the estimator's initialization parameters, with
keys being argument names and values being argument values.
"""
attrs_to_ignore = [
"change_points_",
"_intermediate_change_points",
"_intermediate_ll",
]
params = asdict(self._adaptee)
params = {
key: value for key, value in params.items() if key not in attrs_to_ignore
}
return params

def set_params(self, **parameters):
"""Set the parameters of this object.
Parameters
----------
parameters : dict
Initialization parameters for th estimator.
Returns
-------
self : reference to self (after parameters have been set)
"""
for key, value in parameters.items():
setattr(self._adaptee, key, value)
return self

def __repr__(self) -> str:
"""Return a string representation of the estimator."""
return self._adaptee.__repr__()
Expand Down

0 comments on commit f0e392b

Please sign in to comment.