You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 27, 2024. It is now read-only.
check_is_fitted in BM25Transformer does not work well with scikit-learn 1.0.1.
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
/tmp/ipykernel_1719/4208231121.py in <module>
----> 1 X_test = bm25.fit_transform(test_corpus)
/usr/local/lib64/python3.7/site-packages/sklearn/pipeline.py in fit_transform(self, X, y, **fit_params)
432 fit_params_last_step = fit_params_steps[self.steps[-1][0]]
433 if hasattr(last_step, "fit_transform"):
--> 434 return last_step.fit_transform(Xt, y, **fit_params_last_step)
435 else:
436 return last_step.fit(Xt, y, **fit_params_last_step).transform(Xt)
/usr/local/lib64/python3.7/site-packages/sklearn/base.py in fit_transform(self, X, y, **fit_params)
845 if y is None:
846 # fit method of arity 1 (unsupervised transformation)
--> 847 return self.fit(X, **fit_params).transform(X)
848 else:
849 # fit method of arity 2 (supervised transformation)
/tmp/ipykernel_1719/3233856808.py in transform(self, X, copy)
80
81 if self.use_idf:
---> 82 check_is_fitted(self, '_idf_diag', 'idf vector is not fitted')
83
84 expected_n_features = self._idf_diag.shape[0]
TypeError: check_is_fitted() takes from 1 to 2 positional arguments but 3 were given
After changing the code to the below one, the error was resolved.
check_is_fitted(self, attributes='_idf_diag', msg='idf vector is not fitted')
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
check_is_fitted
inBM25Transformer
does not work well withscikit-learn 1.0.1
.After changing the code to the below one, the error was resolved.
The text was updated successfully, but these errors were encountered: