From 1ff7a5cb1aa6d5e5b38d2159afd7b4036c6cef85 Mon Sep 17 00:00:00 2001 From: Adam Li Date: Wed, 8 Nov 2023 09:10:29 -0500 Subject: [PATCH] Fix typing Signed-off-by: Adam Li --- sktree/experimental/mutual_info.py | 2 +- sktree/stats/forestht.py | 2 +- sktree/stats/permutationforest.py | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/sktree/experimental/mutual_info.py b/sktree/experimental/mutual_info.py index a1820e715..85c8f0a83 100644 --- a/sktree/experimental/mutual_info.py +++ b/sktree/experimental/mutual_info.py @@ -147,7 +147,7 @@ def mutual_info_ksg( algorithm="kd_tree", n_jobs: int = -1, transform: str = "rank", - random_seed: int = None, + random_seed: Optional[int] = None, ): """Compute the generalized (conditional) mutual information KSG estimate. diff --git a/sktree/stats/forestht.py b/sktree/stats/forestht.py index 130739ace..f0518dc5e 100644 --- a/sktree/stats/forestht.py +++ b/sktree/stats/forestht.py @@ -1,4 +1,4 @@ -from typing import Optional, Callable, Tuple, Union +from typing import Callable, Optional, Tuple, Union import numpy as np from joblib import Parallel, delayed diff --git a/sktree/stats/permutationforest.py b/sktree/stats/permutationforest.py index 78a2437a4..edaa0878d 100644 --- a/sktree/stats/permutationforest.py +++ b/sktree/stats/permutationforest.py @@ -1,3 +1,5 @@ +from typing import Optional + import numpy as np from numpy.typing import ArrayLike from sklearn.base import MetaEstimatorMixin, clone, is_classifier @@ -10,7 +12,6 @@ from sktree._lib.sklearn.ensemble._forest import BaseForest, ForestClassifier, ForestRegressor from .utils import METRIC_FUNCTIONS, REGRESSOR_METRICS, _compute_null_distribution_perm -from typing import Optional class BasePermutationForest(MetaEstimatorMixin):