git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/data-analysis/EcologicalEngine@59733 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
6aaeff232b
commit
54ba7bb3e5
|
@ -90,6 +90,25 @@ public class DiscrepancyAnalysis extends DataAnalysis {
|
|||
maxCompElements = maxx!=0?maxx:Integer.MAX_VALUE;
|
||||
}
|
||||
|
||||
List<Object> takeNPoints = DatabaseFactory.executeSQLQuery(String.format(getNumberOfElementsQuery, FirstTable), connection);
|
||||
List<Object> takeMPoints = DatabaseFactory.executeSQLQuery(String.format(getNumberOfElementsQuery, SecondTable), connection);
|
||||
int nPoints = Integer.parseInt(""+takeNPoints.get(0));
|
||||
int mPoints = Integer.parseInt(""+takeMPoints.get(0));
|
||||
numberofvectors = Math.max(nPoints, mPoints);
|
||||
|
||||
|
||||
if (FirstTable.equals(SecondTable)){
|
||||
output = new HashMap<String, String>();
|
||||
output.put("MEAN", "0.0");
|
||||
output.put("VARIANCE", "0.0");
|
||||
output.put("NUMBER_OF_ERRORS", "0");
|
||||
output.put("NUMBER_OF_COMPARISONS", "" + numberofvectors);
|
||||
output.put("ACCURACY", "100.0");
|
||||
output.put("MAXIMUM_ERROR", "-");
|
||||
output.put("MAXIMUM_ERROR_POINT", "-");
|
||||
return output;
|
||||
}
|
||||
|
||||
// String query = String.format(discrepancyQuery, FirstTableCsquareColumn, SecondTableCsquareColumn, FirstTableProbabilityColumn, SecondTableProbabilityColumn, FirstTable, SecondTable);
|
||||
List<Object> nelementsQ = DatabaseFactory.executeSQLQuery(DatabaseUtils.countElementsStatement(FirstTable),connection);
|
||||
int nelements = Integer.parseInt(""+nelementsQ.get(0));
|
||||
|
@ -99,11 +118,6 @@ public class DiscrepancyAnalysis extends DataAnalysis {
|
|||
AnalysisLogger.getLogger().trace("Number Of Elements to take: "+nelements);
|
||||
String query = String.format(discrepancyQuery, FirstTableCsquareColumn, SecondTableCsquareColumn, FirstTableProbabilityColumn, SecondTableProbabilityColumn, FirstTable, SecondTable,""+nelements);
|
||||
|
||||
List<Object> takeNPoints = DatabaseFactory.executeSQLQuery(String.format(getNumberOfElementsQuery, FirstTable), connection);
|
||||
List<Object> takeMPoints = DatabaseFactory.executeSQLQuery(String.format(getNumberOfElementsQuery, SecondTable), connection);
|
||||
int nPoints = Integer.parseInt(""+takeNPoints.get(0));
|
||||
int mPoints = Integer.parseInt(""+takeMPoints.get(0));
|
||||
numberofvectors = Math.max(nPoints, mPoints);
|
||||
|
||||
AnalysisLogger.getLogger().trace("Discrepancy Calculation - Query to perform :" + query);
|
||||
List<Object> takePoints = DatabaseFactory.executeSQLQuery(query, connection);
|
||||
|
|
|
@ -203,8 +203,9 @@ public static void main(String[] args) throws Exception {
|
|||
config.setNumberOfResources(1);
|
||||
config.setAgent("DISCREPANCY_ANALYSIS");
|
||||
|
||||
config.setParam("FirstTable", "hspec_id_18b20d04_edf3_4c83_9a48_fcbe773e3fd3");
|
||||
config.setParam("SecondTable", "hspec_id_46cbfde4_9c9b_4414_a1f0_a350fe429018");
|
||||
// config.setParam("FirstTable", "hspec_id_686c508c_b64f_4ef9_9452_465465edbece");
|
||||
config.setParam("FirstTable", "hspec_id_bf4bb271_ed21_42cb_a2be_503979789055");
|
||||
config.setParam("SecondTable", "hspec_id_bf4bb271_ed21_42cb_a2be_503979789055");
|
||||
|
||||
config.setParam("FirstTableCsquareColumn", "csquarecode");
|
||||
config.setParam("SecondTableCsquareColumn", "csquarecode");
|
||||
|
|
Loading…
Reference in New Issue