Skip to content

Commit

Permalink
fix test cases; fix alphine linux build
Browse files Browse the repository at this point in the history
  • Loading branch information
lixun910 committed Dec 20, 2024
1 parent 86ad5ad commit def410d
Show file tree
Hide file tree
Showing 7 changed files with 154 additions and 90 deletions.
2 changes: 1 addition & 1 deletion libgeoda
Submodule libgeoda updated 2 files
+2 −2 sa/BatchLISA.h
+1 −2 sa/LISA.h
6 changes: 3 additions & 3 deletions pygeoda/clustering/azp.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def azp_greedy(p, w, data, **kwargs):

in_init_regions = VecInt(list(init_regions))

cluster_ids = gda_azp_greedy(p, w.gda_w, in_data, scale_method, inits, min_bounds, max_bounds, in_init_regions, distance_method, random_seed)
cluster_ids = gda_azp_greedy(p, w.gda_w, in_data, scale_method, inits, min_bounds, max_bounds, in_init_regions, distance_method, random_seed, 0)

between_ss = gda_betweensumofsquare(cluster_ids, in_data)
total_ss = gda_totalsumofsquare(in_data)
Expand Down Expand Up @@ -142,7 +142,7 @@ def azp_sa(p, w, data, cooling_rate=0.85, **kwargs):

in_init_regions = VecInt(list(init_regions))

cluster_ids = gda_azp_sa(p, w.gda_w, in_data, scale_method, inits, cooling_rate, sa_maxit, min_bounds, max_bounds, in_init_regions, distance_method, random_seed)
cluster_ids = gda_azp_sa(p, w.gda_w, in_data, scale_method, inits, cooling_rate, sa_maxit, min_bounds, max_bounds, in_init_regions, distance_method, random_seed, 0)

between_ss = gda_betweensumofsquare(cluster_ids, in_data)
total_ss = gda_totalsumofsquare(in_data)
Expand Down Expand Up @@ -216,7 +216,7 @@ def azp_tabu(p, w, data, tabu_length, **kwargs):

in_init_regions = VecInt(list(init_regions))

cluster_ids = gda_azp_tabu(p, w.gda_w, in_data, scale_method, inits, tabu_length, conv_tabu, min_bounds, max_bounds, in_init_regions, distance_method, random_seed)
cluster_ids = gda_azp_tabu(p, w.gda_w, in_data, scale_method, inits, tabu_length, conv_tabu, min_bounds, max_bounds, in_init_regions, distance_method, random_seed, 0)

between_ss = gda_betweensumofsquare(cluster_ids, in_data)
total_ss = gda_totalsumofsquare(in_data)
Expand Down
6 changes: 3 additions & 3 deletions pygeoda/clustering/maxp.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def maxp_greedy(w, data, bound_variable, min_bound, **kwargs):

in_init_regions = VecInt(list(init_regions))

cluster_ids = gda_maxp_greedy(w.gda_w, in_data, scale_method, iterations, min_bounds, max_bounds, in_init_regions, distance_method, random_seed, cpu_threads)
cluster_ids = gda_maxp_greedy(w.gda_w, in_data, scale_method, iterations, min_bounds, max_bounds, in_init_regions, distance_method, random_seed, cpu_threads, 0)

between_ss = gda_betweensumofsquare(cluster_ids, in_data)
total_ss = gda_totalsumofsquare(in_data)
Expand Down Expand Up @@ -140,7 +140,7 @@ def maxp_sa(w, data, bound_variable, min_bound, cooling_rate=0.85, **kwargs):

in_init_regions = VecInt(list(init_regions))

cluster_ids = gda_maxp_sa(w.gda_w, in_data, scale_method, iterations, cooling_rate, sa_maxit, min_bounds, max_bounds, in_init_regions, distance_method, random_seed, cpu_threads)
cluster_ids = gda_maxp_sa(w.gda_w, in_data, scale_method, iterations, cooling_rate, sa_maxit, min_bounds, max_bounds, in_init_regions, distance_method, random_seed, cpu_threads, 0)

between_ss = gda_betweensumofsquare(cluster_ids, in_data)
total_ss = gda_totalsumofsquare(in_data)
Expand Down Expand Up @@ -213,7 +213,7 @@ def maxp_tabu(w, data, bound_variable, min_bound, tabu_length=10, **kwargs):

in_init_regions = VecInt(list(init_regions))

cluster_ids = gda_maxp_tabu(w.gda_w, in_data, scale_method, iterations, tabu_length, conv_tabu, min_bounds, max_bounds, in_init_regions, distance_method, random_seed, cpu_threads)
cluster_ids = gda_maxp_tabu(w.gda_w, in_data, scale_method, iterations, tabu_length, conv_tabu, min_bounds, max_bounds, in_init_regions, distance_method, random_seed, cpu_threads, 0)

between_ss = gda_betweensumofsquare(cluster_ids, in_data)
total_ss = gda_totalsumofsquare(in_data)
Expand Down
2 changes: 1 addition & 1 deletion pygeoda/clustering/redcap.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def redcap(k, w, data, method, **kwargs):

#in_bound_variable = VecDouble(bound_variable)

cluster_ids = gda_redcap(k, w.gda_w, in_data, scale_method, method, distance_method, bound_variable, min_bound, random_seed, cpu_threads)
cluster_ids = gda_redcap(k, w.gda_w, in_data, scale_method, method, distance_method, bound_variable, min_bound, random_seed, cpu_threads, 0)

between_ss = gda_betweensumofsquare(cluster_ids, in_data)
total_ss = gda_totalsumofsquare(in_data)
Expand Down
2 changes: 1 addition & 1 deletion pygeoda/clustering/schc.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def schc(k, w, data, linkage_method, **kwargs):
for d in data:
in_data.push_back(d)

cluster_ids = gda_schc(k, w.gda_w, in_data, linkage_method, scale_method, distance_method, bound_variable, min_bound)
cluster_ids = gda_schc(k, w.gda_w, in_data, linkage_method, scale_method, distance_method, bound_variable, min_bound, 0)

between_ss = gda_betweensumofsquare(cluster_ids, in_data)
total_ss = gda_totalsumofsquare(in_data)
Expand Down
2 changes: 1 addition & 1 deletion pygeoda/clustering/skater.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def skater(k, w, data, **kwargs):
for d in data:
in_data.push_back(d)

cluster_ids = gda_skater(k, w.gda_w, in_data, scale_method, distance_method, bound_variable, min_bound, random_seed, cpu_threads)
cluster_ids = gda_skater(k, w.gda_w, in_data, scale_method, distance_method, bound_variable, min_bound, random_seed, cpu_threads, 0)

between_ss = gda_betweensumofsquare(cluster_ids, in_data)
total_ss = gda_totalsumofsquare(in_data)
Expand Down
Loading

0 comments on commit def410d

Please sign in to comment.