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.

865 questions
-1
votes
1 answer

gridsearchcv for random forest on sentiment analysis dataset

I am working on tuning the random forest to get different results. I got different results for svms using gridsearchcv but facing problems in getting same types of results for random forest. when I process model I got following error. > # Tuning…
user103987
  • 65
  • 2
  • 9
-1
votes
1 answer

How can I evaluate all the combinations obtained by GridSearchCV?

By using GridSearchCV I can obtain clf.cv_results_['params'] and I would like to run over all the possible combinations and printing some probabilities: for params in zip(clf.cv_results_['params']): print(params) clf= SVC(params) …
-1
votes
1 answer

Feature selection using correlation

I'm doing feature selection to train my Machine Learning (ML) models using correlation. I trained the each model(SVM, NN,RF) with all features and did a 10-fold cross validation to obtain mean accuracy score value. Then I removed features which has…
-2
votes
1 answer

How to find the best random_state value of train_test_split that gives the best score?

I made a train-test split on my data and fit a support vector machine to it. xtrain, xtest, ytrain, ytest = train_test_split(df, target) svc = svm.SVC(C=30, gamma='auto') svc.fit(xtrain,ytrain) svc.score(xtest,ytest) I am fitting the SVC model to…
-2
votes
1 answer

Is there a way two predict more than one model in GridSearchCV in sci-kit?

I am using GridSearchCV from the sk.learn library at the moment. When you call the predict method of GridSearchCV it always predicts on the test set with the best scoring estimator in the training set. However there are such problems as overfitting…
DerBenutzer
  • 311
  • 1
  • 5
  • 20
-2
votes
1 answer

Alternative to GridSearchCV for finding the parameters for SVM model

I am working on a transactional dataset where I am trying to create a churn prediction model using SVM. I have manually defined my training and testing dataset and have not used CrossValidation. However, to find the best hyperparameters for my…
Kiedi7
  • 51
  • 1
  • 8
-2
votes
1 answer

GridSearchCV on DecisionTreeClassifier

I'm trying to run a GridSearchCV over a DecisionTreeClassifier, with the only hyper-parameter being max_depth. The two versions I ran this with are: max_depth = range(1,20) The best_estimator_ attribute shows a max_depth of 15 while the scoring…
prat_pad
  • 41
  • 1
  • 2
  • 7
-3
votes
2 answers

No score method for MeanShift estimator - scikit-learn

I was trying to use GridSearch to iterate over different values of bandwidth for MeanShift algorithm and it shows this error; does any of you know how can I fix this? Thanks a lot! # Using GridSearch for Algorithm Tuning from…
-4
votes
1 answer

Very small negative mean squared error

I've been working on a house price prediction. After I've used standardscaler and gridsearch, the error turns out to be -66031776763.3788. Below is the code and the dataset. Could anyone tell me what is wrong with my code?
1 2 3
57
58