Ejemplo n.º 1
0
  /**
   * It launches the algorithm
   *
   * @param lanzar Chc execute the algorithm class
   * @param fich String file's name
   */
  public void execute(Chc lanzar, String fich) {
    if (somethingWrong) { // We do not execute the program
      System.err.println(
          "An error was found, either the data-set have numerical values or missing values.");
      System.err.println("Aborting the program");
      // We should not use the statement: System.exit(-1);
    } else {
      // We do here the algorithm's operations

      // nClasses = train.getnOutputs();

      // Finally we should fill the training and test output files
      doOutput(this.train, this.outputTr, lanzar);
      doOutput(this.test, this.outputTst, lanzar);
      EscribeBCLing e = new EscribeBCLing();
      e.write(
          fich, lanzar.getEc_tra(), lanzar.getEc_tst(), lanzar.getP().getE().base(), lanzar.getP());
      System.out.println("Algorithm Finished");
    }
  }
Ejemplo n.º 2
0
  /**
   * It returns the algorithm regresion output given an input example
   *
   * @param example double[] The input example
   * @param lanzar
   * @return double the output generated by the algorithm
   */
  private double regressionOutput(double[] example, Chc lanzar) {
    double output = 0.0;
    output = lanzar.getP().getE().base().FLC(example);

    // }
    // FLC();
    /**
     * Here we should include the algorithm directives to generate the classification output from
     * the input example
     */
    return output;
  }
Ejemplo n.º 3
0
  /**
   * It returns the algorithm regresion output given an input example
   *
   * @param example double[] The input example
   * @param lanzar Chc the algorithm class
   * @return double the output generated by the algorithm
   */
  private double regressionOutput(double[] example, Chc lanzar) {
    double output = 0.0;
    // for(int i=0;i<example.length;i++){
    output = lanzar.getP().getE().base().FLC(example);

    /*fichero = "tunlatgcomunTRA.txt";
    	String sal2 = new String("");
    	sal= lanzar.Ectra()+"\n";
    	Fichero.escribeFichero(fichero, sal2);
    	fichero = "tunlatgcomunTST.txt";
    	String sal3 = new String("");
    	sal= lanzar.Ectst()+"\n";
    	Fichero.escribeFichero(fichero, sal3);
    //}
    //FLC();
       /**
         Here we should include the algorithm directives to generate the
         classification output from the input example
        */
    return output;
  }