From cbd19172c61e72d08b60274191ce1f78eb44a7aa Mon Sep 17 00:00:00 2001 From: kklein Date: Fri, 24 Feb 2023 09:17:42 +0100 Subject: [PATCH] Make check_build run through. --- mlens/externals/sklearn/type_of_target.py | 2 +- mlens/index/base.py | 2 +- mlens/testing/dummy.py | 4 ++-- mlens/visualization/var_analysis.py | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/mlens/externals/sklearn/type_of_target.py b/mlens/externals/sklearn/type_of_target.py index ab65a4f5..f99fa132 100644 --- a/mlens/externals/sklearn/type_of_target.py +++ b/mlens/externals/sklearn/type_of_target.py @@ -7,7 +7,7 @@ # License: BSD 3 clause from __future__ import division -from collections import Sequence +from collections.abc import Sequence from scipy.sparse import issparse diff --git a/mlens/index/base.py b/mlens/index/base.py index c54b1673..059d9a0b 100644 --- a/mlens/index/base.py +++ b/mlens/index/base.py @@ -80,7 +80,7 @@ def partition(n, p): >>> _partition(8, 3) array([3, 3, 2]) """ - sizes = (n // p) * np.ones(p, dtype=np.int) + sizes = (n // p) * np.ones(p, dtype=np.int32) sizes[:n % p] += 1 return sizes diff --git a/mlens/testing/dummy.py b/mlens/testing/dummy.py index a8b1848b..60ca4f67 100644 --- a/mlens/testing/dummy.py +++ b/mlens/testing/dummy.py @@ -356,7 +356,7 @@ def _folded_ests(self, X, y, subsets=1): t.sort() weights = [] - F = np.zeros((len(t), n_ests * subsets * labels), dtype=np.float) + F = np.zeros((len(t), n_ests * subsets * labels), dtype=np.float32) col_id = {} col_ass = 0 @@ -417,7 +417,7 @@ def _full_ests(self, X, y, subsets=1): indexer = self.indexer indexer.fit(X) - P = np.zeros((X.shape[0], n_ests * subsets * labels), dtype=np.float) + P = np.zeros((X.shape[0], n_ests * subsets * labels), dtype=np.float32) weights = list() col_id = {} diff --git a/mlens/visualization/var_analysis.py b/mlens/visualization/var_analysis.py index 58cbe488..99cc167c 100644 --- a/mlens/visualization/var_analysis.py +++ b/mlens/visualization/var_analysis.py @@ -79,7 +79,7 @@ def pca_comp_plot(X, y=None, figsize=(10, 8), for dim, frame in [(2, 221), (3, 223)]: - if dim is 3: + if dim == 3: # Need to specify projection subplot_kwarg = {'projection': '3d'} @@ -94,7 +94,7 @@ def pca_comp_plot(X, y=None, figsize=(10, 8), ax[-1].set_title('%s kernel, %i dims' % (kernel, dim)) # Whiten background if dim is 3 - if dim is 3: + if dim == 3: ax[-1].set_facecolor((1, 1, 1)) if show: