Questions tagged [grid-search]
In machine learning, grid search refers to multiple runs to find the optimal value of parameter(s)/hyperparameter(s) of a model, e.g. mtry for random-forest or alpha, beta, lambda for glm, or C, kernel and gamma for SVM.
115
questions
0
votes
0
answers
4
views
What is the standard ML pipeline for training and testing?
I have a dataframe containing 1324 rows and 28 columns and I'm kinda lost on which approach to go for when training regression models. Currently I perform a data split and run GridSearchCV to pick the ...
0
votes
1
answer
22
views
Sklearn EstimatorCV vs GridSearchCV
sklearn has the following description for EstimatorCV estimators:
https://scikit-learn.org/stable/glossary.html#term-cross-validation-estimator
An estimator that has built-in cross-validation ...
0
votes
1
answer
92
views
Test Error is extremely higher than Training error after gridsearch and crossvalidation
I'm currently working on a machine learning project. It's a supervised learning problem. My goal is to predict for given data of an animal(keeping,size,weight,...) ingredients(energy,vitamine etc..). ...
1
vote
1
answer
41
views
How are the successive sets of training samples that are allocated for each iteration of HalvingGridSearchCV determined?
The scikit-learn classes HalvingGridSearchCV and HalvingRandomSearchCV implement a hyperparameter tuning method known as successive halving. It is an iterative selection process in which all the ...
0
votes
0
answers
87
views
Hot-encoding warning when using gridsearch
I ran an experiment with the classical holdout method to predict price and hot-encoded categorical data. However, when optimising, I got the warning below even though that I ignored the unknown ...
0
votes
0
answers
38
views
Plot binary logloss of LightGBM
I implemented Gridsearch for a LightGBM, predicting a binary outcome with 33 features.
...
0
votes
1
answer
39
views
Cross validation and train_test_split
I am building a class that follows the workflow:
Model Selection and Fitting
The class accepts a list of models and their respective hyperparameter grids. It then performs a standard fitting process ...
0
votes
1
answer
456
views
Can I use GridSearchCV.best_score_ for evaluation of model performance?
Scikit-learn page on Grid Search says:
Model selection by evaluating various parameter settings can be seen
as a way to use the labeled data to “train” the parameters of the
grid.
When evaluating the ...
2
votes
0
answers
1k
views
How to do grid search for Catboost with categorical_cols
I know it's easy to do grid search for a simple Catboost model, such as in here: https://medium.com/aiplusoau/hyperparameter-tuning-a5fe69d2a6c7
by running something like
...
1
vote
2
answers
607
views
RandomizedSearchcv(n_iter=10) doesnt stop after training 10 models
I am using RandomizedSearchcv for hyperparameter optimization. When I run the model, it shows the scores for each model training. The problem is, it trains way more than 10 models when in fact I ...
0
votes
1
answer
66
views
Question about grid search and KFold
I am trying an example which I am training on a huge dataset 5M (only 4 features) rows with Cudf and CUml and I am using SGD logistic regression because I must predict if the patient if is sick or not ...
1
vote
1
answer
501
views
How to determine which combinations of parameters to include in GridSearchCV
I am using MLPClassifier from sklearn and I would like to tune it with GridSearchCV. But I don't know which set of values to include for hidden_layer_sizes, max_iter, activation, solver, etc. How can ...
0
votes
1
answer
279
views
How does GridSearchCV use Cross Validation to produce a Model's Score?
I understand Cross Validation in practice, but I'm not sure how SciKit-Learn's GridSearchCV uses it to produce an overall score/ metric for a model. For example, if ...
2
votes
2
answers
2k
views
Grid_search (RandomizedSearchCV) extremely slow with SVM (SVC)
I'm testing hyperparameters for an SVM, however, when I resort to Gridsearch or RandomizedSearchCV, I haven't been able to get a resolution, because the processing time is exceeding hours.
My dataset ...
0
votes
1
answer
121
views
HalvingGridSearchCV
Is there a way to get Feature importance from sklearn`s HalvingGridSearchCV?
For example:
Is there any way to access the feature importance? Please help me up. Thanks!
2
votes
1
answer
2k
views
Can GridSearchCV be used for unsupervised learning?
im trying to build an outlier detector to find outliers in test data. That data varies a bit (more test channels, longer/shorter testing).
First im applying the train test split because i want to use ...
0
votes
0
answers
136
views
Apply GridSearchCV for two algorithms having common hyperparameters
I am working on a regression task and using a Stacking regressor model.
...
1
vote
1
answer
775
views
Grid-search for a multi-output regression task using Scikit-learn's API
I'm trying to make a model for a multi-output regression task where $y=(y_1, y_2,..., y_n)$ is a vector rather than a single scalar. I am using Scikit-learn's ...
0
votes
2
answers
7k
views
progress bar for GridSearchCV
I am building CNN algorithm that will output some values. I am using GridSearchCV for parameters tuning and I want to implement progress bar for handling with large datasets but I do not know how to.
...
1
vote
1
answer
201
views
Grid Searching seed in randomized machine learning
I was wondering if tuning a seed with cross-validation in order to maximize the performance of an algorithm heavily based on a randomness factor is a good idea or not. I have created an Extra Tree ...
0
votes
0
answers
60
views
Implementation/Optimization of Genetic Algorithm
I have a few queries regarding my implementation of the Genetic Algorithm (GA).
I have a lot of parameters in which I have to find the best combination of these parameters to maximize the value of the ...
1
vote
1
answer
110
views
Random search grid not displaying scoring metric
I want to do a grid search of some few hyperparameters through a XGBClassifier of a binary class, but whenever i run it the score value (roc_auc) is not being ...
1
vote
1
answer
123
views
Brute-force feature selection and cross-validation
There is an existing score made of 10 parameters; each parameter is equally weighted & the total score is found by summing the score for each parameter.
I want to try to reduce the number of ...
0
votes
2
answers
2k
views
Gridsearch ValueError: Input contains infinity or a value too large for dtype('float64'). - Using Pipeline
Update: I have non NAN values so fillna is not an issue.
Clean dataset.
I'm having this error occur when I try to predict using my grid best params. I get a score when fit it onto the training data. I ...
2
votes
1
answer
459
views
Fashion MNIST: Is there an easy way to extract only 1% of the data to do a minimal gridsearch?
I am trying implement several models on the fashion-MNIST. I have imported the data according to the tf.keras tutorial:
...
0
votes
1
answer
952
views
How to loop through multiple lists/dict?
I have the following code which finds the best value of k parameter in the KNNImputer. Basically it is looping through the list ...
1
vote
3
answers
2k
views
GridSearch CV: Suitable scoring metrics for Imbalanced data sets
I am new to machine learning.
This is my $1^{st}$ machine learning project and I am working on classification on an imbalanced dataset. There are also multi-classes in the target variable.
I would ...
2
votes
1
answer
48
views
Query regarding surprising spike in accuracy of ML model
I implemented all the major ML models (Logistic Regression, Naive Bayes, SVM, KNN, Decision Tree, Random Forest, Ada Boost & XGBoost) on my dataset. My stratified cross-validation scores are ...
0
votes
2
answers
94
views
0
votes
1
answer
1k
views
Why does Light GBM model produce different results while testing?
Using the Light GBM regressor, I have trained my data and, using Grid Search, I got the best parameters, but while testing with the best parameters I am getting different results each time, which ...
0
votes
1
answer
179
views
Is Cross validation and GridSearchCV required every time we train a model?
I have a repetitive process that will build a model weekly based on the previous week's data. So while in development I tried GridSearchCV and cross-validation to ...
0
votes
1
answer
569
views
Using BERT for search engine with an Elastic Database
I want to make Documents search engine where the user will type a query and top n relevant documents should be shown.
I want to use BERT for the searching and the first question is can i use it with ...
0
votes
1
answer
26
views
Specifying parameter grid for regression model
I am working with more than one dataset. So, I have to test my Random Forest Model over 4 datasets. The parameter grid I am taking for dataset D1 is not producing good results for dataset D2 and so on....
11
votes
1
answer
8k
views
What's the default Scorer in Sci-kit learn's GridSearchCV?
Even if I don't define the scoring parameter, it scores and makes a decision for best estimator, but documentation says the default value for scoring is "None", so what is it using to score ...
0
votes
1
answer
224
views
GridSearchCV Decrease performance RF
Can Gridsearchcv params perform worst than default RF?
RF with default values performs rmse_train=4886,r^2_train=0.84, ...
0
votes
0
answers
882
views
sklearn gridsearch lasso regression: find specific number of coefficients
I am using GridSearchCV and Lasso regression in order to fit a dataset composed out of Gaussians. I keep this example similar to this tutorial.
My goal is to find the best solution with a restricted ...
2
votes
1
answer
359
views
GridSearchCV with custom tune grid
What is the best way to perform custom parameter search CV with the Scikit-learn API? I really like GridSearchCV. However for my case the param_grid parameter is ...
0
votes
1
answer
2k
views
Understand RandomizedSearchCV output
I am trying to do hyperparameter tunning for the Randomforest regression model.
I'm using RandomizedSearchCV (scikit-learn) and I defined verbose=10.
For that reason, I'm getting messaged while it's ...
0
votes
2
answers
447
views
using simple autoencoder for feature selection
I am using a simple autoencoder to extract the informative features and I have multiple Q:
I know that the features extracted will be a linear combination of the original features so I consider that ...
3
votes
2
answers
5k
views
How plot GridSearch results?
I trained an SVM model with GridSearch
...
0
votes
1
answer
1k
views
Does GridSearchCV not save the best parameters?
So I tuned the hyperparameters using GridSearchCV, fitted the model to the data, and then used best_params_. I'm just curious ...
1
vote
1
answer
357
views
small dataset CV
I have a very small dataset ( 150 records) with 20 features, trying to predict a binary outcome.
Due to the small size, i chose to do 10 CV instead of train/test as the train/test split.
I was ...
0
votes
1
answer
3k
views
How to refit GridSearchCV on Multiclass problem
I'm trying to use GridSearchCV for my Multiclass problem. For starters, wanted to test it on KNeighborsClassifier.
First, here's the code where I define the function which uses GridSearchCV:
...
2
votes
0
answers
2k
views
how to set gridsearchCV to ignore the errors
I want to use GridSearchCV in Python for my Logistic Regression model, and i want it to check combinations for every possible setting, but i get an error when there is time for penalty: l1 and solver ...
2
votes
1
answer
2k
views
how to prevent machine crash while searching for hyper parameters of XGBoost with GridSearchCV
I am searching for best hyper parameters of XGBRegressor using GridSearchCV. Here is the code:
...
0
votes
1
answer
880
views
SKLEARN GridSearchCV hinting higher accuracy than Pipeline but with same parameters as Pipeline estimators
I have pipeline estimators like this:
...
0
votes
1
answer
47
views
GridSearchCV Acting Weird [duplicate]
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 ...
3
votes
0
answers
148
views
Initial value space for Random Forest hyperparameter tuning
I'm building a Random Forest Classifier using Scikit Learn.
My problem consists in a 4 class classification task, the values are distributed as follows (after splitting my data in training set and ...
1
vote
0
answers
187
views
xgboost calibration kde plots (isotonic) not smooth
i am training my xgboost model on an imbalanced binary classification problem. It is important to me to have well calibrated probabilities so i have chosen to optimize the brier score. I then plot the ...
2
votes
2
answers
510
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 ...