Example usage for weka.core Instance toString

List of usage examples for weka.core Instance toString

Introduction

In this page you can find the example usage for weka.core Instance toString.

Prototype

public String toString(Attribute att);

Source Link

Document

Returns the description of one value of the instance as a string.

Usage

From source file:Windows.windowGenerating.java

public static void infoObj() throws Exception {
    Instances data = loadData("./src/date/osmolski.arff");

    for (int i = 0; i < data.numInstances(); i++) //Przegladanie obiektow
    {/*  www. java2s  . co  m*/
        System.out.println("Wiersz numer " + i + ":");

        Instance instance = data.instance(i); //Pobranie obiektu (wiersza danych) o podanym numerze

        for (int j = 0; j < instance.numAttributes(); j++) //Przegladanie atrybutow w obiekcie
        {
            String textValue = instance.toString(j); //Pobranie wartosci atrybutu o podanym numerze (tzn. pobranie tekstowej reprezentacji wartosci)
            System.out.print(textValue + ", ");
        }
        System.out.println();
    }

}

From source file:Windows.windowWEKA.java

public static void infoObj() throws Exception {
    for (int i = 0; i < data.numInstances(); i++) { //Przegladanie obiektow
        System.out.println("Wiersz numer " + i + ":");

        Instance instance = data.instance(i); //Pobranie obiektu (wiersza danych) o podanym numerze

        for (int j = 0; j < instance.numAttributes(); j++) //Przegladanie atrybutow w obiekcie
        {//from   w ww.  java 2  s  .c o  m
            String textValue = instance.toString(j); //Pobranie wartosci atrybutu o podanym numerze (tzn. pobranie tekstowej reprezentacji wartosci)
            System.out.print(textValue + ", ");
        }
        System.out.println();
    }

}