File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -65,6 +65,17 @@ def variogram_at_lag(
6565 XYs = geometry_to_2d (XYs )
6666 x = np .asarray (x )
6767
68+ # Remove nans from x and XYs for variogram calculation
69+ nan_idx = np .isnan (x )
70+ x = x [~ nan_idx ]
71+ XYs = XYs [~ nan_idx ]
72+
73+ # Select only 30000 random points from x and XYs to calculate pairwise distances
74+ if len (x ) > 30000 :
75+ idx = np .random .choice (len (x ), 30000 , replace = False )
76+ x = x [idx ]
77+ XYs = XYs [idx ]
78+
6879 if distance_metric == "euclidean" :
6980 paired_distances = pdist (XYs )
7081 pd_m = squareform (paired_distances )
@@ -318,7 +329,7 @@ def aoa(
318329 folds = np .vstack ((fold_indices , instance_fold_id )).T
319330
320331 # Mask training points in same fold for DI measure calculation
321- for i , row in enumerate (train_dist ):
332+ for i , _ in enumerate (train_dist ):
322333 mask = folds [:, 0 ] == folds [:, 0 ][i ]
323334 train_dist [i , mask ] = np .nan
324335
You can’t perform that action at this time.
0 commit comments