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
I got this error while trying to use SequentialFeatureSelector.
Could you please help take a look in the underlying codes?
Thanks a lot
sfs = SFS(LogisticRegression(), k_features=5, #number of features to select forward = True, #rolling forward selection floating=False, # No floating selection scoring='accuracy', verbose=5, cv=5 ).fit(X_train,y_train)
AttributeError Traceback (most recent call last)
Cell In[214], line 8
1 sfs = SFS(LogisticRegression(),
2 k_features=5, #number of features to select
3 forward = True, #rolling forward selection
4 # floating=False, # No floating selection
5 scoring='accuracy',
6 verbose=5,
7 cv=5
----> 8 ).fit(X_train,y_train)
File c:\Users\84393\miniconda3\envs\venv_ds\Lib\site-packages\mlxtend\feature_selection\sequential_feature_selector.py:650, in SequentialFeatureSelector.fit(self, X, y, groups, **fit_params)
648 else:
649 self.fitted = True # the completion of sequential selection process.
--> 650 self.finalize_fit()
652 return self
File c:\Users\84393\miniconda3\envs\venv_ds\Lib\site-packages\mlxtend\feature_selection\sequential_feature_selector.py:655, in SequentialFeatureSelector.finalize_fit(self)
654 def finalize_fit(self):
--> 655 max_score = np.NINF
656 for k in self.subsets_:
657 if (
658 k >= self.min_k
659 and k <= self.max_k
660 and self.subsets_[k]["avg_score"] > max_score
661 ):
File c:\Users\84393\miniconda3\envs\venv_ds\Lib\site-packages\numpy_init_.py:411, in getattr(attr)
408 raise AttributeError(former_attrs[attr])
410 if attr in expired_attributes:
--> 411 raise AttributeError(
412 f"np.{attr} was removed in the NumPy 2.0 release. "
413 f"{expired_attributes[attr]}"
414 )
416 if attr == "chararray":
417 warnings.warn(
418 "np.chararray is deprecated and will be removed from "
419 "the main namespace in the future. Use an array with a string "
420 "or bytes dtype instead.", DeprecationWarning, stacklevel=2)
AttributeError: np.NINF was removed in the NumPy 2.0 release. Use -np.inf instead.
The text was updated successfully, but these errors were encountered:
Hello,
I got this error while trying to use SequentialFeatureSelector.
Could you please help take a look in the underlying codes?
Thanks a lot
sfs = SFS(LogisticRegression(), k_features=5, #number of features to select forward = True, #rolling forward selection floating=False, # No floating selection scoring='accuracy', verbose=5, cv=5 ).fit(X_train,y_train)
AttributeError Traceback (most recent call last)
Cell In[214], line 8
1 sfs = SFS(LogisticRegression(),
2 k_features=5, #number of features to select
3 forward = True, #rolling forward selection
4 # floating=False, # No floating selection
5 scoring='accuracy',
6 verbose=5,
7 cv=5
----> 8 ).fit(X_train,y_train)
File c:\Users\84393\miniconda3\envs\venv_ds\Lib\site-packages\mlxtend\feature_selection\sequential_feature_selector.py:650, in SequentialFeatureSelector.fit(self, X, y, groups, **fit_params)
648 else:
649 self.fitted = True # the completion of sequential selection process.
--> 650 self.finalize_fit()
652 return self
File c:\Users\84393\miniconda3\envs\venv_ds\Lib\site-packages\mlxtend\feature_selection\sequential_feature_selector.py:655, in SequentialFeatureSelector.finalize_fit(self)
654 def finalize_fit(self):
--> 655 max_score = np.NINF
656 for k in self.subsets_:
657 if (
658 k >= self.min_k
659 and k <= self.max_k
660 and self.subsets_[k]["avg_score"] > max_score
661 ):
File c:\Users\84393\miniconda3\envs\venv_ds\Lib\site-packages\numpy_init_.py:411, in getattr(attr)
408 raise AttributeError(former_attrs[attr])
410 if attr in expired_attributes:
--> 411 raise AttributeError(
412 f"
np.{attr}
was removed in the NumPy 2.0 release. "413 f"{expired_attributes[attr]}"
414 )
416 if attr == "chararray":
417 warnings.warn(
418 "
np.chararray
is deprecated and will be removed from "419 "the main namespace in the future. Use an array with a string "
420 "or bytes dtype instead.", DeprecationWarning, stacklevel=2)
AttributeError:
np.NINF
was removed in the NumPy 2.0 release. Use-np.inf
instead.The text was updated successfully, but these errors were encountered: