Questions tagged [gridsearchcv]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
1answer
26 views

GridSearchCV Acting Weird

I am using GridSearchCV to find the best combination of parameters for SVM. However, the parameters chosen by GridSeasrchCV do not seem to be the best ones. I tried some parameters randomly and they ...
0
votes
0answers
21 views

Hyper tuning reduce the accuracy score, why?

I have performed hyper tuning grid CV search on KNN model. The actual accuracy score for my KNN was accuracy of 42.31 % without performing hyper tuning. However, after performing hyper tuning, the ...
0
votes
1answer
10 views

RandomizedSearchCV() not scoring all fits

I'm experiencing an issue with a RandomizedSearchCV grid that is not able to evaluate all of the fits. 50 of the 100 fits I'm calling do not get scored (score=nan), so I'm worried I'm wasting a bunch ...
0
votes
2answers
124 views

Error in using sklearn's GridSearchCV on Word2Vec

I am using the sklearn_api of gensim to create an estimator for a Word2vec model to pass it to sklearn's gridsearch . My code is as follows : ...
2
votes
2answers
50 views

Faster grid search with small dataset to derive best params instead of full dataset?

I have a dataset of 300 000 rows and an ensemble model, which include grid search to find the best params of every algorithm. Unfortunately the grid search needs to long and I have problems to ...
0
votes
2answers
43 views

i'm using GridSearchCV to find parameter C for SVC() classifier present in sklearn.svm . I'm not getting the optimal result desired

this is a screenshot of my code. i used abc.best_estimator_ (my GridSearchCV model) to find out best results. As you can see grid has values of C=1 and C=100 along with other values. abc....
0
votes
0answers
38 views

Getting unexpected keyword error in CatBoostRegressor while using GridSearchCV

I am trying to use GridSearchCV on a CatBoostRegressor algorithm, but get some "unexpected keyword" errors on 3 different params (classes_count, auto_class_weights, and bayesian_matrix_reg) ...
1
vote
1answer
29 views

What's the difference between GridSearchCrossValidation score and score on testset?

I'm doing classification using python. I'm using the class GridSearchCV, this class has the attribute best_score_ defined as "Mean cross-validated score of the best_estimator". With this ...
0
votes
2answers
18 views

Getting lower performance metrics when using GridSearchCV

I have defined an XGBoost model and would like to tune some of its hyperparameters. I am using GridSearchCV to find the best params. However, I also tried to fit the model on the entire training ...
1
vote
2answers
45 views

How to compute AUC in gridsearchSV (multiclass problem)

I'm working on a multiclass classification problem, comparing results from SVM and Random Forest classificators. I would like to use gridsearchCV for hyperparameters tuning and find that AUC is the ...
2
votes
1answer
341 views

How is the Gridsearchcv Score calculated?

How is the score of gridsearchcv calculated? Is the score a percentage? Does this mean higher is a better? Thank you
3
votes
1answer
18 views

Do i need to use hyperparamters from Gridsearch to train on WHOLE training set to get final model?

I just want to make sure i am on the right lines so please correct me if wrong. I am testing which hyperparmets are best for logisitic regession on my data X, y where X is featrues and y is target. X, ...
0
votes
0answers
39 views

EarlyStopping in GridSearch - how to get the mean epoch after which training stopped?

is there a way to get the mean number of epochs when training stopped by EarlyStopping in GridSearch? ...
0
votes
1answer
1k views

Feature Importance from a GridSearchCV

I created a GridSearchCV for a Random Forest Regressor. Now i want to check the feature importance. I searched around and I found this ...
5
votes
1answer
58 views

Search for hyperparameters whith different features using Random Forest

I have a dataset in which I would like to perform a classification model, so I have decided to use Random Forest. The number of features that I have is approximately 200 and I would like to test which ...
1
vote
2answers
32 views

How many trees does a random forest need?

At first, I did a GridsearchCV and the best parameter is a random forest with just 100 trees. My trainset has 80.000 rows and 669 columns. My test set has 20.000 rows and 669 columns. How is it ...
4
votes
2answers
148 views

