From 51788865afe60ed79043e2ef2caf0b7f8d0463ea Mon Sep 17 00:00:00 2001 From: Romuald Rousseau Date: Tue, 12 Nov 2024 19:00:48 +0800 Subject: [PATCH 1/2] fix: Fix entity probability calculation --- .../romualdrousseau/archery/header/DataTableHeader.java | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/archery/src/main/java/com/github/romualdrousseau/archery/header/DataTableHeader.java b/archery/src/main/java/com/github/romualdrousseau/archery/header/DataTableHeader.java index f7b6d80b..86bcefd4 100644 --- a/archery/src/main/java/com/github/romualdrousseau/archery/header/DataTableHeader.java +++ b/archery/src/main/java/com/github/romualdrousseau/archery/header/DataTableHeader.java @@ -83,7 +83,6 @@ private List sampleEntities() { final var N = Math.min(this.getTable().getNumberOfRows(), Settings.DEFAULT_SAMPLE_COUNT); final var entityVector = Tensor .zeros(this.getTable().getSheet().getDocument().getModel().getEntityList().size()); - float n = 0.0f; for (int i = 0; i < N; i++) { final BaseRow row = this.getTable().getRowAt(i); if (row == null) { @@ -92,12 +91,9 @@ private List sampleEntities() { final BaseCell cell = row.getCellAt(this.getColumnIndex()); if (cell.hasValue() && cell.getSymbol().equals("e")) { entityVector.iadd(cell.getEntityVector()); - n += Settings.DEFAULT_ENTITY_PROBABILITY; } } - if (n > 0.0f) { - entityVector.if_lt_then(n, 0.0f, 1.0f); - } + entityVector.if_lt_then(N * Settings.DEFAULT_ENTITY_PROBABILITY, 0.0f, 1.0f); final var entityList = this.getTable().getSheet().getDocument().getModel().getEntityList(); return IntStream.range(0, entityVector.size).boxed() .filter(i -> entityVector.data[i] == 1) From 77fb100e93ba0becbec15bbb0a2a80bf34e11be5 Mon Sep 17 00:00:00 2001 From: Romuald Rousseau Date: Tue, 12 Nov 2024 20:19:47 +0800 Subject: [PATCH 2/2] fix: Fix entity probability calculation --- .../com/github/romualdrousseau/archery/config/Settings.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/archery/src/main/java/com/github/romualdrousseau/archery/config/Settings.java b/archery/src/main/java/com/github/romualdrousseau/archery/config/Settings.java index 3d12ba3b..ae45ee99 100644 --- a/archery/src/main/java/com/github/romualdrousseau/archery/config/Settings.java +++ b/archery/src/main/java/com/github/romualdrousseau/archery/config/Settings.java @@ -5,7 +5,7 @@ public class Settings { public final static int MAX_STORE_ROWS = 10000; public final static float DEFAULT_RATIO_SIMILARITY = 0.35f; - public final static float DEFAULT_ENTITY_PROBABILITY = 0.6f; + public final static float DEFAULT_ENTITY_PROBABILITY = 0.45f; public final static float DEFAULT_CAPILLARITY_THRESHOLD = 0.5f; public final static String PIVOT_KEY_SUFFIX = "#PIVOT?";