use of org.apache.sdap.mudrod.main.MudrodEngine in project incubator-sdap-mudrod by apache.
the class MudrodContextListener method contextInitialized.
/**
* @see ServletContextListener#contextInitialized(ServletContextEvent)
*/
@Override
public void contextInitialized(ServletContextEvent arg0) {
me = new MudrodEngine();
Properties props = me.loadConfig();
me.setESDriver(new ESDriver(props));
me.setSparkDriver(new SparkDriver(props));
ServletContext ctx = arg0.getServletContext();
Searcher searcher = new Searcher(props, me.getESDriver(), null);
Ranker ranker = new Ranker(props, me.getESDriver(), me.getSparkDriver());
ctx.setAttribute("MudrodInstance", me);
ctx.setAttribute("MudrodSearcher", searcher);
ctx.setAttribute("MudrodRanker", ranker);
}
use of org.apache.sdap.mudrod.main.MudrodEngine in project incubator-sdap-mudrod by apache.
the class HybridRecommendation method main.
public static void main(String[] args) throws IOException {
MudrodEngine me = new MudrodEngine();
Properties props = me.loadConfig();
ESDriver es = new ESDriver(me.getConfig());
HybridRecommendation test = new HybridRecommendation(props, es, null);
// String input = "NSCAT_LEVEL_1.7_V2";
String input = "AQUARIUS_L3_SSS_SMIA_MONTHLY-CLIMATOLOGY_V4";
JsonObject json = test.getRecomDataInJson(input, 10);
System.out.println(json.toString());
}
use of org.apache.sdap.mudrod.main.MudrodEngine in project incubator-sdap-mudrod by apache.
the class ESDriver method main.
/**
* Main method used to invoke the ESDriver implementation.
*
* @param args no arguments are required to invoke the Driver.
*/
public static void main(String[] args) {
MudrodEngine mudrodEngine = new MudrodEngine();
ESDriver es = new ESDriver(mudrodEngine.loadConfig());
es.getTypeListWithPrefix("podaacsession", "sessionstats");
}
use of org.apache.sdap.mudrod.main.MudrodEngine in project incubator-sdap-mudrod by apache.
the class SparkSVM method main.
public static void main(String[] args) {
MudrodEngine me = new MudrodEngine();
JavaSparkContext jsc = me.startSparkDriver().sc;
String path = SparkSVM.class.getClassLoader().getResource("inputDataForSVM_spark.txt").toString();
JavaRDD<LabeledPoint> data = MLUtils.loadLibSVMFile(jsc.sc(), path).toJavaRDD();
// Run training algorithm to build the model.
int numIterations = 100;
final SVMModel model = SVMWithSGD.train(data.rdd(), numIterations);
// Save and load model
model.save(jsc.sc(), SparkSVM.class.getClassLoader().getResource("javaSVMWithSGDModel").toString());
jsc.sc().stop();
}
Aggregations