Skip to content

Commit 7611491

Browse files
committed
fix: use typing module for Tuple
1 parent c797a58 commit 7611491

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

pydra_ml/tasks.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#!/usr/bin/env python
22

3+
import typing as ty
4+
35
from pydra.utils.hash import Cache, register_serializer
46
from sklearn.pipeline import Pipeline
57

@@ -100,7 +102,7 @@ def to_instance(clf_info):
100102

101103
train_index, test_index = train_test_split[split_index]
102104
y = y.ravel()
103-
if type(X[0][0]) == str:
105+
if type(X[0][0]) is str:
104106
# it's loaded as bytes, so we need to decode as utf-8
105107
X = np.array([str.encode(n[0]).decode("utf-8") for n in X])
106108
if permute:
@@ -137,7 +139,7 @@ def calc_metric(output, metrics):
137139
def get_feature_importance(
138140
*,
139141
permute: bool,
140-
model: tuple[Pipeline, list, list],
142+
model: ty.Tuple[Pipeline, list, list],
141143
gen_feature_importance: bool = True,
142144
):
143145
"""Compute feature importance for the model

0 commit comments

Comments
 (0)