1d1b36f28b5c8fc06eacec6e7a4342987e7da03b,examples/plot_model_selection2.py,,,#,41

Before Change



// create a segment learning pipeline
width = 100
est = KerasClassifier(build_fn=crnn_model, epochs = 5, batch_size = 256, verbose = 0)
pipe = SegPipe(est)

// create a parameter dictionary using the SegPipe API - which is similar to the sklearn API
//
// parameters passed to an estimator in the ``feed`` pipeline are keyed ``f$estimator__parameter``
// parameters passed to an estimator in the ``est`` pipeline are keyed ``e$estimator__parameter``
//
// when the ``feed`` or ``est`` pipeline is not a pipeline, but just a single estimator
// the parameter would be keyed f$parameter or e$parameter respectively
//
// you can also set a parameter to be always equal to another parameter, by setting its value to
// parameter name to track
//
// note that if you want to set a parameter to a single value, it will still need to be as a list

par_grid = {"s$width" : [50,100,200],
            "s$overlap" : [0.],
            "width" : ["s$width"]}

clf = GridSearchCV(pipe, par_grid, cv=cv)
clf.fit(Xs, ys)
scores = clf.cv_results_["mean_test_score"]
stds = clf.cv_results_["std_test_score"]

plt.plot(par_grid["s$width"], scores, "-o")
plt.title("Grid Search Scores")

After Change



// create a segment learning pipeline
width = 100
pipe = Pype([("seg", SegmentX()),
             ("crnn", KerasClassifier(build_fn=crnn_model, epochs = 5, batch_size = 256, verbose = 0))])

// create a parameter dictionary using the sklearn API
//
// you can also set a parameter to be always equal to another parameter, by setting its value to
// parameter name to track (this is an extension from sklearn)
//
// note that if you want to set a parameter to a single value, it will still need to be as a list

par_grid = {"seg__width" : [50,100,200],
            "seg__overlap" : [0.],
            "crnn__width" : ["seg__width"]}

clf = GridSearchCV(pipe, par_grid, cv=cv)
clf.fit(Xs, ys)
scores = clf.cv_results_["mean_test_score"]
stds = clf.cv_results_["std_test_score"]

plt.plot(par_grid["seg__width"], scores, "-o")
plt.title("Grid Search Scores")
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 16

Instances


Project Name: dmbee/seglearn
Commit Name: 1d1b36f28b5c8fc06eacec6e7a4342987e7da03b
Time: 2018-07-27
Author: david.mo.burns@gmail.com
File Name: examples/plot_model_selection2.py
Class Name:
Method Name:


Project Name: dmbee/seglearn
Commit Name: 1d1b36f28b5c8fc06eacec6e7a4342987e7da03b
Time: 2018-07-27
Author: david.mo.burns@gmail.com
File Name: examples/plot_model_selection2.py
Class Name:
Method Name:


Project Name: dmbee/seglearn
Commit Name: 1d1b36f28b5c8fc06eacec6e7a4342987e7da03b
Time: 2018-07-27
Author: david.mo.burns@gmail.com
File Name: examples/plot_nn_training_curves.py
Class Name:
Method Name:


Project Name: dmbee/seglearn
Commit Name: 1d1b36f28b5c8fc06eacec6e7a4342987e7da03b
Time: 2018-07-27
Author: david.mo.burns@gmail.com
File Name: examples/plot_segment_rep.py
Class Name:
Method Name: