8000 Changing dtypes for new_labels · scikit-learn/scikit-learn@bb8d9a6 · GitHub
[go: up one dir, main page]

Skip to content

Commit bb8d9a6

Browse files
committed
Changing dtypes for new_labels
1 parent 2d87e88 commit bb8d9a6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sklearn/preprocessing/label.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ def transform(self, y):
167167
elif self.new_labels == "nan":
168168
# Create copy of array and return
169169
y_array = np.array(y)
170-
z = np.zeros(y_array.shape)
170+
z = np.zeros(y_array.shape, dtype=float)
171171

172172
# Find entries with new labels
173173
missing_mask = np.in1d(y, diff)
@@ -180,7 +180,7 @@ def transform(self, y):
180180
elif self.new_labels == "label":
181181
# Create copy of array and return
182182
y_array = np.array(y)
183-
z = np.zeros(y_array.shape)
183+
z = np.zeros(y_array.shape, dtype=int)
184184

185185
# Find entries with new labels
186186
missing_mask = np.in1d(y, diff)

0 commit comments

Comments
 (0)
0