Skip to content

Commit c93282c

Browse files
committed
black code formatting
1 parent f58fec5 commit c93282c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+1089
-802
lines changed

docs/api/anscombe.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Creates the anscombe visualization.
1+
# Creates the anscombe visualization.
22

33
import yellowbrick as yb
44
import matplotlib.pyplot as plt

docs/api/features/manifold.py

+4-6
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,8 @@ def dataset_example(dataset="occupancy", manifold="all", path="images/", **kwarg
8181

8282

8383
def select_features_example(
84-
algorithm="isomap", path="images/occupancy_select_k_best_isomap_manifold.png",
84+
algorithm="isomap",
85+
path="images/occupancy_select_k_best_isomap_manifold.png",
8586
**kwargs
8687
):
8788
_, ax = plt.subplots(figsize=(9, 6))
@@ -133,9 +134,7 @@ def plot_manifold_embedding(self, algorithm="lle", path="images"):
133134
_, ax = plt.subplots(figsize=(9, 6))
134135
path = self._make_path(path, "s_curve_{}_manifold.png".format(algorithm))
135136

136-
oz = Manifold(
137-
ax=ax, manifold=algorithm, colors="nipy_spectral"
138-
)
137+
oz = Manifold(ax=ax, manifold=algorithm, colors="nipy_spectral")
139138

140139
oz.fit(self.X, self.y)
141140
oz.poof(outpath=path)
@@ -154,7 +153,6 @@ def plot_all_manifolds(self, path="images"):
154153
dataset_example("concrete", "tsne", path="images/concrete_tsne_manifold.png")
155154
dataset_example("occupancy", "tsne", path="images/occupancy_tsne_manifold.png")
156155
dataset_example(
157-
"concrete", "isomap", path="images/concrete_isomap_manifold.png",
158-
n_neighbors=10
156+
"concrete", "isomap", path="images/concrete_isomap_manifold.png", n_neighbors=10
159157
)
160158
select_features_example(algorithm="isomap", n_neighbors=10)

docs/api/features/pcoords_benchmark.py

+8-9
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88

99
def plot_speedup(trials=5, factors=np.arange(1, 11)):
10-
1110
def pcoords_time(X, y, fast=True):
1211
_, ax = plt.subplots()
1312
oz = ParallelCoordinates(fast=fast, ax=ax)
@@ -16,9 +15,9 @@ def pcoords_time(X, y, fast=True):
1615
oz.fit_transform(X, y)
1716
delta = time.time() - start
1817

19-
plt.cla() # clear current axis
20-
plt.clf() # clear current figure
21-
plt.close("all") # close all existing plots
18+
plt.cla() # clear current axis
19+
plt.clf() # clear current figure
20+
plt.close("all") # close all existing plots
2221

2322
return delta
2423

@@ -49,19 +48,19 @@ def pcoords_speedup(X, y):
4948
variance = np.array(variance)
5049

5150
series = pd.Series(speedups, index=factors)
52-
_, ax = plt.subplots(figsize=(9,6))
53-
series.plot(ax=ax, marker='o', label="speedup factor", color='b')
51+
_, ax = plt.subplots(figsize=(9, 6))
52+
series.plot(ax=ax, marker="o", label="speedup factor", color="b")
5453

5554
# Plot one standard deviation above and below the mean
5655
ax.fill_between(
57-
factors, speedups - variance, speedups + variance, alpha=0.25,
58-
color='b',
56+
factors, speedups - variance, speedups + variance, alpha=0.25, color="b"
5957
)
6058

6159
ax.set_ylabel("speedup factor")
6260
ax.set_xlabel("dataset size (number of repeats in Iris dataset)")
6361
ax.set_title("Speed Improvement of Fast Parallel Coordinates")
6462
plt.savefig("images/fast_parallel_coordinates_speedup_benchmark.png")
6563

66-
if __name__ == '__main__':
64+
65+
if __name__ == "__main__":
6766
plot_speedup()

docs/api/model_selection/validation_curve.py

+28-8
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,25 @@
2626
## Helper Methods
2727
##########################################################################
2828

29-
def validation_curve_sklearn_example(path="images/validation_curve_sklearn_example.png"):
29+
30+
def validation_curve_sklearn_example(
31+
path="images/validation_curve_sklearn_example.png"
32+
):
3033
digits = load_digits()
3134
X, y = digits.data, digits.target
3235

3336
_, ax = plt.subplots()
3437

3538
param_range = np.logspace(-6, -1, 5)
3639
oz = ValidationCurve(
37-
SVC(), ax=ax, param_name="gamma", param_range=param_range,
38-
logx=True, cv=10, scoring="accuracy", n_jobs=4
40+
SVC(),
41+
ax=ax,
42+
param_name="gamma",
43+
param_range=param_range,
44+
logx=True,
45+
cv=10,
46+
scoring="accuracy",
47+
n_jobs=4,
3948
)
4049
oz.fit(X, y)
4150
oz.poof(outpath=path)
@@ -52,8 +61,14 @@ def validation_curve_classifier_svc(path="images/validation_curve_classifier_svc
5261
print("warning: generating the SVC validation curve can take a very long time!")
5362

5463
oz = ValidationCurve(
55-
SVC(), ax=ax, param_name="gamma", param_range=param_range,
56-
logx=True, cv=cv, scoring="f1_weighted", n_jobs=8,
64+
SVC(),
65+
ax=ax,
66+
param_name="gamma",
67+
param_range=param_range,
68+
logx=True,
69+
cv=cv,
70+
scoring="f1_weighted",
71+
n_jobs=8,
5772
)
5873
oz.fit(X, y)
5974
oz.poof(outpath=path)
@@ -70,8 +85,13 @@ def validation_curve_classifier_knn(path="images/validation_curve_classifier_knn
7085
print("warning: generating the KNN validation curve can take a very long time!")
7186

7287
oz = ValidationCurve(
73-
KNeighborsClassifier(), ax=ax, param_name="n_neighbors",
74-
param_range=param_range, cv=cv, scoring="f1_weighted", n_jobs=8,
88+
KNeighborsClassifier(),
89+
ax=ax,
90+
param_name="n_neighbors",
91+
param_range=param_range,
92+
cv=cv,
93+
scoring="f1_weighted",
94+
n_jobs=8,
7595
)
7696
oz.fit(X, y)
7797
oz.poof(outpath=path)
@@ -81,7 +101,7 @@ def validation_curve_classifier_knn(path="images/validation_curve_classifier_knn
81101
## Main Method
82102
##########################################################################
83103

84-
if __name__ == '__main__':
104+
if __name__ == "__main__":
85105
# validation_curve_sklearn_example()
86106
validation_curve_classifier_svc()
87107
validation_curve_classifier_knn()

docs/api/text/umap_vis.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def umap(docs, target, outpath, **kwargs):
3232
visualizer.poof(outpath=outpath)
3333

3434

35-
if __name__ == '__main__':
35+
if __name__ == "__main__":
3636

3737
# Load and vectorize the corpus
3838
corpus = load_hobbies()

0 commit comments

Comments
 (0)