Oversampling implementation using smote

37 Views Asked by At

I am trying to implement oversampling using Smote and increase the f1 score. I am using a grid search and logistic regression as a classifier.

    k_neighbors = [np.linspace(1, 10, 10)]
    pipe = make_pipeline(SMOTE(),LogisticRegression())
    weights = np.linspace(0.005, 0.25, 10)k_neighbors = [np.linspace(1, 10, 10)]
    pipe = make_pipeline(SMOTE(),LogisticRegression())
    gsc = GridSearchCV(estimator=pipe,param_grid={'k__neighbors': k_neighbors},scoring='f1',cv=3)
    grid_result = gsc.fit(X_train, Y_train)

I've tried multiple things and I'm still getting following error. If anyone could solve this for me, it would be a great help.

`ValueError: Invalid parameter 'k' for estimator Pipeline(steps=[('smote', SMOTE()),`
`('logisticregression', LogisticRegression())]). Valid parameters are: ['memory', 'steps', 'verbose'].`
0

There are 0 best solutions below