Skip to content

Commit 1cfdbc6

Browse files
authored
Update dimensionality_reduction.py
1 parent 6c0c53f commit 1cfdbc6

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

machine_learning/dimensionality_reduction.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
# Copyright (c) 2023 Diego Gasco (diego.gasco99@gmail.com), Diegomangasco on GitHub
2-
32
"""
43
Requirements:
54
- numpy version 1.21
65
- scipy version 1.3.3
76
Notes:
87
- Each column of the features matrix corresponds to a class item
98
"""
10-
119
"""
1210
Implementation of dimensionality reduction algorithms.
1311
@@ -17,7 +15,6 @@
1715
- Locally Linear Embedding (LLE)
1816
- Multidimensional Scaling (MDS)
1917
"""
20-
2118
import doctest
2219
import logging
2320

@@ -432,7 +429,9 @@ def test_principal_component_analysis() -> None:
432429
"""Test function for Principal Component Analysis."""
433430
features = np.array([[1, 2, 3], [4, 5, 6], [7, 8, 9]])
434431
dimensions = 2
435-
expected_output = np.array([[6.92820323, 8.66025404, 10.39230485], [3.0, 3.0, 3.0]])
432+
expected_output = np.array(
433+
[[6.92820323, 8.66025404, 10.39230485], [3.0, 3.0, 3.0]]
434+
)
436435

437436
output = principal_component_analysis(features, dimensions)
438437
if not np.allclose(expected_output, output):

0 commit comments

Comments
 (0)