use of edu.neu.ccs.pyramid.configuration.Config in project pyramid by cheng-li.
the class ArffFormat method writeConfigFile.
private static void writeConfigFile(RegDataSet dataSet, File arffFile) {
File configFile = new File(arffFile, ARFF_CONFIG_FILE_NAME);
Config config = new Config();
config.setInt(ARFF_CONFIG_NUM_DATA_POINTS, dataSet.getNumDataPoints());
config.setInt(ARFF_CONFIG_NUM_FEATURES, dataSet.getNumFeatures());
try {
config.store(configFile);
} catch (Exception e) {
e.printStackTrace();
}
}
use of edu.neu.ccs.pyramid.configuration.Config in project pyramid by cheng-li.
the class ArffFormat method writeConfigFile.
private static void writeConfigFile(ClfDataSet dataSet, File arffFile) {
File configFile = new File(arffFile, ARFF_CONFIG_FILE_NAME);
Config config = new Config();
config.setInt(ARFF_CONFIG_NUM_DATA_POINTS, dataSet.getNumDataPoints());
config.setInt(ARFF_CONFIG_NUM_FEATURES, dataSet.getNumFeatures());
config.setInt(ARFF_CONFIG_NUM_CLASSES, dataSet.getNumClasses());
try {
config.store(configFile);
} catch (Exception e) {
e.printStackTrace();
}
}
use of edu.neu.ccs.pyramid.configuration.Config in project pyramid by cheng-li.
the class ArffFormat method writeConfigFile.
private static void writeConfigFile(MultiLabelClfDataSet dataSet, File arffFile) {
File configFile = new File(arffFile, ARFF_CONFIG_FILE_NAME);
Config config = new Config();
config.setInt(ARFF_CONFIG_NUM_DATA_POINTS, dataSet.getNumDataPoints());
config.setInt(ARFF_CONFIG_NUM_FEATURES, dataSet.getNumFeatures());
config.setInt(ARFF_CONFIG_NUM_CLASSES, dataSet.getNumClasses());
try {
config.store(configFile);
} catch (Exception e) {
e.printStackTrace();
}
}
use of edu.neu.ccs.pyramid.configuration.Config in project pyramid by cheng-li.
the class IndexChecker 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]);
System.out.println(config);
ESIndex index = loadIndex(config);
List<String> fields = config.getStrings("fieldsToCheck");
for (String field : fields) {
check(index, field);
}
for (String field : fields) {
checkEmpty(index, field);
}
index.close();
}
use of edu.neu.ccs.pyramid.configuration.Config in project pyramid by cheng-li.
the class MLTrec2LibSvm method main.
public static void main(String[] args) throws Exception {
Config config = new Config(args[0]);
System.out.println(config);
List<String> trecs = config.getStrings("trec");
List<String> libSVMs = config.getStrings("libSVM");
for (int i = 0; i < trecs.size(); i++) {
MultiLabelClfDataSet trecDataset = TRECFormat.loadMultiLabelClfDataSet(new File(trecs.get(i)), DataSetType.ML_CLF_SPARSE, false);
System.out.println(i + " -- Translating on trecs: " + trecs.get(i));
LibSvmFormat.save(trecDataset, libSVMs.get(i));
}
}
Aggregations