Skip to content

Commit 165f516

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent a394193 commit 165f516

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

machine_learning/t_stochastic_neighbour_embedding.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ def main() -> None:
131131
t-SNE embedding (first 5 points):
132132
[[...
133133
"""
134-
data_x,labels = collect_dataset()
134+
data_x, labels = collect_dataset()
135135
y_emb = apply_tsne(data_x, n_components=2, n_iter=300)
136136

137137
if not isinstance(y_emb, np.ndarray):
@@ -142,17 +142,14 @@ def main() -> None:
142142

143143
# Optional visualization ( Ruff/mypy compliant)
144144
import matplotlib.pyplot as plt
145-
plt.scatter(
146-
y_emb[:, 0],
147-
y_emb[:, 1],
148-
c=labels,
149-
cmap="viridis"
150-
)
145+
146+
plt.scatter(y_emb[:, 0], y_emb[:, 1], c=labels, cmap="viridis")
151147
plt.title("t-SNE Visualization of Iris Dataset")
152148
plt.xlabel("Dimension 1")
153149
plt.ylabel("Dimension 2")
154150
plt.show()
155151

152+
156153
if __name__ == "__main__":
157154
doctest.testmod()
158155
main()

0 commit comments

Comments
 (0)