-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathContenedor.java
72 lines (59 loc) · 2.42 KB
/
Contenedor.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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
import java.io.Serializable;
public class Contenedor implements Serializable{
/**
*
*/
private static final long serialVersionUID = -8976325939990349058L;
public static final String INSTANCIAS_PATH = ".//dataset//";
public static final String[] instancias_file = {"synthetic//50B2C2.data", "synthetic//100B1C2.data", "synthetic//100B3C2.data"};
// public static final String[] instancias_file = {"test.data", "ruspini.data" , "synthetic//150B2C3.data"};
// public static final String[] validacion_file = {"test.data", "ruspini.data", "iris.data", "vowel.data","synthetic//150B2C3.data", "synthetic//200B2C4.data", "synthetic//1000B2C2.data","synthetic//3000B1C3.data", "synthetic//3000B3C2.data", "synthetic//5000B2C3.data", "synthetic//5000B3C4.data", "synthetic//10000B1C6.data", "synthetic//10000B2C7.data"};
public static final String[] validacion_file = {"test.data", "ruspini.data", "iris.data", "vowel.data","synthetic//150B2C3.data", "synthetic//200B2C4.data", "synthetic//1000B2C2.data", "synthetic//1000B3C3.data"};
// public static final String[] validacion_file = {"iris.data", "vowel.data", "synthetic//50B2C2.data","synthetic//100B1C2.data", "synthetic//100B3C2.data", "synthetic//200B2C4.data", "synthetic//1000B2C2.data", "synthetic//1000B3C3.data"};
private boolean isLoad = false;
public ConjuntoInstancia instancias = new ConjuntoInstancia();
public int cantidaderrores = 0;
public static final double alfa = 0.794;
public static final double beta = 0.105;
public static final double gama = 0.1;
public Contenedor(ConjuntoInstancia instancias2) {
instancias = new ConjuntoInstancia(instancias2);
isLoad = true;
}
public Contenedor() {
}
public boolean isLoad(){
return isLoad;
}
public boolean load(){
if(!isLoad){
for (int a=0; a < instancias_file.length; a++) {
try{
Instancia ins = new Instancia(INSTANCIAS_PATH, instancias_file[a], alfa, beta, gama);
ins.load();
instancias.add(ins);
}
catch (Exception e) {
e.printStackTrace(System.out);
return false;
}
}
isLoad = true;
}
return isLoad;
}
public void loadvalidacion(){
instancias = new ConjuntoInstancia();
isLoad = true;
for (int a=0; a < validacion_file.length; a++) {
try{
Instancia ins = new Instancia(INSTANCIAS_PATH, validacion_file[a], alfa, beta, gama);
ins.load();
instancias.add(ins);
}
catch (Exception e) {
e.printStackTrace(System.out);
}
}
}
}