diff --git a/pom.xml b/pom.xml index dce5371..e9cb08a 100644 --- a/pom.xml +++ b/pom.xml @@ -9,7 +9,7 @@ org.gcube.dataanalysis ecological-engine - 1.6.0-SNAPSHOT + 1.6.1-SNAPSHOT ecological-engine ecological-engine library diff --git a/src/main/java/org/gcube/dataanalysis/ecoengine/evaluation/DiscrepancyAnalysis.java b/src/main/java/org/gcube/dataanalysis/ecoengine/evaluation/DiscrepancyAnalysis.java index b4d094a..b7c57d8 100644 --- a/src/main/java/org/gcube/dataanalysis/ecoengine/evaluation/DiscrepancyAnalysis.java +++ b/src/main/java/org/gcube/dataanalysis/ecoengine/evaluation/DiscrepancyAnalysis.java @@ -15,7 +15,6 @@ import org.gcube.dataanalysis.ecoengine.datatypes.enumtypes.PrimitiveTypes; import org.gcube.dataanalysis.ecoengine.datatypes.enumtypes.TableTemplates; import org.gcube.dataanalysis.ecoengine.interfaces.DataAnalysis; import org.gcube.dataanalysis.ecoengine.utils.DatabaseFactory; -import org.gcube.dataanalysis.ecoengine.utils.DatabaseUtils; import org.gcube.dataanalysis.ecoengine.utils.Operations; public class DiscrepancyAnalysis extends DataAnalysis { @@ -110,15 +109,15 @@ public class DiscrepancyAnalysis extends DataAnalysis { } // String query = String.format(discrepancyQuery, FirstTableCsquareColumn, SecondTableCsquareColumn, FirstTableProbabilityColumn, SecondTableProbabilityColumn, FirstTable, SecondTable); - List nelementsQ = DatabaseFactory.executeSQLQuery(DatabaseUtils.countElementsStatement(FirstTable),connection); - int nelements = Integer.parseInt(""+nelementsQ.get(0)); +// List nelementsQ = DatabaseFactory.executeSQLQuery(DatabaseUtils.countElementsStatement(FirstTable),connection); +// int nelements = Integer.parseInt(""+nelementsQ.get(0)); - nelements = Math.min(Operations.calcNumOfRepresentativeElements(nelements, minElements),maxCompElements); +// int nelements = Math.min(Operations.calcNumOfRepresentativeElements(nPoints, minElements),maxCompElements); + int nelements = nPoints; AnalysisLogger.getLogger().trace("Number Of Elements to take: "+nelements); String query = String.format(discrepancyQuery, FirstTableCsquareColumn, SecondTableCsquareColumn, FirstTableProbabilityColumn, SecondTableProbabilityColumn, FirstTable, SecondTable,""+nelements); - AnalysisLogger.getLogger().trace("Discrepancy Calculation - Query to perform :" + query); List takePoints = DatabaseFactory.executeSQLQuery(query, connection); @@ -134,11 +133,11 @@ public class DiscrepancyAnalysis extends DataAnalysis { output.put("MEAN", "" + MathFunctions.roundDecimal(mean,2)); output.put("VARIANCE", "" + MathFunctions.roundDecimal(variance,2)); output.put("NUMBER_OF_ERRORS", "" + numberoferrors); - output.put("NUMBER_OF_COMPARISONS", "" + numberofvectors); + output.put("NUMBER_OF_COMPARISONS", "" + nelements); float accuracy = 100; if (processedRecords>0) - accuracy = (1 - (float) numberoferrors / (float) numberofvectors) * 100; + accuracy = (1 - (float) numberoferrors / (float) nelements) * 100; output.put("ACCURACY", "" + MathFunctions.roundDecimal(accuracy,2)); @@ -181,7 +180,7 @@ public class DiscrepancyAnalysis extends DataAnalysis { if (elements[3] != null) probabilityPoint2 = (Float) elements[3]; float discrepancy = Math.abs(probabilityPoint2 - probabilityPoint1); - + if (discrepancy > threshold) { errors.add(Math.abs(probabilityPoint2 - probabilityPoint1)); numberoferrors++; diff --git a/src/main/java/org/gcube/dataanalysis/ecoengine/test/experiments/latimeria/TablesComparisonForLatimeria.java b/src/main/java/org/gcube/dataanalysis/ecoengine/test/experiments/latimeria/TablesComparisonForLatimeria.java index 8044df5..287717e 100644 --- a/src/main/java/org/gcube/dataanalysis/ecoengine/test/experiments/latimeria/TablesComparisonForLatimeria.java +++ b/src/main/java/org/gcube/dataanalysis/ecoengine/test/experiments/latimeria/TablesComparisonForLatimeria.java @@ -104,7 +104,7 @@ public class TablesComparisonForLatimeria { } public static void main(String[] args) throws Exception { - calcdiscrepancy(aquamapsSuitableTable, nnsuitableTable); +// calcdiscrepancy(aquamapsSuitableTable, nnsuitableTable); calcdiscrepancy(aquamapsNativeTable, nnnativeTable); } diff --git a/target/profile.xml b/target/profile.xml index 2b86eb8..636eef5 100644 --- a/target/profile.xml +++ b/target/profile.xml @@ -10,14 +10,14 @@ ecological-engine - 1.6.0-SNAPSHOT + 1.6.1-SNAPSHOT org.gcube.dataanalysis ecological-engine - 1.6.0-SNAPSHOT + 1.6.1-SNAPSHOT - ecological-engine-1.6.0-SNAPSHOT.jar + ecological-engine-1.6.1-SNAPSHOT.jar