Questions tagged [gridsearchcv]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
0answers
23 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 ...
1
vote
4answers
99 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
22 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
34 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
68 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
16 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
71 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
31 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
44 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 ...
1
vote
1answer
36 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: ...
0
votes
0answers
27 views

GridSearch on imbalanced multi-class dataset

I have an imbalanced multi-class dataset (GTSRB) and would like to use GridSearch to determine the hyperparameters for an SVM. As metric for the evaluation I chose F1 with average macro. ...
0
votes
0answers
36 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 ...
0
votes
0answers
18 views

Feature Engineering and Time calculation for grid search cv

I am new to data science and don't have model building experience. I have a dataframe with 5000 rows and 10 columns. The target column takes 1/0 as values. One feature column is ZIP Code. I converted ...
4
votes
1answer
150 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 ...
0
votes
1answer
80 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
15 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 ...
0
votes
1answer
760 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 ...
1
vote
2answers
371 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
135 views
0
votes
1answer
754 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
401 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 ? ...
4
votes
1answer
990 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: ...
0
votes
0answers
27 views

Does sklearn's gridsearchCV use the same cross validation train/test splits for evaluating each hyperparameter combination?

I couldn't find the answer on any forum in the interwebs so I hunted down the answer myself. Yes; the same train/test splits are used for each parameter combination. Here Is the relevant sklearn ...
0
votes
0answers
58 views

Time Series Split on unequal number of samples

I am trying to apply Time Series Split on my data, I have dates consisting of year and months and I want to train my data on the monthly interval, using January 2005 to train and test. Then January ...
1
vote
1answer
2k 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
516 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
1k 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
2k 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
75 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 ...
2
votes
1answer
2k 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
330 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
6k 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 ...