It is alright to split a GridSearchCV?

Is it ok to split a GridsearchCV? At first, I would try estimators from 100 - 300 (100 steps) for a random forest regressor and some other parameters and after that GridsearchCV I would start the ...
2
votes
1answer
38 views

Why does my GridSearcCV always break up?

My GridSearchCV for my random forest breaks up. I need to know the reason and the solution to make it work: ...
2
votes
2answers
104 views

How to plot number of Trees and OOBs score with Grid Search

I searched to find the answer but I don´t find something with Grid Search. I create a random forest and gradient boosting regressor with grid search. Now I want to make a visualization to see if the ...
2
votes
1answer
231 views

Can we apply to GridSearchCV to Logistic regression .?

When I apply GridSearchCV to my model Logistic Regression, it's continuously throwing below error. I understand that it's trying to convert string to float. But that's was my data. So how can I ...
3
votes
1answer
748 views

Is GridSearchCV in combination with ImageDataGenerator possible and recommendable?

I want to optimize some hyperparameters for a CNN architecture by using GridSearchCV (Scikit-Learn) in combination with Data Augmentation (ImageDataGenerator from Keras). However, GridSearchCV only ...
1
vote
1answer
44 views

Which combination of 3 hyperparameters to combat overfitting of a convolutional neural network?

I have a small dataset with which I want to train a CNN by using Data Augmentation. Since the CNN is overfitting due to the small data set, I would like to optimize some hyperparameters. However, ...
0
votes
0answers
199 views

Why do I have leakage while using Stratified Group K Fold?

I have the following case: Training data in the form of x, y coordinates on different frames (from a video). Based on this I computed some features, using only the training data and labels. A model is ...
4
votes
3answers
2k views

How to combine GridSearchCV with Early Stopping?

I'm a beginner in machine learning and want to train a CNN (for image recognition) with optimized hyperparameter like dropout rate, learning rate and number of epochs. The optimal hyperparameter I ...
1
vote
1answer
49 views

How to choose a model for this cross-validation curve?

I'm using GridSearchCV to tune hyperparameters for a Logistic Regression multiclass model. I read on Kaggle that you should choose the hyperparameter that results in the lowest discrepancy between ...
0
votes
1answer
67 views

What to do after GridSearchCV()?

I happily created my first NN and performed hyperparameter optimization through GridSearchCV. I just don't know what to do next. Do I have to fit it again with the ...
1
vote
2answers
538 views

Which scoring for GridSearchCV is best, when imbalanced multiclass dataset?

I have an unbalanced multiclass dataset (GTSRB) and want to optimize the hyperparameters of an SVM through GridSearchCV. I know that accuracy is not suitable for scoring in this case. Which evaluation ...
1
vote
1answer
28 views

How to print accuracy in each fold of Validation Dataset? and assign fold number to each row in the dataframe?

How to print the accuracy in each fold of a Validation Dataset ? And how can I assign the fold number to each row in the dataframe? ...
0
votes
1answer
683 views

How to choose the model parameters (RandomizedSearchCV, .GridSearchCV) or manually

Faced with the task of selecting parameters for the lightgbm model, the question accordingly arises, what is the best way to select them? I used the RandomizedSearchCV method, within 10 hours the ...
0
votes
1answer
48 views

CNN for subsets of a dataset - how to tune hyperparameters

I have a dataset and would like to train CNNs on subsets of different size of the dataset. I already have a CNN, which classifies very well if I use the entire dataset. Now the question arises if I ...
0
votes
1answer
333 views

sklearn.model_selection: GridSearchCV vs. KFold

Here is the explain of cv parameter in the sklearn.model_selection.GridSearchCV: cv : int, cross-validation generator or an iterable, optional Determines the cross-validation splitting strategy. ...
1
vote
1answer
85 views

Track underlying observation when using GridSearchCV and make_scorer

I'm doing a GridSearchCV, and I've defined a custom function (called custom_scorer below) to optimize for. So the setup is like this: ...
2
votes
1answer
137 views

SVM - Shuffle image data before GridSearchCV or not?

