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
2
votes
1answer
31 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
1answer
27 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
0answers
50 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 ...
0
votes
1answer
36 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
2answers
33 views
0
votes
0answers
12 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 ...
0
votes
0answers
15 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 ...
0
votes
0answers
32 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 ...
0
votes
0answers
17 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- ...
0
votes
1answer
117 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
1answer
59 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
1answer
88 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
1answer
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....
0
votes
0answers
14 views

Why is GridSearch CV not loading?

Having an issue with GridSeachCV. I am using sklearn 0.24.1. It is has been stuck in "Fitting 5 folds for each of 864 candidates, totalling 4320 fits" for a long time. my dataset only ...
2
votes
1answer
615 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
1answer
165 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
0answers
276 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 ...
0
votes
0answers
20 views

Which Random Forest hyperparameters to tune with Grid Search and which are the best initial hyperparameters values?

I want to use Grid Search for finding optimal hyperpameters for Random Forest. My questions are: Which Random Forest hyperparameters are considered important for tuning? Which initial Random Forest ...
0
votes
0answers
19 views

Grid Search using strategy

What is the correct strategy of using Grid Search? Am I understand correctly that to use correctly Grid Search I should: Give Grid Search initial parameters that have wide range. For example if ...
0
votes
0answers
42 views

Cross validation with GridSearchCV or train-val-test split

I have a question regarding the CV in GridSearchCV. To test my model should I split my data into 3: training, validation, test? For easy understanding let's say my data is split into training with 60% ...
1
vote
1answer
109 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
1answer
654 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
1answer
133 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 ...
1
vote
2answers
610 views

How plot GridSearch results?

I trained an SVM model with GridSearch ...
0
votes
1answer
308 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
1answer
98 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
1answer
931 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: ...
0
votes
0answers
485 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 ...
1
vote
1answer
468 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
1answer
220 views

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

I have pipeline estimators like this: ...
0
votes
1answer
35 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 ...
2
votes
0answers
56 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
0answers
85 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
2answers
127 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
1answer
355 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 ...
3
votes
3answers
590 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 ...
2
votes
1answer
138 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. ...
3
votes
2answers
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 ...
0
votes
1answer
278 views

plot gridsearch csv results how?

how can i plot my results from gridsearch csv? ...
0
votes
1answer
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 (...
0
votes
2answers
128 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: ...
2
votes
1answer
943 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 ...
1
vote
2answers
112 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 ...
2
votes
2answers
227 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 ...
0
votes
1answer
1k 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. ...
0
votes
1answer
164 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 ...
0
votes
2answers
62 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 ...
1
vote
2answers
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: ...
3
votes
1answer
21 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, ...
1
vote
1answer
852 views

Determine model hyper-parameter values for grid search

I built machine learning model for Ridge,lasso, elastic net and linear regression, for that I used gridsearch for the parameter tuning, i want to know how give value range for **params Ridge ** below ...