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?"; 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)