public abstract class GraphDriver extends Object
| Constructor and Description |
|---|
GraphDriver() |
| Modifier and Type | Method and Description |
|---|---|
static GraphDriver |
getDefaultDriver()
Get the default graph driver (currently uses the JFreeChart library)
|
static GraphDriver |
getDriver(String driverName)
Factory method for obtaining a named graph driver for producing
graphs
|
abstract 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.
|
abstract JPanel |
getGraphPanelTargets(TSForecaster forecaster,
ErrorModule preds,
List<String> targetNames,
int stepNumber,
int instanceNumOffset,
weka.core.Instances data)
Return the graph encapsulated in a panel.
|
abstract Image |
getImageFromChart(JPanel chart,
int width,
int height)
Get an image representation of the supplied chart.
|
abstract 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
|
abstract void |
saveChartToFile(JPanel chart,
String filename,
int width,
int height)
Save a chart to a file.
|
public static GraphDriver getDriver(String driverName) throws IllegalArgumentException
driverName - the name of the driver to obtainIllegalArgumentException - if the supplied driver name
is unknown.public static GraphDriver getDefaultDriver()
public abstract void saveChartToFile(JPanel chart, String filename, int width, int height) throws Exception
chart - 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 abstract Image getImageFromChart(JPanel chart, int width, int height) throws Exception
chart - 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 abstract JPanel getGraphPanelTargets(TSForecaster forecaster, ErrorModule preds, List<String> targetNames, int stepNumber, int instanceNumOffset, weka.core.Instances data) throws Exception
width - 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 abstract JPanel getGraphPanelSteps(TSForecaster forecaster, List<ErrorModule> preds, String targetName, List<Integer> stepsToPlot, int instanceNumOffset, weka.core.Instances data) throws Exception
forecaster - 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 abstract JPanel getPanelFutureForecast(TSForecaster forecaster, List<List<weka.classifiers.evaluation.NumericPrediction>> preds, List<String> targetNames, weka.core.Instances history) throws Exception
forecaster - 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.