gridsearchcv

Attempting to fit a grid estimator, recieving TypeError : '<' not supported between instances of 'str' and 'int'

给你一囗甜甜゛ 提交于 2021-02-11 12:20:28
问题 I've been attempting to fit a Grid Search K Nearest neighbors Classifier, but am receiving the following Error message TypeError : '<' not supported between instances of 'str' and 'int' X_train compact sa area roofM3 h o glaz glazing_area_distribution 0 0.66 759.5 318.5 220.50 3.5 2 0.40 3 1 0.76 661.5 416.5 122.50 7.0 3 0.10 1 2 0.66 759.5 318.5 220.50 3.5 3 0.10 1 3 0.74 686.0 245.0 220.50 3.5 5 0.10 4 4 0.64 784.0 343.0 220.50 3.5 2 0.40 4 ... ... ... ... ... ... ... ... ... 609 0.98 514.5

Parameters are not going to custom estimator in scikit-learn GridSearchCV

醉酒当歌 提交于 2021-01-19 06:47:35
问题 I'm trying and failing to pass parameters to a custom estimator in scikit learn. I'd like the parameter lr to change during the gridsearch. Problem is that the lr parameter is not changing... The code sample is copied and updated from here (the original code did neither work for me) Any full working example of GridSearchCV with custom estimator, with changing parameters would be appreciated. I'm in ubuntu 18.10 using scikit-learn 0.20.2 from sklearn.model_selection import GridSearchCV from

Parameters are not going to custom estimator in scikit-learn GridSearchCV

为君一笑 提交于 2021-01-19 06:45:25
问题 I'm trying and failing to pass parameters to a custom estimator in scikit learn. I'd like the parameter lr to change during the gridsearch. Problem is that the lr parameter is not changing... The code sample is copied and updated from here (the original code did neither work for me) Any full working example of GridSearchCV with custom estimator, with changing parameters would be appreciated. I'm in ubuntu 18.10 using scikit-learn 0.20.2 from sklearn.model_selection import GridSearchCV from

Adaboost in Pipeline with Gridsearch SKLEARN

倾然丶 夕夏残阳落幕 提交于 2020-11-29 21:10:47
问题 I would like to use the AdaBoostClassifier with LinearSVC as base estimator. I want to do a gridsearch on some of the parameters in LinearSVC. Also I have to scale my features. p_grid = {'base_estimator__C': np.logspace(-5, 3, 10)} n_splits = 5 inner_cv = StratifiedKFold(n_splits=n_splits, shuffle=True, random_state=5) SVC_Kernel=LinearSVC(multi_class ='crammer_singer',tol=10e-3,max_iter=10000,class_weight='balanced') ABC = AdaBoostClassifier(base_estimator=SVC_Kernel,n_estimators=600

Adaboost in Pipeline with Gridsearch SKLEARN

天涯浪子 提交于 2020-11-29 21:07:04
问题 I would like to use the AdaBoostClassifier with LinearSVC as base estimator. I want to do a gridsearch on some of the parameters in LinearSVC. Also I have to scale my features. p_grid = {'base_estimator__C': np.logspace(-5, 3, 10)} n_splits = 5 inner_cv = StratifiedKFold(n_splits=n_splits, shuffle=True, random_state=5) SVC_Kernel=LinearSVC(multi_class ='crammer_singer',tol=10e-3,max_iter=10000,class_weight='balanced') ABC = AdaBoostClassifier(base_estimator=SVC_Kernel,n_estimators=600

How to create a subclass with class attributes based on constructor function arguments for use in an estimator for GridSearchCV?

非 Y 不嫁゛ 提交于 2020-11-29 09:23:28
问题 I want to subclass sklearn.svm.LinearSVC and use it as an estimator for sklearn.model_selection.GridSearchCV . I had some issues with subclassing earlier and I thought I fixed it based on my previous post and the selected answer. However, now my objective is to create an sklearn.kernel_approximation.RBFSampler object as an attribute of my new class. Now this is an example and I have a broader question here which is: Question: With the final expectation of using my new estimator class with