scikit-plot icon indicating copy to clipboard operation
scikit-plot copied to clipboard

Add cross-validation curve for appointed parameter of param_range

Open lugq1990 opened this issue 7 years ago • 2 comments

@reiinakano Hi, I have just found that the project of scikit-plot is really helpful for those what to do the data analysis or machine learning, and I use it much. During my working time, I find that for the parameter choosen maybe also be plot for visualization. I have writen a new method for plot the cross-validation for a appointed parameter. I want to create a new branch added the new added method. Is that ok?

lugq1990 avatar Feb 08 '18 04:02 lugq1990

Hi @lugq1990. Contributions are welcome. Do you mind posting here your proposed plot and some examples?

reiinakano avatar Feb 08 '18 04:02 reiinakano

Because as we use the grid-search like param choosen method, the result is based on the train set only, not on all data, so just like the cross-validation to evaluate the model, so just for those who want to choose param based on the cv, I write a function.The example code as follews. The final result is the plot image. I am wondered if you would see it. from __future__ import absolute_import from sklearn.datasets import load_digits as load_data from sklearn.utils import shuffle import matplotlib.pyplot as plt import scikitplot as skplt from sklearn.svm import SVC X, y = load_data(return_X_y=True) X, y = shuffle(X, y) clf = SVC() param_name = 'C' param_range = [.1,10,100] skplt.estimators.plot_validation_curve(clf, X, y, param_name=param_name, param_range=param_range) plt.show() 2018-02-08_141218

lugq1990 avatar Feb 08 '18 05:02 lugq1990