Explore Courses Blog Tutorials Interview Questions
0 votes
in Data Science by (18.4k points)

Here I have imported the SFS api from mlxtend which is SequentialFeatureSelector

from mlxtend.feature_selection import SequentialFeatureSelector as SFS

sfs = SFS(RandomForestClassifier(random_state=0,n_estimators=100,n_jobs=-1),k_features=6,verbose=2,cv=4,n_jobs=-1,scoring='accuracy',forward=True,floating=False).fit(x_train,y_train)

I am getting the error as shown

BrokenProcessPool: A task has failed to un-serialize. Please ensure that the arguments of the function are all pickable.

when I had used the same thing with the k_feature = 4 it gave me the features but when I used the k_feature = 6 then it is giving me an error like above.

1 Answer

0 votes
by (36.8k points)

As you are telling you are getting features when you're using the K_features as 4, but when you increase the value of your features you’re getting an error, check your attributes there may be less than 6 attributes. Since you have not mentioned the dataset size, I am assuming that there are less than 6 attributes in your dataset.

You can learn Python Data Science Course

Browse Categories