1
$\begingroup$

how can i plot my results from gridsearch csv?

clf = GridSearchCV(pipeline, parameters, cv=3,return_train_score=True)
clf.fit(x, y)
df = pd.DataFrame(clf.cv_results_)

i'm trying to get a similar plot to what is here: https://matthewbilyeu.com/blog/2019-02-05/validation-curve-plot-from-gridsearchcv-results , but this uses the grid search object and i have tried and failed at trying to get the same using just the gridsearch df (from above).

can anybody help in how i go about this?

$\endgroup$
2
  • $\begingroup$ Why do you fail? With that you get a pandas dataframe, if you extract the parameters (I think they are in dic format) you should be able do a fast plot $\endgroup$ Jun 19, 2020 at 10:19
  • $\begingroup$ aram_ranges = [grid.param_grid[p[6:]] for p in param_cols] <-- you need the grid object here what would be qeuivalent for df $\endgroup$
    – Maths12
    Jun 19, 2020 at 10:24

1 Answer 1

0
$\begingroup$

Pass your clf object to the function provided in the website. It should work.

$\endgroup$
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.