88import io
99import pstats
1010import warnings
11- from typing import Any , Callable , Protocol
11+ from typing import Any , Callable , Iterator , Protocol
1212
1313import numpy as np
1414from numpy .typing import NDArray
@@ -33,6 +33,11 @@ def __setitem__(self, index: int, value: Any) -> None:
3333 Set an item in the array.
3434 """
3535
36+ def __iter__ (self ) -> Iterator [Any ]:
37+ """
38+ Iterate over the array.
39+ """
40+
3641
3742def deprecated (msg : str ) -> Callable [..., Any ]:
3843 def deprecated_func (func : Callable [..., Any ]) -> Callable [..., Any ]:
@@ -119,7 +124,6 @@ def get_params(self, deep: bool = True) -> dict[str, Any]:
119124 Get all public parameters of the object as a dictionary.
120125
121126 :param deep: A flag for returning also nested parameters.
122- :type deep: bool, optional.
123127 """
124128 params = {}
125129 for k , v in self .__dict__ .items ():
@@ -166,10 +170,8 @@ def clone(obj: Any) -> Any:
166170 Clone an estimator, returning a new one, unfitted, having the same public
167171 parameters.
168172
169- :param estimator: An estimator to be cloned.
170- :type estimator: A scikit-learn compatible estimator
173+ :param obj: An estimator to be cloned.
171174 :return: A new estimator with the same parameters.
172- :rtype: A scikit-learn compatible estimator
173175 """
174176 params = obj .get_params (deep = True )
175177 obj_noargs = type (obj )()
0 commit comments