git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/data-analysis/EcologicalEngine@77201 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
ca9657079e
commit
0d9731167f
|
@ -132,6 +132,7 @@ public class DiscrepancyAnalysis extends DataAnalysis {
|
||||||
output.put("NUMBER_OF_ERRORS", "0");
|
output.put("NUMBER_OF_ERRORS", "0");
|
||||||
output.put("NUMBER_OF_COMPARISONS", "" + numberofvectors);
|
output.put("NUMBER_OF_COMPARISONS", "" + numberofvectors);
|
||||||
output.put("ACCURACY", "100.0");
|
output.put("ACCURACY", "100.0");
|
||||||
|
output.put("RELATIVE ERROR", "-");
|
||||||
output.put("MAXIMUM_ERROR", "0");
|
output.put("MAXIMUM_ERROR", "0");
|
||||||
output.put("MAXIMUM_ERROR_POINT", "-");
|
output.put("MAXIMUM_ERROR_POINT", "-");
|
||||||
output.put("COHENS_KAPPA", "1");
|
output.put("COHENS_KAPPA", "1");
|
||||||
|
@ -172,6 +173,7 @@ public class DiscrepancyAnalysis extends DataAnalysis {
|
||||||
output.put("NUMBER_OF_ERRORS", "" + numberoferrors);
|
output.put("NUMBER_OF_ERRORS", "" + numberoferrors);
|
||||||
output.put("NUMBER_OF_COMPARISONS", "" + numberofcomparisons);
|
output.put("NUMBER_OF_COMPARISONS", "" + numberofcomparisons);
|
||||||
output.put("ACCURACY", "" + MathFunctions.roundDecimal(accuracy,2));
|
output.put("ACCURACY", "" + MathFunctions.roundDecimal(accuracy,2));
|
||||||
|
output.put("RELATIVE ERROR", "" + MathFunctions.roundDecimal(mean/maxerror,2));
|
||||||
output.put("MAXIMUM_ERROR", "" + MathFunctions.roundDecimal(maxerror,2));
|
output.put("MAXIMUM_ERROR", "" + MathFunctions.roundDecimal(maxerror,2));
|
||||||
output.put("MAXIMUM_ERROR_POINT", maxdiscrepancyPoint);
|
output.put("MAXIMUM_ERROR_POINT", maxdiscrepancyPoint);
|
||||||
output.put("COHENS_KAPPA", "" + kappa);
|
output.put("COHENS_KAPPA", "" + kappa);
|
||||||
|
|
|
@ -181,6 +181,16 @@ public class DatabaseUtils {
|
||||||
return "COPY "+table+" FROM '"+file+"' DELIMITERS ';' WITH NULL AS 'null string'";
|
return "COPY "+table+" FROM '"+file+"' DELIMITERS ';' WITH NULL AS 'null string'";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static String copyFileFromTableStatement (String file, String table, String delimiter, boolean withheader){
|
||||||
|
|
||||||
|
String withheaderS="";
|
||||||
|
if (withheader)
|
||||||
|
withheaderS = "WITH CSV HEADER";
|
||||||
|
|
||||||
|
return "COPY "+table+" TO '"+file+"' DELIMITERS '"+delimiter+"' WITH NULL AS 'null string' "+withheaderS;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public static String updateTableColumnFromOther(String tableName, String fieldToUpdate,String otherTable,String otherColumn,String keyColumn,String otherKeyColumn){
|
public static String updateTableColumnFromOther(String tableName, String fieldToUpdate,String otherTable,String otherColumn,String keyColumn,String otherKeyColumn){
|
||||||
return "UPDATE "+tableName+" SET "+fieldToUpdate+" = "+otherTable+"."+otherColumn+" FROM "+otherTable+" WHERE "+tableName+"."+keyColumn +"="+ otherTable+"."+otherKeyColumn;
|
return "UPDATE "+tableName+" SET "+fieldToUpdate+" = "+otherTable+"."+otherColumn+" FROM "+otherTable+" WHERE "+tableName+"."+keyColumn +"="+ otherTable+"."+otherKeyColumn;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue