-
Notifications
You must be signed in to change notification settings - Fork 0
/
InterraterAgreement.java
34 lines (27 loc) · 1.02 KB
/
InterraterAgreement.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/*
@author Victor Lúcio
Federal University of São Paulo - ICT/UNIFESP
"A Classifiers Fusion System Applied to Fenology"
Multiple Classifier System
from: Faria, Fabio "A Framework for Pattern Classifier Selection and Fusion", 2014
Advisors: Jurandy Gomes de Almeida Junior <http://buscatextual.cnpq.br/buscatextual/visualizacv.do?id=K4736755E0>
Fabio Augusto Faria <http://buscatextual.cnpq.br/buscatextual/visualizacv.do?id=K4266712J6>
*/
import java.util.*;
public class InterraterAgreement extends AbstractDiversityMeasure{
public InterraterAgreement(){
super();
}
public double measure(ArrayList<Boolean> c1, ArrayList<Boolean> c2){
double[] v = new double[4];
v = this.correlation(c1,c2);
return(2*(v[0]*v[2]-v[1]*v[3])/(((v[0]+v[1])*(v[2]+v[3]))+((v[0]+v[2])*(v[1]+v[3]))));
}
public int compare(Double o1, Double o2){ //quanto menor, maior a diversidade
if(Double.compare(o1, o2) == 1)
return(-1);
if(Double.compare(o1, o2) == -1)
return(1);
return(0);
}
}