Esempio n. 1
0
  /** Creates the total selector's set for get all the possible rules */
  private Complejo hazSelectores(Dataset train) {

    Complejo almacenSelectores;
    int nClases = train.getnclases();
    almacenSelectores =
        new Complejo(nClases); // Aqui voy a almacenar los selectores (numVariable,operador,valor)
    Attribute[] atributos = null;
    int num_atributos, type;
    Vector nominalValues;
    atributos = Attributes.getAttributes();
    num_atributos = Attributes.getNumAttributes();
    Selector s;

    for (int i = 0; i < train.getnentradas(); i++) {
      type = atributos[i].getType();
      switch (type) {
        case 0: // NOMINAL
          nominalValues = atributos[i].getNominalValuesList();
          // System.out.print("{");
          for (int j = 0; j < nominalValues.size(); j++) {
            // System.out.print ((String)nominalValues.elementAt(j)+"  ");
            s = new Selector(i, 0, (String) nominalValues.elementAt(j), true); // [atr,op,valor]
            // incluimos tb los valores en double para facilitar algunas funciones
            s.setValor((double) j);
            almacenSelectores.addSelector(s);
            // s.print();
          }
          // System.out.println("}");
          break;
      }
      // System.out.println(num_atributos);
    }
    return almacenSelectores;
  }