This commit is contained in:
Gianpaolo Coro 2013-03-19 09:42:55 +00:00
parent 045abdc393
commit d037eb82cb
4 changed files with 12 additions and 13 deletions

View File

@ -9,7 +9,7 @@
</parent> </parent>
<groupId>org.gcube.dataanalysis</groupId> <groupId>org.gcube.dataanalysis</groupId>
<artifactId>ecological-engine</artifactId> <artifactId>ecological-engine</artifactId>
<version>1.6.0-SNAPSHOT</version> <version>1.6.1-SNAPSHOT</version>
<name>ecological-engine</name> <name>ecological-engine</name>
<description>ecological-engine library</description> <description>ecological-engine library</description>
<properties> <properties>

View File

@ -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.datatypes.enumtypes.TableTemplates;
import org.gcube.dataanalysis.ecoengine.interfaces.DataAnalysis; import org.gcube.dataanalysis.ecoengine.interfaces.DataAnalysis;
import org.gcube.dataanalysis.ecoengine.utils.DatabaseFactory; import org.gcube.dataanalysis.ecoengine.utils.DatabaseFactory;
import org.gcube.dataanalysis.ecoengine.utils.DatabaseUtils;
import org.gcube.dataanalysis.ecoengine.utils.Operations; import org.gcube.dataanalysis.ecoengine.utils.Operations;
public class DiscrepancyAnalysis extends DataAnalysis { 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); // String query = String.format(discrepancyQuery, FirstTableCsquareColumn, SecondTableCsquareColumn, FirstTableProbabilityColumn, SecondTableProbabilityColumn, FirstTable, SecondTable);
List<Object> nelementsQ = DatabaseFactory.executeSQLQuery(DatabaseUtils.countElementsStatement(FirstTable),connection); // List<Object> nelementsQ = DatabaseFactory.executeSQLQuery(DatabaseUtils.countElementsStatement(FirstTable),connection);
int nelements = Integer.parseInt(""+nelementsQ.get(0)); // 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); AnalysisLogger.getLogger().trace("Number Of Elements to take: "+nelements);
String query = String.format(discrepancyQuery, FirstTableCsquareColumn, SecondTableCsquareColumn, FirstTableProbabilityColumn, SecondTableProbabilityColumn, FirstTable, SecondTable,""+nelements); String query = String.format(discrepancyQuery, FirstTableCsquareColumn, SecondTableCsquareColumn, FirstTableProbabilityColumn, SecondTableProbabilityColumn, FirstTable, SecondTable,""+nelements);
AnalysisLogger.getLogger().trace("Discrepancy Calculation - Query to perform :" + query); AnalysisLogger.getLogger().trace("Discrepancy Calculation - Query to perform :" + query);
List<Object> takePoints = DatabaseFactory.executeSQLQuery(query, connection); List<Object> takePoints = DatabaseFactory.executeSQLQuery(query, connection);
@ -134,11 +133,11 @@ public class DiscrepancyAnalysis extends DataAnalysis {
output.put("MEAN", "" + MathFunctions.roundDecimal(mean,2)); output.put("MEAN", "" + MathFunctions.roundDecimal(mean,2));
output.put("VARIANCE", "" + MathFunctions.roundDecimal(variance,2)); output.put("VARIANCE", "" + MathFunctions.roundDecimal(variance,2));
output.put("NUMBER_OF_ERRORS", "" + numberoferrors); output.put("NUMBER_OF_ERRORS", "" + numberoferrors);
output.put("NUMBER_OF_COMPARISONS", "" + numberofvectors); output.put("NUMBER_OF_COMPARISONS", "" + nelements);
float accuracy = 100; float accuracy = 100;
if (processedRecords>0) if (processedRecords>0)
accuracy = (1 - (float) numberoferrors / (float) numberofvectors) * 100; accuracy = (1 - (float) numberoferrors / (float) nelements) * 100;
output.put("ACCURACY", "" + MathFunctions.roundDecimal(accuracy,2)); output.put("ACCURACY", "" + MathFunctions.roundDecimal(accuracy,2));

View File

@ -104,7 +104,7 @@ public class TablesComparisonForLatimeria {
} }
public static void main(String[] args) throws Exception { public static void main(String[] args) throws Exception {
calcdiscrepancy(aquamapsSuitableTable, nnsuitableTable); // calcdiscrepancy(aquamapsSuitableTable, nnsuitableTable);
calcdiscrepancy(aquamapsNativeTable, nnnativeTable); calcdiscrepancy(aquamapsNativeTable, nnnativeTable);
} }

View File

@ -10,14 +10,14 @@
<Packages> <Packages>
<Software> <Software>
<Name>ecological-engine</Name> <Name>ecological-engine</Name>
<Version>1.6.0-SNAPSHOT</Version> <Version>1.6.1-SNAPSHOT</Version>
<MavenCoordinates> <MavenCoordinates>
<groupId>org.gcube.dataanalysis</groupId> <groupId>org.gcube.dataanalysis</groupId>
<artifactId>ecological-engine</artifactId> <artifactId>ecological-engine</artifactId>
<version>1.6.0-SNAPSHOT</version> <version>1.6.1-SNAPSHOT</version>
</MavenCoordinates> </MavenCoordinates>
<Files> <Files>
<File>ecological-engine-1.6.0-SNAPSHOT.jar</File> <File>ecological-engine-1.6.1-SNAPSHOT.jar</File>
</Files> </Files>
</Software> </Software>
</Packages> </Packages>