This commit is contained in:
Gianpaolo Coro 2013-06-20 15:51:39 +00:00
parent ca9657079e
commit 0d9731167f
2 changed files with 12 additions and 0 deletions

View File

@ -132,6 +132,7 @@ public class DiscrepancyAnalysis extends DataAnalysis {
output.put("NUMBER_OF_ERRORS", "0");
output.put("NUMBER_OF_COMPARISONS", "" + numberofvectors);
output.put("ACCURACY", "100.0");
output.put("RELATIVE ERROR", "-");
output.put("MAXIMUM_ERROR", "0");
output.put("MAXIMUM_ERROR_POINT", "-");
output.put("COHENS_KAPPA", "1");
@ -172,6 +173,7 @@ public class DiscrepancyAnalysis extends DataAnalysis {
output.put("NUMBER_OF_ERRORS", "" + numberoferrors);
output.put("NUMBER_OF_COMPARISONS", "" + numberofcomparisons);
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_POINT", maxdiscrepancyPoint);
output.put("COHENS_KAPPA", "" + kappa);

View File

@ -181,6 +181,16 @@ public class DatabaseUtils {
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){
return "UPDATE "+tableName+" SET "+fieldToUpdate+" = "+otherTable+"."+otherColumn+" FROM "+otherTable+" WHERE "+tableName+"."+keyColumn +"="+ otherTable+"."+otherKeyColumn;
}