Skip to content

Commit

Permalink
COSMIT pep8
Browse files Browse the repository at this point in the history
  • Loading branch information
amueller committed Sep 4, 2012
1 parent e686e38 commit 4bc8822
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions examples/svm/plot_svm_scale_c.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,13 @@
n_features = 300

# L1 data (only 5 informative features)
X_1, y_1 = datasets.make_classification(n_samples=n_samples, n_features=n_features,
n_informative=5, random_state=1)
X_1, y_1 = datasets.make_classification(n_samples=n_samples,
n_features=n_features, n_informative=5, random_state=1)

# L2 data: non sparse, but less features
y_2 = np.sign(.5 - rnd.rand(n_samples))
X_2 = rnd.randn(n_samples, n_features/5) + y_2[:, np.newaxis]
X_2 += 5 * rnd.randn(n_samples, n_features/5)
X_2 = rnd.randn(n_samples, n_features / 5) + y_2[:, np.newaxis]
X_2 += 5 * rnd.randn(n_samples, n_features / 5)

clf_sets = [(LinearSVC(penalty='L1', loss='L2', dual=False,
tol=1e-3),
Expand Down Expand Up @@ -140,12 +140,11 @@
pl.subplot(2, 1, subplotnum + 1)
pl.xlabel('C')
pl.ylabel('CV Score')
grid_cs = cs * float(scaler) # scale the C's
grid_cs = cs * float(scaler) # scale the C's
pl.semilogx(grid_cs, scores, label="fraction %.2f" %
train_size)
pl.title('scaling=%s, penalty=%s, loss=%s' %
(name, clf.penalty, clf.loss))

pl.legend(loc="best")
pl.show()

0 comments on commit 4bc8822

Please sign in to comment.