use of com.alibaba.alink.pipeline.classification.Softmax in project Alink by alibaba.
the class Chap12 method c_5.
static void c_5() throws Exception {
AkSourceBatchOp train_data = new AkSourceBatchOp().setFilePath(DATA_DIR + TRAIN_FILE);
AkSourceBatchOp test_data = new AkSourceBatchOp().setFilePath(DATA_DIR + TEST_FILE);
new Softmax().setFeatureCols(FEATURE_COL_NAMES).setLabelCol(LABEL_COL_NAME).setPredictionCol(PREDICTION_COL_NAME).enableLazyPrintTrainInfo().enableLazyPrintModelInfo().fit(train_data).transform(test_data).link(new EvalMultiClassBatchOp().setLabelCol(LABEL_COL_NAME).setPredictionCol(PREDICTION_COL_NAME).lazyPrintMetrics("Softmax"));
BatchOperator.execute();
}
use of com.alibaba.alink.pipeline.classification.Softmax in project Alink by alibaba.
the class Chap25 method softmax.
public static void softmax(BatchOperator<?> train_set, BatchOperator<?> test_set) throws Exception {
BatchOperator.setParallelism(1);
new Pipeline().add(new Softmax().setVectorCol("vec").setLabelCol("label").setPredictionCol("pred")).fit(train_set).transform(test_set).link(new EvalMultiClassBatchOp().setLabelCol("label").setPredictionCol("pred").lazyPrintMetrics());
BatchOperator.execute();
}
use of com.alibaba.alink.pipeline.classification.Softmax in project Alink by alibaba.
the class Chap13 method c_2.
static void c_2() throws Exception {
AkSourceBatchOp train_data = new AkSourceBatchOp().setFilePath(DATA_DIR + SPARSE_TRAIN_FILE);
AkSourceBatchOp test_data = new AkSourceBatchOp().setFilePath(DATA_DIR + SPARSE_TEST_FILE);
new Softmax().setVectorCol(VECTOR_COL_NAME).setLabelCol(LABEL_COL_NAME).setPredictionCol(PREDICTION_COL_NAME).enableLazyPrintTrainInfo().enableLazyPrintModelInfo().fit(train_data).transform(test_data).link(new EvalMultiClassBatchOp().setLabelCol(LABEL_COL_NAME).setPredictionCol(PREDICTION_COL_NAME).lazyPrintMetrics("Softmax"));
BatchOperator.execute();
}
Aggregations