pspp.git - GNU PSPP

index : pspp.git
GNU PSPP
summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorBen Pfaff <blp@cs.stanford.edu>2025年01月28日 14:22:51 -0800
committerBen Pfaff <blp@cs.stanford.edu>2025年01月28日 14:22:51 -0800
commit2284baf7ab2097e7655a376ef7a6f9146a18f952 (patch)
tree21858d26ac44ea2e8eba961d2bc9cb95d793a5cf /src
parent99436bd11b850da3b63f8a2e9ed2302f013e2621 (diff)
downloadpspp-2284baf7ab2097e7655a376ef7a6f9146a18f952.tar.gz
QUICK CLUSTER: Use fixed format for cluster centers.
This command used the variables' own formats for their centers. This was a bad idea for at least two reasons. First, the variables might have a format that does not show any decimal places, but clusters wouldn't ordinarily have integer centers, so this is confusing. Second, if a cluster center happens to have a value label, it could be shown instead, which is even more confusing. This fixes the problem by using a fixed format instead. Thanks to Andreas Hammer for reporting the problem.
Diffstat (limited to 'src')
-rw-r--r--src/language/commands/quick-cluster.c 4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/language/commands/quick-cluster.c b/src/language/commands/quick-cluster.c
index 128130afe..cb5817006 100644
--- a/src/language/commands/quick-cluster.c
+++ b/src/language/commands/quick-cluster.c
@@ -549,9 +549,7 @@ quick_cluster_show_centers (struct Kmeans *kmeans, bool initial, const struct qc
for (size_t j = 0; j < qc->n_vars; j++)
{
double x = gsl_matrix_get (matrix, kmeans->group_order->data[i], j);
- union value v = { .f = x };
- pivot_table_put2 (table, i, j,
- pivot_value_new_var_value (qc->vars[j], &v));
+ pivot_table_put2 (table, i, j, pivot_value_new_number (x));
}
pivot_table_submit (table);
generated by cgit v1.2.3 (git 2.25.1) at 2025年10月05日 02:52:14 +0000

AltStyle によって変換されたページ (->オリジナル) /