Package weka.core

Examples of weka.core.Instances.attribute()


      
       System.out.println("\nElapsed time: "+(duration)+"sec");
      
      //test on instance
       Instance instance = new DenseInstance(5);
       instance.setValue(data.attribute("Task"), "chickenpox");
       instance.setValue(data.attribute("Ability"), "pediatrician");
       instance.setValue(data.attribute("Disposition"), "distracted");
       instance.setValue(data.attribute("Cross"), "female");
      
       classifier.testInstance(instance);
View Full Code Here


       System.out.println("\nElapsed time: "+(duration)+"sec");
      
      //test on instance
       Instance instance = new DenseInstance(5);
       instance.setValue(data.attribute("Task"), "chickenpox");
       instance.setValue(data.attribute("Ability"), "pediatrician");
       instance.setValue(data.attribute("Disposition"), "distracted");
       instance.setValue(data.attribute("Cross"), "female");
      
       classifier.testInstance(instance);
      
View Full Code Here

      
      //test on instance
       Instance instance = new DenseInstance(5);
       instance.setValue(data.attribute("Task"), "chickenpox");
       instance.setValue(data.attribute("Ability"), "pediatrician");
       instance.setValue(data.attribute("Disposition"), "distracted");
       instance.setValue(data.attribute("Cross"), "female");
      
       classifier.testInstance(instance);
      
       System.out.println(instance);
View Full Code Here

      //test on instance
       Instance instance = new DenseInstance(5);
       instance.setValue(data.attribute("Task"), "chickenpox");
       instance.setValue(data.attribute("Ability"), "pediatrician");
       instance.setValue(data.attribute("Disposition"), "distracted");
       instance.setValue(data.attribute("Cross"), "female");
      
       classifier.testInstance(instance);
      
       System.out.println(instance);
       //classifier.getWekaDataset().stringFilter();
View Full Code Here

        int c;
        while ((c = is.read()) != -1) {
          txtStr.append((char)c);
        }
        is.close();
        newInst[0] = (double)data.attribute(0).addStringValue(txtStr.toString());
      } catch (Exception e) {
        log.error("Can't find document for stem " + str + ".");
        newInst[0] = Instance.missingValue();
      }
      try {
View Full Code Here

        StringBuffer keyStr = new StringBuffer();
        int c;
        while ((c = is.read()) != -1) {
          keyStr.append((char)c);
        }     
        newInst[1] = (double)data.attribute(1).addStringValue(keyStr.toString());
      } catch (Exception e) {
        log.error("Can't find keyphrases for stem " + str + ".");
        newInst[1] = Instance.missingValue();
      }
      data.add(new Instance(1.0, newInst));
View Full Code Here

        int c;
        while ((c = is.read()) != -1) {
          txtStr.append((char) c);
        }

        newInst[0] = (double) data.attribute(0).addStringValue(txtStr.toString());

      } catch (Exception e) {
        if (m_debug) {
          log.debug("Can't read document " + str + ".txt");
        }
View Full Code Here

        while ((c = is.read()) != -1) {
          keyStr.append((char) c);
        }

        newInst[1] = (double) data.attribute(1).addStringValue(keyStr.toString());
      } catch (Exception e) {
        if (m_debug) {
          log.debug("No existing keyphrases for stem " + str + ".");
        }
        newInst[1] = Instance.missingValue();
View Full Code Here

    for (String fileName : fileNames) {

      double[] newInst = new double[3];

      newInst[0] = (double) data.attribute(0).addStringValue(fileName);
      ;

      File documentTextFile = new File(inputDirectoryName + "/"
          + fileName + ".txt");
      File documentTopicsFile = new File(inputDirectoryName + "/"
View Full Code Here

          txtStr.append((char) c);
        }
        is.close();

        // Adding the text of the document to the instance
        newInst[1] = (double) data.attribute(1).addStringValue(
            txtStr.toString());

      } catch (Exception e) {

        System.err.println("Problem with reading " + documentTextFile);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.