I have different image datasets, most of them are sorted by class, others are already mixed. For each of these data sets, I would like to train one SVM (in Python with Scikit-Learn), whereby in each ...
4
votes
1answer
408 views

How to cache GridSearchCV optimizer result in Google Colab?

I have to execute GridSearchCV() cell every time I reload the page and it takes a lot of time. Is there a caching mechanism which stores the GridSearchCV result so ...
1
vote
1answer
349 views

CNNs - Hyperparameter tuning with different training sizes of the same data set

I would like to compare how much the classification performance (test accuracy) of CNNs changes depending on the size of the data set. For this I would like to use a data set like MNIST or Fashion ...
1
vote
1answer
16 views

A doubt about the GridSearchCV function in Sklearn?

When creating different hyperparameter combinations, does the function evaluate combination 1 on the same fold as combination 2? As in, are the folds the same across combinations? I understand that ...
1
vote
1answer
3k views

GridSearchCV with MLPRegressor with Scikit learn

I'm trying to apply automatic fine tuning to a MLPRegressor with Scikit learn. After reading around, I decided to use GridSearchCV to choose the most suitable hyperparameters. Before that, I've ...
2
votes
2answers
2k views

Large negative R2 or accuracy scores for random forest with GridSearchCV but not train_test_split

I'm trying to use GridSearchCV from scikit-learn and look at the difference between train/test metrics. When I do a normal test/train split with RandomForestRegressor, the metrics are comparable. ...
1
vote
1answer
485 views

xgboost GridSearchCV take too long or does not goes to the next step

just strange ...
2
votes
1answer
1k views

XGBOOST (sklearn interface) REGRESSION error

I am trying to run a GRIDSEARCHCV (sklearn) on XGBRegressor. Documentation on the parameter says that if regression, then objective = reg:squarederror.(see https://...
1
vote
2answers
857 views

Grid search model isn't recognized as fitted for Graphviz

I find this really weird, and the code is really straight forward. What am I doing wrong ? ...
5
votes
1answer
2k views

What is GridSearchCV doing after it finishes evaluating the performance of parameter combinations that takes so long?

I'm running GridSearchCV to tune some parameters. For example: ...
2
votes
1answer
4k views

How to get mean test scores from GridSearchCV with multiple scorers - scikit-learn

I'm trying to get mean test scores from scikit-learn's GridSearchCV with multiple scorers. grid.cv_results_ displays lots of ...
4
votes
4answers
954 views

Default parameters for decision trees give better results than parameters optimised using GridsearchCV

I am using Gridsearch for a DecisionTreeClassifier predicting a binary outcome. When I run fit and predict with default parameters, I get the following results: ...
0
votes
1answer
3k views

sklearn.GridSearchCV predict method not providing the best estimate and accuracy score

I was playing around with the credit default dataset in UCI ("https://archive.ics.uci.edu/ml/machine-learning-databases/00350/default%20of%20credit%20card%20clients.xls") These are the steps i have ...
0
votes
1answer
4k views

Using GridSearchCV and a Random Forest Regressor with the same parameters gives different results

As the huge title says I'm trying to use GridSearchCV to find the best parameters for a Random Forest Regressor and I'm measuring my results with mse. ...
3
votes
2answers
100 views

Overfitted model produces similar AUC on test set, so which model do I go with?

I was trying to compare the effect of running GridSearchCV on a dataset which was oversampled prior and oversampled after the training folds are selected. The oversampling approach I used was random ...
3
votes
1answer
3k views

GridSearchCV results are different to directly applied default model (SVM)

I run a Support Vector Machines model on part of my train set with following result: ...
2
votes
1answer
544 views

Sklearn Pipelines - How to carry over PCA?

I'm developing a pipeline to fit parameters for a gradient boosting classifier while also fitting the optimum number of features in a PCA model. This is the current setup: ...
2
votes
1answer
8k views

How to set class-weight for imbalanced classes in KerasClassifier while it is used inside the GridSearchCV?

Could you please let me know how to set class-weight for imbalanced classes in KerasClassifier while it is used inside the ...