|
13 | 13 | * along with this program. If not, see <http://www.gnu.org/licenses/>.
|
14 | 14 | */
|
15 | 15 |
|
16 |
| -/** |
| 16 | +/* |
17 | 17 | * IncrementalPerformance.java
|
18 |
| - * Copyright (C) 2015 University of Waikato, Hamilton, NZ |
| 18 | + * Copyright (C) 2015-2024 University of Waikato, Hamilton, NZ |
19 | 19 | */
|
20 | 20 |
|
21 | 21 | package meka.gui.explorer.classify;
|
22 | 22 |
|
23 | 23 | import meka.classifiers.multilabel.IncrementalMultiLabelClassifier;
|
24 | 24 | import meka.core.Result;
|
25 | 25 | import meka.gui.core.ResultHistoryList;
|
| 26 | +import nz.ac.waikato.cms.gui.core.GUIHelper; |
26 | 27 | import weka.core.Instances;
|
27 | 28 | import weka.gui.visualize.PlotData2D;
|
28 | 29 | import weka.gui.visualize.ThresholdVisualizePanel;
|
|
34 | 35 | import java.awt.event.ActionListener;
|
35 | 36 |
|
36 | 37 | /**
|
37 |
| - * Allows the user to displays graphs of the performance of an incremental classifier if available. |
| 38 | + * Allows the user to display graphs of the performance of an incremental classifier if available. |
38 | 39 | *
|
39 | 40 | * @author FracPete (fracpete at waikato dot ac dot nz)
|
40 |
| - * @version $Revision$ |
41 | 41 | */
|
42 | 42 | public class IncrementalPerformance
|
43 | 43 | extends AbstractClassifyResultHistoryPlugin {
|
@@ -119,6 +119,10 @@ public void actionPerformed(ActionEvent e) {
|
119 | 119 | dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
|
120 | 120 | dialog.getContentPane().setLayout(new BorderLayout());
|
121 | 121 | Instances performance = (Instances) result.getMeasurement(RESULTS_SAMPLED_OVER_TIME);
|
| 122 | + if (performance == null) { |
| 123 | + GUIHelper.showErrorMessage(getOwner().getParent(), "No performance data available for plotting! The classifier needs to be evaluated in prequential or batch-incremental mode."); |
| 124 | + return; |
| 125 | + } |
122 | 126 | try {
|
123 | 127 | VisualizePanel panel = createPanel(performance);
|
124 | 128 | dialog.getContentPane().add(panel, BorderLayout.CENTER);
|
|
0 commit comments