gridsearchcv Questions
4
I want to implement a custom loss function in scikit learn. I use the following code snippet:
def my_custom_loss_func(y_true,y_pred):
diff3=max((abs(y_true-y_pred))*y_true)
return diff3
score=m...
Carmeliacarmelina asked 19/1, 2019 at 13:47
3
Solved
Grid search is a way to find the best parameters for any model out of the combinations we specify. I have formed a grid search on my model in the below manner and wish to find best parameters ident...
Towandatoward asked 21/3, 2020 at 9:21
4
Solved
I have the following code which works normally but got a
UserWarning: One or more of the test scores are non-finite: [nan nan]
category=UserWarning
when I revised it into a more concise version (...
Centistere asked 14/3, 2021 at 1:37
3
Solved
Problem: My situation appears to be a memory leak when running gridsearchcv. This happens when I run with 1 or 32 concurrent workers (n_jobs=-1). Previously I have run this loads of times with no t...
Equator asked 25/4, 2019 at 11:21
2
Solved
Is it possible to see the progress of GridSearchCV in a Jupyter Notebook? I'm running this script in python:
param_grid = {'learning_rate': [0.05, 0.10, 0.15, 0.20, 0.25, 0.30] ,
'max_depth' : [3,...
Puppet asked 7/6, 2019 at 14:10
1
In scikit-learn 0.24.0 or above when you use either GridSearchCV or RandomizedSearchCV and set n_jobs=-1, with setting any verbose number (1, 2, 3, or 100) no progress messages gets printed. Howeve...
Pedicab asked 17/1, 2022 at 18:21
1
Solved
When faced with a large dataset, I need to spend a day using GridSearchCV() to train an SVM with the best parameters. How can I save the best estimator so that I can use this trained estimator dire...
Pottery asked 16/2, 2022 at 11:4
2
Solved
Which one among Gridsearchcv and Bayesian optimization works better for optimizing hyper parameters?
Idealistic asked 25/4, 2019 at 12:39
2
Solved
I am trying to use OnClassSVM for anomaly detection purpose and I tuned its parameters using GridSearchCV() as follows:
I have searched many sites for it including https://stackoverflow.com/ but c...
Genni asked 18/9, 2019 at 6:30
1
I am using scikit-learn library and building a pipeline from it.
This is the last (and main) part of pipeline that I build:
preprocessor_steps = [('data_transformer', data_transformer),
('reduce_d...
Setback asked 25/8, 2021 at 9:51
1
Solved
The Verbose arguement in the GridSearchCV function displays the processing steps for each execution. Las time when I used, it worked just fine. But when I ran the model today, the verbose steps are...
Reading asked 16/4, 2021 at 7:17
2
I did grid search + crossvalidation on a SVM with RBF kernel to find optimal value of parameters C and gamma using the class GridShearchCV. Now I would like to get the result in a tabular format li...
Coitus asked 13/11, 2019 at 10:57
1
My question seems to be similar to this one but there is no solid answer there.
I'm doing a multi-class multi-label classification, and for doing that I have defined my own scorers. However, in ord...
Conclave asked 22/8, 2020 at 7:28
1
Solved
I wanted to find out the correct naming convention when referring to individual preprocessor included in ColumnTransformer (which is part of a pipeline) in param_grid for grid_search.
Environment &...
Ellis asked 18/8, 2020 at 11:37
1
Consider 3 data sets train/val/test. sklearn's GridSearchCV() by default chooses the best model with the highest cross-validation score. In a real-world setting where the predictions need to be acc...
Substitutive asked 31/10, 2019 at 16:55
1
Solved
I am struggling with a machine learning project, in which I am trying to combine :
a sklearn column transform to apply different transformers to my numerical and categorical features
a pipeline t...
Perique asked 11/6, 2020 at 19:3
1
Why we should call split() function during passing StratifiedKFold() as a parameter of GridSearchCV?
What I am trying to do?
I am trying to use StratifiedKFold() in GridSearchCV().
Then, what does confuse me?
When we use K Fold Cross Validation, we just pass the number of CV inside GridSearchCV...
Fish asked 2/6, 2020 at 7:35
1
Solved
I often use GridSearchCV for hyperparameter tuning. For example, for tuning regularization parameter C in Logistic Regression. Whenever an estimator I am using has its own n_jobs parameter I am con...
Danita asked 27/5, 2020 at 11:28
2
Solved
I want to use StackingClassifier to combine some classifiers and then use GridSearchCV to optimize the parameters:
clf1 = RandomForestClassifier()
clf2 = LogisticRegression()
dt = DecisionTreeClas...
Etherize asked 10/5, 2020 at 12:22
2
Solved
I am using two estimators, Randomforest and SVM
random_forest_pipeline=Pipeline([
('vectorizer',CountVectorizer(stop_words='english')),
('random_forest',RandomForestClassifier())
])
svm_pipeli...
Djakarta asked 8/5, 2020 at 14:18
0
As you can see, I have a problem with using sklearn (lightgbm, GridSearchCV).
Please let me know how to solve this error.
My code is the following:
import lightgbm as lgb
from lightgbm.sklearn impo...
Hart asked 7/2, 2020 at 15:32
1
Solved
I am doing topic modeling using sklearn. While trying to get the log-likelihood from Grid Search output, I am getting the below error:
AttributeError: 'str' object has no attribute 'parameters'...
Photobathic asked 27/12, 2019 at 2:56
1
Solved
Thank you for answering in advance. This is my first post and I am relatively new to python, so I apologize if I have formatted something terribly.
I am trying to combine recursive feature elimina...
Presidentelect asked 12/12, 2019 at 1:42
1
tried grid.cv_results_ didnt correct problem
from sklearn.model_selection
import GridSearchCV
params = {
'decisiontreeclassifier__max_depth': [1, 2],
'pipeline-1__clf__C': [0.001, 0.1, 100.0]
}
g...
Danidania asked 5/4, 2019 at 16:26
1
Solved
I am trying to run GradientBoostingClassifier() with the help of gridsearchcv.
For every combination of parameter, I also need "Precison", "recall" and accuracy in tabular format.
Here is the code...
Parrie asked 9/11, 2019 at 17:7
1 Next >
© 2022 - 2025 — McMap. All rights reserved.