use of java.util.logging.SimpleFormatter in project pyramid by cheng-li.
the class Calibration method main.
public static void main(Config config) throws Exception {
Logger logger = Logger.getAnonymousLogger();
String logFile = config.getString("output.log");
FileHandler fileHandler = null;
if (!logFile.isEmpty()) {
new File(logFile).getParentFile().mkdirs();
// todo should append?
fileHandler = new FileHandler(logFile, true);
java.util.logging.Formatter formatter = new SimpleFormatter();
fileHandler.setFormatter(formatter);
logger.addHandler(fileHandler);
logger.setUseParentHandlers(false);
}
logger.info(config.toString());
if (config.getBoolean("calibrate")) {
calibrate(config, logger);
}
if (config.getBoolean("test")) {
test(config, logger);
}
if (fileHandler != null) {
fileHandler.close();
}
}
use of java.util.logging.SimpleFormatter in project pyramid by cheng-li.
the class AppBRGB method main.
public static void main(String[] args) throws Exception {
if (args.length != 1) {
throw new IllegalArgumentException("Please specify a properties file.");
}
Config config = new Config(args[0]);
Logger logger = Logger.getAnonymousLogger();
String logFile = config.getString("output.log");
FileHandler fileHandler = null;
if (!logFile.isEmpty()) {
new File(logFile).getParentFile().mkdirs();
// todo should append?
fileHandler = new FileHandler(logFile, true);
java.util.logging.Formatter formatter = new SimpleFormatter();
fileHandler.setFormatter(formatter);
logger.addHandler(fileHandler);
logger.setUseParentHandlers(false);
}
logger.info(config.toString());
if (fileHandler != null) {
fileHandler.close();
}
File output = new File(config.getString("output.folder"));
output.mkdirs();
Config app1Config = createApp1Config(config);
Config app2Config = createGBConfig(config);
Config calConfig = createBRCalibrationConfig(config);
Config predictConfig = createBRPredictionConfig(config);
Config autoConfig = createBRAutomationConfig(config);
App1.main(app1Config);
BRGB.main(app2Config);
BRCalibration.main(calConfig);
BRPrediction.reportValid(predictConfig);
BRAutomation.tuneThreshold(autoConfig);
BRPrediction.reportTest(predictConfig);
BRAutomation.showTestPerformance(autoConfig);
}
use of java.util.logging.SimpleFormatter in project pyramid by cheng-li.
the class AppCombSUM method main.
public static void main(String[] args) throws Exception {
if (args.length != 1) {
throw new IllegalArgumentException("Please specify a properties file.");
}
Config config = new Config(args[0]);
Logger logger = Logger.getAnonymousLogger();
String logFile = config.getString("output.log");
FileHandler fileHandler = null;
if (!logFile.isEmpty()) {
new File(logFile).getParentFile().mkdirs();
// todo should append?
fileHandler = new FileHandler(logFile, true);
Formatter formatter = new SimpleFormatter();
fileHandler.setFormatter(formatter);
logger.addHandler(fileHandler);
logger.setUseParentHandlers(false);
}
logger.info(config.toString());
File output = new File(config.getString("output.folder"));
output.mkdirs();
if (config.getBoolean("calibrate")) {
calibrate(config, logger);
}
if (config.getBoolean("validate")) {
report(config, config.getString("validFolder"));
}
if (config.getBoolean("tuneThreshold")) {
tuneThreshold(config, logger);
}
if (config.getBoolean("test")) {
report(config, config.getString("testFolder"));
testAutomation(config, logger);
}
if (fileHandler != null) {
fileHandler.close();
}
}
use of java.util.logging.SimpleFormatter in project pyramid by cheng-li.
the class GBRegressor method main.
public static void main(String[] args) throws Exception {
if (args.length != 1) {
throw new IllegalArgumentException("Please specify a properties file.");
}
Config config = new Config(args[0]);
Logger logger = Logger.getAnonymousLogger();
String logFile = config.getString("output.log");
FileHandler fileHandler = null;
if (!logFile.isEmpty()) {
new File(logFile).getParentFile().mkdirs();
// todo should append?
fileHandler = new FileHandler(logFile, true);
java.util.logging.Formatter formatter = new SimpleFormatter();
fileHandler.setFormatter(formatter);
logger.addHandler(fileHandler);
logger.setUseParentHandlers(false);
}
logger.info(config.toString());
if (config.getBoolean("train")) {
train(config, logger);
}
if (config.getBoolean("test")) {
test(config, logger);
}
if (fileHandler != null) {
fileHandler.close();
}
}
use of java.util.logging.SimpleFormatter in project pyramid by cheng-li.
the class GBRegressor method main.
public static void main(Config config) throws Exception {
Logger logger = Logger.getAnonymousLogger();
String logFile = config.getString("output.log");
FileHandler fileHandler = null;
if (!logFile.isEmpty()) {
new File(logFile).getParentFile().mkdirs();
// todo should append?
fileHandler = new FileHandler(logFile, true);
java.util.logging.Formatter formatter = new SimpleFormatter();
fileHandler.setFormatter(formatter);
logger.addHandler(fileHandler);
logger.setUseParentHandlers(false);
}
logger.info(config.toString());
if (config.getBoolean("train")) {
train(config, logger);
}
if (config.getBoolean("test")) {
test(config, logger);
}
if (fileHandler != null) {
fileHandler.close();
}
}
Aggregations