Skip to content

Commit

Permalink
Change scipy.sparse.csr.csr_matrix to scipy.sparse.csr_matrix
Browse files Browse the repository at this point in the history
Signed-off-by: Avi Shinnar <shinnar@us.ibm.com>
  • Loading branch information
shinnar committed Oct 25, 2022
1 parent abb4808 commit 5f30a48
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lale/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -832,7 +832,7 @@ def create_data_loader(X, y=None, batch_size=1, num_workers=0, shuffle=True):
elif isinstance(X, pd.DataFrame):
dataset = PandasTorchDataset(X, y)
collate_fn = pandas_collate_fn
elif isinstance(X, scipy.sparse.csr.csr_matrix):
elif isinstance(X, scipy.sparse.csr_matrix):
# unfortunately, NumpyTorchDataset won't accept a subclass of np.ndarray
X = X.toarray() # type: ignore
if isinstance(y, lale.datasets.data_schemas.NDArrayWithSchema):
Expand Down
4 changes: 2 additions & 2 deletions lale/lib/sklearn/one_hot_encoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# limitations under the License.

import pandas as pd
import scipy.sparse.csr
import scipy.sparse
import sklearn
import sklearn.preprocessing
from packaging import version
Expand Down Expand Up @@ -155,7 +155,7 @@ def transform(self, X):
columns = self._wrapped_model.get_feature_names_out(X.columns)
else:
columns = self._wrapped_model.get_feature_names(X.columns)
if isinstance(result, scipy.sparse.csr.csr_matrix):
if isinstance(result, scipy.sparse.csr_matrix):
result = result.toarray()
result = pd.DataFrame(data=result, index=X.index, columns=columns)
return result
Expand Down

0 comments on commit 5f30a48

Please sign in to comment.