WekaForecaster 图形访问
WekaForecaster Graph Access
是否可以访问 WekaForecaster API 生成的图表,如在 Weka Explorer 中可见。我看到 API 本身没有任何函数访问权限。谢谢!
我找到了答案。
- 创建一个 TSEvaluation 对象
- 调用 evaluateForecaster(TSForecaster forecaster, boolean buildModel, java.io.PrintStream... progress)
- 调用 graphFutureForecastOnTesting(GraphDriver driver, TSForecaster forecaster, java.util.List targetNames) which returns JPanel
例如-
// Your instances
Instances train;
// Your WekaForecaster
WekaForecaster forecaster;
...
// Custom hold out set size
int holdOutSetSize = 1;
// Init evaluator
TSEvaluation eval = new TSEvaluation(train, holdOutSetSize);
boolean buildModel = false;
// Evaluate the forecaster
eval.evaluateForecaster(forecaster, buildModel, System.out);
// Get graph in JPanel after evaluation on training with custom hold out set size
JPanel trainGraph = eval.graphFutureForecastOnTraining(GraphDriver.getDefaultDriver(),
forecaster, AbstractForecaster.
stringToList(forecaster.getFieldsToForecast()));
干杯!
是否可以访问 WekaForecaster API 生成的图表,如在 Weka Explorer 中可见。我看到 API 本身没有任何函数访问权限。谢谢!
我找到了答案。
- 创建一个 TSEvaluation 对象
- 调用 evaluateForecaster(TSForecaster forecaster, boolean buildModel, java.io.PrintStream... progress)
- 调用 graphFutureForecastOnTesting(GraphDriver driver, TSForecaster forecaster, java.util.List targetNames) which returns JPanel
例如-
// Your instances
Instances train;
// Your WekaForecaster
WekaForecaster forecaster;
...
// Custom hold out set size
int holdOutSetSize = 1;
// Init evaluator
TSEvaluation eval = new TSEvaluation(train, holdOutSetSize);
boolean buildModel = false;
// Evaluate the forecaster
eval.evaluateForecaster(forecaster, buildModel, System.out);
// Get graph in JPanel after evaluation on training with custom hold out set size
JPanel trainGraph = eval.graphFutureForecastOnTraining(GraphDriver.getDefaultDriver(),
forecaster, AbstractForecaster.
stringToList(forecaster.getFieldsToForecast()));
干杯!