File tree 1 file changed +12
-1
lines changed
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(
65
65
XYs = geometry_to_2d (XYs )
66
66
x = np .asarray (x )
67
67
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
+
68
79
if distance_metric == "euclidean" :
69
80
paired_distances = pdist (XYs )
70
81
pd_m = squareform (paired_distances )
@@ -318,7 +329,7 @@ def aoa(
318
329
folds = np .vstack ((fold_indices , instance_fold_id )).T
319
330
320
331
# 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 ):
322
333
mask = folds [:, 0 ] == folds [:, 0 ][i ]
323
334
train_dist [i , mask ] = np .nan
324
335
You can’t perform that action at this time.
0 commit comments