feature-selection

How to get proper feature importance information when using categorical feature in h2O

How to get proper feature importance information when using categorical feature in h2O Question: When I have categorical features in my dataset, h20 implies one-hot encoding and start the training process. When I call summary method to see the feature importance tho, it treats each encoded categorical feature as a feature. My question is that …

Total answers: 1

Run and rank all combination of features to machine learning model

Run and rank all combination of features to machine learning model Question: I have a train and test data set which contains 30 independent features and 1 target feature. All the features are numerical variables. An example of the train data set looks like. The test data set also has the same columns Target col1 …

Total answers: 1

TypeError: 'Series' object is not callable in Python?

TypeError: 'Series' object is not callable in Python? Question: I am performing model selection in Python. Unfortunately, I got error "TypeError: ‘Series’ object is not callable". I don’t understand what this means and how I could solve this issue. Any suggestions? This part of the code runs without problems: def model_selection(X, *args): # Init scores …

Total answers: 1

Recursive feature elimination (RFE) with random forest

Recursive feature elimination (RFE) with random forest Question: I want to use Recursive feature elimination (RFE) for feature selection on my datase using random forest. I came up with this code: from sklearn.feature_selection import RFE # Create the RFE object and rank each pixel clf_rf_3 = RandomForestClassifier() rfe = RFE(estimator=clf_rf_3, n_features_to_select=6, step=1) rfe = rfe.fit(X_train, …

Total answers: 1

Selecting only a certain number of top features using tsfresh

Selecting only a certain number of top features using tsfresh Question: How can I select top n features of time series using tsfresh? Can I decide the number of top features I want to extract? Asked By: Chaitra || Source Answers: Based on the above comment from @Chaitra and this answer I give an answer. …

Total answers: 1

Implementation of Okapi BM25 in python

Implementation of Okapi BM25 in python Question: I am trying to implement Okapi BM25 in python. While I have seen some tutorials how to do it, it seems I am stuck in the process. So I have collection of documents (and has as columns ‘id’ and ‘text’) and queries (and has as columns ‘id’ and …

Total answers: 2

AttributeError: 'CalibratedClassifierCV' object has no attribute 'coef_'

AttributeError: 'CalibratedClassifierCV' object has no attribute 'coef_' Question: I’m using sklearn linear implementation of SVM classifier LinearSVM. I didn’t use it directly but I wrap it with CalibratedClassifierCV to get the probabilities in the prediction time, like: model = CalibratedClassifierCV(LinearSVC(random_state=0)) After fitting the model, I tried to get the coef_ to print the Top features, …

Total answers: 2

Target transformation and feature selection in scikit-learn

Target transformation and feature selection in scikit-learn Question: I am using RFECV for feature selection in scikit-learn. I would like to compare the result of a simple linear model (X,y) with that of a log transformed model (using X, log(y)) Simple Model: RFECV and cross_val_score provide the same result (we need to compare the average …

Total answers: 2