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.

Filter by
Sorted by
Tagged with
1 vote
1 answer
18 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 ...
user avatar
0 votes
0 answers
11 views

ANN classification

Using a small and imbalanced data set, I put the following codes before all other codes. ...
user avatar
0 votes
0 answers
11 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 ...
user avatar
1 vote
1 answer
16 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 ...
user avatar
1 vote
1 answer
31 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 ...
user avatar
  • 11
0 votes
2 answers
591 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 ...
user avatar
  • 1
2 votes
1 answer
65 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: ...
user avatar
  • 121
0 votes
1 answer
212 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 ...
user avatar
  • 1,261
1 vote
1 answer
278 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 ...
user avatar
  • 159
1 vote
1 answer
42 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 ...
user avatar
  • 239
0 votes
2 answers
47 views

GridSeachCV not performing well on ML models

...
user avatar
0 votes
0 answers
34 views

Why should I use AIC (Akaike information criterion) instead of a metric like RMSE to find the best model?

I have used this AIC metric as a way to find the best SARIMAX model using a grid search to find the values for p,d,q and P,D,Q. I did that because I saw a example of it, but in the end my RMSE result ...
user avatar
0 votes
0 answers
20 views

GridSearch where input X consists of two DataFrames

For a project where a classifier and a regressor are combined in an scikit-learn pipeline, the input variable has to be a list (or sth equivalent) of two pandas DataFrames. When it comes to ...
user avatar
  • 101
0 votes
0 answers
40 views

SVM Hyperparamter tunning using GridSearchCV

I am trying to hyper tune the Support Vector Machine classier to accurately predict classes which have higher degree of overlapping.The objective is to get the precise value of C which would be ...
user avatar
0 votes
0 answers
40 views

Selecting the best model parameters from grid search SARIMA [Time series]

I ran a manual gridsearch of SARIMA across several parameters and now I have 7875 rows of scores (RMSE, MAE, MAPE each) from it. These were the parameters (30k+ permutations) I ran a grid search over- ...
user avatar
0 votes
1 answer
270 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 ...
user avatar
0 votes
1 answer
80 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 ...
user avatar
  • 35
0 votes
1 answer
158 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 ...
user avatar
0 votes
1 answer
16 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....
user avatar
5 votes
1 answer
2k 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 ...
user avatar
0 votes
1 answer
168 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, ...
user avatar
  • 13
0 votes
0 answers
406 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 ...
user avatar
  • 1
1 vote
1 answer
191 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 ...
user avatar
  • 89
0 votes
1 answer
975 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 ...
user avatar
  • 339
0 votes
1 answer
190 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 ...
user avatar
1 vote
2 answers
1k views

How plot GridSearch results?

I trained an SVM model with GridSearch ...
user avatar
0 votes
1 answer
543 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 ...
user avatar
  • 3
1 vote
1 answer
126 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 ...
user avatar
0 votes
1 answer
1k 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: ...
user avatar
  • 1
1 vote
0 answers
862 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 ...
user avatar
  • 23
1 vote
1 answer
688 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: ...
user avatar
0 votes
1 answer
375 views

SKLEARN GridSearchCV hinting higher accuracy than Pipeline but with same parameters as Pipeline estimators

I have pipeline estimators like this: ...
user avatar
  • 133
0 votes
1 answer
38 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 ...
user avatar
  • 63
2 votes
0 answers
80 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 ...
user avatar
1 vote
0 answers
102 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 ...
user avatar
  • 466
2 votes
2 answers
184 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 ...
user avatar
  • 329
0 votes
1 answer
584 views

MLP classifier Gridsearch CV parameters to tune?

I'm looking to tune the parameters for sklearn's MLP classifier but don't know which to tune/how many options to give them? Example is learning rate. should i give it[.0001,.001,.01,.1,.2,.3]? or is ...
user avatar
3 votes
3 answers
1k 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 ...
user avatar
  • 131
2 votes
1 answer
210 views

why does my calibration curve for platts and isotonic have less points than my uncalibrated model?

i train a model using grid search then i use the best parameters from this to define my chosen model. ...
user avatar
  • 466
3 votes
2 answers
1k views

When using Scikit Learn Grid Search, why are my train and cv scores high, but my test score is a lot lower?

I'm using scikit learn to run some models, and am very confused as to why my test score is so much lower than my cv score and my train score. At the start, I do a 80-20 train-test split. On the train ...
user avatar
  • 31
0 votes
1 answer
412 views

plot gridsearch csv results how?

how can i plot my results from gridsearch csv? ...
user avatar
  • 466
0 votes
1 answer
1k views

XGBoost Log Loss different from GridSearchCV Log Loss

I have a classification problem where I am trying to predict if the data returns a 1 or 0. So your classic binary classification. I have my set of data that I have split into the dependent variables (...
user avatar
0 votes
2 answers
281 views

Error when trying to run RandomForestClassifer with Pipieline and GridSearch [closed]

I am trying to run a RandomForest Classifier using Pipeline, GridSerach and CV I am getting an error when I fit the data. I am not sure how to fix it. Will appreciate any help on this. My code is: ...
user avatar
  • 243
2 votes
1 answer
1k views

my xgboost model accuracy decreases after grid search with [duplicate]

I tried grid search for hyperparameter tuning in XGBoost classifier but the best accuracy is less than the accuracy without any tuning ...
user avatar
1 vote
2 answers
158 views

is this grid search methodology correct?

I have some data say 1 million rows, I then put 200k aside (to validate against) and call this remaining 800,000 the training set (X) as you see below, so it is not the entire data and the remaining ...
user avatar
  • 466
2 votes
2 answers
284 views

What is the purpose of a confusion matrix in a classification problem?

I am studying machine learning. After some research I understood that a typical workflow for a classification problem (after having prepared the data) is the following: Split data in test, train and ...
user avatar
0 votes
1 answer
2k views

plotting a decision tree based on gridsearchcv

i was trying to plot the decision tree which is formed with GridSearchCV, but its giving me an Attribute error. ...
user avatar
  • 165
0 votes
1 answer
208 views

Getting a best k in KNN Algorithm

So, i was learning the KNN Algorithm and there i learnt cross Validation to find a optimal value of k.Now i want to apply grid search to get the optimal value.I found an answer on stack overflow where ...
user avatar
  • 165
0 votes
2 answers
70 views

How to choose the best hyper-parameter when it is directly influenced by the random_state?

While trying to evaluate my Ridge Regression model and using GridSearchCV to find the best parameter. I noticed that the best estimator changes every time I change the ...
user avatar
1 vote
2 answers
1k views

Python and GridSearchCV how to eliminate input contains NaN error when using cross validation and decision tree classifier?

I am trying to do cross validation on Decision tree classifier for kaggle's titanic dataset. The first step after cleaning data is to split into train and test sets: ...
user avatar
  • 163