public class JFreeChartDriver extends GraphDriver
| Constructor and Description |
|---|
JFreeChartDriver() |
| Modifier and Type | Method and Description |
|---|---|
JPanel |
getGraphPanelSteps(TSForecaster forecaster,
List<ErrorModule> preds,
String targetName,
List<Integer> stepsToPlot,
int instanceNumOffset,
weka.core.Instances data)
Return the graph encapsulated in a JPanel.
|
JPanel |
getGraphPanelTargets(TSForecaster forecaster,
ErrorModule preds,
List<String> targetNames,
int stepNumber,
int instanceNumOffset,
weka.core.Instances data)
Return the graph encapsulated in a panel.
|
Image |
getImageFromChart(JPanel chart,
int width,
int height)
Get an image representation of the supplied chart.
|
JPanel |
getPanelFutureForecast(TSForecaster forecaster,
List<List<weka.classifiers.evaluation.NumericPrediction>> preds,
List<String> targetNames,
weka.core.Instances history)
Return the graph encapsulated in a JPanel
|
void |
saveChartToFile(JPanel chart,
String filename,
int width,
int height)
Save a chart to a file.
|
getDefaultDriver, getDriverpublic void saveChartToFile(JPanel chart, String filename, int width, int height) throws Exception
saveChartToFile in class GraphDriverchart - the chart to savefilename - the filename to save towidth - width of the saved imageheight - height of the saved imageException - if the chart can't be saved for some reasonpublic Image getImageFromChart(JPanel chart, int width, int height) throws Exception
getImageFromChart in class GraphDriverchart - the chart to get an image of.width - width of the chartheight - height of the chartException - if the image can't be created for some reasonpublic JPanel getGraphPanelTargets(TSForecaster forecaster, ErrorModule preds, List<String> targetNames, int stepNumber, int instanceNumOffset, weka.core.Instances data) throws Exception
getGraphPanelTargets in class GraphDriverwidth - the width in pixels of the graphheight - the height in pixels of the graphforecaster - the forecasterpreds - an ErrorModule that contains predictions for all targets for
the specified step ahead. Targets are in the same order returned
by TSForecaster.getFieldsToForecast()targetNames - the list of target names to plotstepNumber - which step ahead to graph for specified targetsinstanceNumOffset - how far into the data the predictions start fromdata - the instances that these predictions correspond to (may be
null)Exceptionpublic JPanel getGraphPanelSteps(TSForecaster forecaster, List<ErrorModule> preds, String targetName, List<Integer> stepsToPlot, int instanceNumOffset, weka.core.Instances data) throws Exception
getGraphPanelSteps in class GraphDriverforecaster - the forecasterpreds - a list of ErrorModules, one for each consecutive step ahead
prediction settargetName - the name of the target field to plotstepsToPlot - a list of step numbers for the step-ahead prediction
sets to plot to plot for the specified target.instanceNumOffset - how far into the data the predictions start fromdata - the instances that these predictions correspond to (may be
null)Exceptionpublic JPanel getPanelFutureForecast(TSForecaster forecaster, List<List<weka.classifiers.evaluation.NumericPrediction>> preds, List<String> targetNames, weka.core.Instances history) throws Exception
getPanelFutureForecast in class GraphDriverforecaster - the forecasterpreds - a list of list of predictions for *all* targets. The outer
list is indexed by step number (i.e. the first entry is the 1-step
ahead forecasts, the second is the 2-steps ahead forecasts etc.)
and the inner list is indexed by target in the same order as the
list of targets returned by TSForecaster.getFieldsToForecast().targetNames - the list of target names to plothistory - a set of instances from which predictions are assumed to
follow on from. May be null, in which case just the predictions
are plotted.ExceptionCopyright © 2019 University of Waikato, Hamilton, NZ. All Rights Reserved.