Skip to content

Commit 8c1edd7

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

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

machine_learning/dimensionality_reduction.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@ def linear_discriminant_analysis(
160160
logging.error("Dataset empty")
161161
raise AssertionError
162162

163+
163164
def locally_linear_embedding(
164165
features: np.ndarray, n_neighbors: int, dimensions: int
165166
) -> np.ndarray:
@@ -176,17 +177,17 @@ def locally_linear_embedding(
176177
# Check if features exist
177178
if features.any():
178179
# Placeholder: actual LLE computation goes here
179-
logging.info(f"LLE computed with {n_neighbors} neighbors and {dimensions} dimensions")
180+
logging.info(
181+
f"LLE computed with {n_neighbors} neighbors and {dimensions} dimensions"
182+
)
180183
return features[:, :dimensions] # temporary projection
181184
else:
182185
logging.basicConfig(level=logging.ERROR, format="%(message)s", force=True)
183186
logging.error("Dataset empty")
184187
raise AssertionError
185188

186189

187-
def multidimensional_scaling(
188-
features: np.ndarray, dimensions: int
189-
) -> np.ndarray:
190+
def multidimensional_scaling(features: np.ndarray, dimensions: int) -> np.ndarray:
190191
"""
191192
Multidimensional Scaling (MDS).
192193
@@ -205,6 +206,7 @@ def multidimensional_scaling(
205206
logging.error("Dataset empty")
206207
raise AssertionError
207208

209+
208210
def test_locally_linear_embedding() -> None:
209211
features = np.array([[1, 2, 3], [4, 5, 6], [7, 8, 9]])
210212
n_neighbors = 2
@@ -221,6 +223,7 @@ def test_multidimensional_scaling() -> None:
221223
assert output.shape[0] == features.shape[0]
222224
assert output.shape[1] == dimensions
223225

226+
224227
def test_linear_discriminant_analysis() -> None:
225228
# Create dummy dataset with 2 classes and 3 features
226229
features = np.array([[1, 2, 3, 4, 5], [2, 3, 4, 5, 6], [3, 4, 5, 6, 7]])

0 commit comments

Comments
 (0)