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
25 views

Ridge regression model creation using grid-search and cross validation

I created python code for ridge regression.For that I used cross validation and grid-search technique in together. i got output result. I want check whether my regression model building steps correct ...
3
votes
5answers
283 views

GridSearch without CV

I create a Random Forest and Gradient Boosting Regressor by using GridSearchCV. For the Gradient Boosting Regressor it takes too long for me. But i need to know which are the best Parameter for the ...
3
votes
1answer
113 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 ...
3
votes
2answers
76 views

How to yield better AUC score?

I have a dataset with 5K records and 60 features focused on binary classification. Class proportion is 33:67 Currently I am trying to increase the performance of my model which is stuck at F1-score ...
1
vote
1answer
41 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, ...
1
vote
1answer
25 views

Random Forest Model Giving Same Accuracy for different feature sets after tuning

I am having this weird issue and cannot seem to find a solution. I am trying to tune a different random forest model for every different feature-set. Basically from a given data set, I have created 3 ...
0
votes
0answers
10 views

Differnt loglikelihood values in RandomSearch/GridSearch and LDA . How to synchronize them?

I am doing a sensitivity analysis for some lda parameters in python. This is what I want to do: -Do RandomSearch to find optimal Parameters and therefore the optimal lda model. As Validation measure ...
0
votes
0answers
21 views

Workaround on using Grid Search when we have scipy.sparse.csr.csr_matrix

I am reviewing some techniques based on scikit-learn and I would like to check what are the best parameters for SVM using Grid Search. The thing is that I don't know how to use Grid Search to the ...
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 ...
0
votes
2answers
46 views

Parameters optimization algorithms in Weka

