1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 package de.fu_berlin.ties.eval;
23
24 import de.fu_berlin.ties.io.Storable;
25
26 /***
27 * A read-only view of the evaluation results calculated by the
28 * {@link de.fu_berlin.ties.eval.FMetrics} class and the underlying raw counts.
29 *
30 * @author Christian Siefkes
31 * @version $Revision: 1.3 $, $Date: 2004/10/11 15:30:41 $, $Author: siefkes $
32 */
33 public interface FMetricsView extends EvalInput, Storable {
34
35 /***
36 * Returns the F-measure, setting <em>alpha</em> = 0.5 so <em>P</em> and
37 * <em>R</em> are weighted equal ("F1 measure").
38 * F1 = (2 * <em>P</em> * <em>R</em>) / (<em>P</em> + <em>R</em>).
39 *
40 * @return the F1 measure; a value in the range from 0.0 to 1.0
41 */
42 double getF1Measure();
43
44 /***
45 * Returns the F-measure: F = 1 / (<em>alpha</em> * (1/<em>P</em>)
46 * + (1-<em>alpha</em>) * (1/<em>R</em>)). <br>
47 * <em>F</em> is defined to be 0 if <em>P</em> = 0 or <em>R</em> = 0.
48 *
49 * @param alpha a factor in the range from 0.0 to 1.0 defining the weighting
50 * of precision and recall
51 * @return the F-measure; a value in the range from 0.0 to 1.0
52 * @throws IllegalArgumentException if <code>alpha</code> is smaller than
53 * 0.0 or larger than 1.0
54 */
55 double getFMeasure(final double alpha) throws IllegalArgumentException;
56
57 /***
58 * Returns the precision: <em>P</em> =
59 * <em>tp</em> / (<em>tp</em> + <em>fp</em>).
60 * @return the precision; a value in the range from 0.0 to 1.0
61 */
62 double getPrecision();
63
64 /***
65 * Returns the recall: <em>R</em> =
66 * <em>tp</em> / (<em>tp</em> + <em>fn</em>).
67 * @return the precision; a value in the range from 0.0 to 1.0
68 */
69 double getRecall();
70
71 }