@@ -160,6 +160,7 @@ def linear_discriminant_analysis(
160160 logging .error ("Dataset empty" )
161161 raise AssertionError
162162
163+
163164def 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+
208210def 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+
224227def 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