Pipeline with count and tfidf vectorizer produces TypeError: expected string or bytes-like object

I have a corpus like the following ‘C C C 0 0 0 X 0 1 0 0 0 0’, ‘C C C 0 0 0 X 0 1 0 0 0 0’, ‘C C C 0 0 0 X 0 1 0 0 0 0’, ‘X X X’, ‘X X X’, ‘X X X’, I would like to use count and tfidf vectorizer …

Including Scaling and PCA as parameter of GridSearchCV

I want to run a logistic regression using GridSearchCV, but I want to contrast the performance when Scaling and PCA is used, so I don’t want to use it in all cases. I basically would like to include …

sklearn.compose.make_column_transformer(): using SimpleImputer() and OneHotEncoder() in one step on one dataframe column

I have a dataframe containing a column with categorical variables, which also includes NaNs. Category 1 A 2 A 3 Na 4 B I’d like to to use sklearn.compose.make_column_transformer() to prepare the df …

Singleton array array(, dtype=object) cannot be considered a valid collection

Not sure how to fix . Any help much appreciate. I saw thi Vectorization: Not a valid collection but not sure if i understood this train = df1.iloc[:,[4,6]] target =df1.iloc[:,[0]] def train(…