In Weka, I used the Grid and Random search parameters tuning algorithms but unfortunately, their performance (in terms of better prediction accuracy) is observed worst when we use the ML algorithms (...
1
vote
1answer
38 views

grid search - optimal weighting of classifiers

i am using three different of the shelf classifiers. it`s a three class classification task. i want to calculate the optimal weights (c1weight, c2weight, c3weight) for each classifier (real task more ...
2
votes
1answer
23 views

Confusion for considering accuracy or standard deviation in selecting the best parameters

I have a model with a various parameters to test. The size of the dataset I have is not really large (~500 documents). My issue is that when I test the parameters using 10 CV, some of them produce ...
1
vote
0answers
18 views

Minimizing overfitting when doing hyperparameter Tuning

Generaly when using Sklearn's GridSearchCV (or RandomizedGridSearchCV), we get best model with best test score even if the model overfits a little bit. How can we compute generalization error ...
2
votes
1answer
177 views

how to pass parameters over sklearn pipeline's stages?

I'm working on a deep neural model for text classification using Keras. To fine tune some hyperparameters i'm using Keras Wrappers for the Scikit-Learn API. So I builded a Sklearn Pipeline for that: <...
0
votes
1answer
74 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
44 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: ...
1
vote
2answers
48 views

ScikitLearn - RandomForestRegressor score different in and out of grid search

I am using RandomForestRegressor (scikit-learn python package). I am looking for the best values for hyperparameters ...
1
vote
1answer
150 views

Choosing weights on random forest for imbalanced data with the aim to minimize false positives

I am currently dealing with a binary classification task on imbalanced data with the following distribution: ...
1
vote
2answers
40 views

Unable to understand the usage of labels argument in sklearn.metrics.f1_score

I am trying to model a dataset with RandomForest Classifier. My dataset has 3 classes viz. A, B, C. 'A' is the negative class ...
0
votes
0answers
40 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
14 views

Heuristics, methods to speed up searches over subsets of big set (combinatorially NP hard probably)

I have a reasonable-sized set of size N (say 10 000 objects) in which I am searching for groups of compatible elements. Meaning that I have a function ...
0
votes
0answers
19 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 ...
0
votes
1answer
113 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
0answers
71 views

How to tune the parameters of ANN in R?

I tried below code where I used method as 'mxnet': classifier = train(form = Survived ~ ., data = training_set_scaled, method = 'mxnet') From this code I got ...
0
votes
1answer
177 views

How to find optimal number of trees in random forest using Grid search in R?

From below code, I am getting optimal number of mtry. What is this mtry ? and How should I find the optimal number of tree that to be assigned to Random forest algorithm so that it will give High ...
1
vote
2answers
477 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. ...
0
votes
1answer
153 views

Am I using GridSearch correctly or do I need to use all data for cross validation?

I'm working with a dataset that has 400 observations, 34 features and quite a few outliers, some of them extreme. Given the nature of my data, these need to be in the model. I started by doing a 75-...
0
votes
0answers
42 views

Reasonable hyperparameters for NuSVR?

I'm looking for reasonable hyperparameters grid for NuSVR. For now I have: ...
1
vote
1answer
67 views

When to use BayesianSearchCV and how it works?

Can somebody highlight when to use BayesianSearchCV and how it works? I have seen the implementation of same on kaggle and wanted to explore it further. Below is the link where the implementation ...
1
vote
1answer
158 views
0
votes
1answer
44 views

Is the role of the validation set in a deep learning network is only for Early Stopping?

In the "deep learning crash course" given by Leo Isikdogan in lecture 4 https://www.youtube.com/watch?v=ms-Ooh9mjiE&list=PLWKotBjTDoLj3rXBL-nEIPRN9V3a9Cx07&index=4 Overfitting, Underfitting, ...
9
votes
2answers
725 views

What is the most efficient method for hyperparameter optimization in scikit-learn?

An overview of the hyperparameter optimization process in scikit-learn is here. Exhaustive grid search will find the optimal set of hyperparameters for a model. The downside is that exhaustive grid ...
1
vote
2answers
448 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 ? ...
0
votes
1answer
20 views

How do you search a high dimensional for the global maxima using as few samples as possible?

Suppose the value at any point in the space is defined by Y = f(x1, x2 .. xk). For simplicity, we can assume that x takes only binary values. Which means that we have a total of 2^k possible values. I ...
0
votes
0answers
58 views

Long run time for grid search SARIMA

I am running a grid search for identifying the right set of params for Seasonal ARIMA, for over a 1300 training set and range for all the params being 0,1 and 2. But this process is taking over ...
0
votes
0answers
32 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 ...
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 ...
1
vote
1answer
124 views

Voting classifier using grid search for Time Series

I have three models: Arima Auto ARIMA Double Exponential Smoothing I would like to apply an ensemble method - a voting method and allow the classifier to learn weights for these three models. I ...
4
votes
4answers
553 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: ...
5
votes
4answers
783 views

Log loss vs accuracy for deciding between different learning rates?

While model tuning using cross validation and grid search I was plotting the graph of different learning rate against log loss and accuracy separately. Log loss When I used log loss as score in ...
8
votes
1answer
1k views

How to plot mean_test score and mean_train score of GridSearchCV

How to plot mean_train_score and mean_test_score values in GridSearchCV for ...
2
votes
1answer
200 views

Optimizing decision threshold on model with oversampled/imbalanced data

I'm working on developing a model with a highly imbalanced dataset (0.7% Minority class). To remedy the imbalance, I was going to oversample using algorithms from imbalanced-learn library. I had a ...
1
vote
2answers
274 views

Scikitlearn grid search random forest using oob as metric?

Have looked at data on oob but would like to use it as a metric in a grid search on a Random Forest classifier (multiclass) but doesn't seem to be a recognised scorer for the scoring parameter . I do ...
1
vote
0answers
221 views

How to perform platt scaling for hyperparameter-optimized model?

I'm using Python and have a best estimator from a grid search. Wanted to be able to calibrate the probability output accordingly, but would like to know more about implementing platt scaling. From ...
1
vote
0answers
425 views

Different values from GridSearch estimation

I am using GridSearchCV in order to find best estimator with best hiperparameters. I also want to check it once against a small portion of data used in cross ...
0
votes
1answer
3k views

GridSearch mean_test_score vs mean_train_score

I am working with scikit learn and GridSearch in order to find the best parameters in my classifiers. I have a map of different hyperparameters and I want to print out GridSearch results, but I do ...
4
votes
1answer
5k views

Why is cross-validation score so low?

I am using Scikit-Learn for this classification problem. The dataset has 3 features and 600 data points with labels. First I used Nearest Neighbor classifier. ...
8
votes
1answer
6k views

How to estimate GridSearchCV computing time?

If I know the time of a given validation with set values, can I estimate the time GridSearchCV will take for n values I want to cross-validate ?
0
votes
1answer
943 views

How to use GridSearchCV with RidgeClassifier

I'm trying to use GridSearchCV with RidgeClassifier, but I'm getting this error: My problem is regression type. IndexError: ...
3
votes
2answers
83 views

Comparison of machine learning approaches for a topic in a scientific paper

As part of my master's thesis, I have made a prediction of data with approaches of machine learning in a topic where are no papers yet. The topic is a regression problem for which several machine ...