Skip to content Skip to sidebar Skip to footer

Errors When Converting Csv To Arff In Android Using Weka

I'm sing the code and instructions found on the weka site https://weka.wikispaces.com/Converting+CSV+to+ARFF But for some reason its giving me errors. Notice I check to make sure

Solution 1:

try changing your code to

// load CSVCSVLoaderloader=newCSVLoader();
    if(null != inputFile){
        loader.setSource(inputFile);
        data = loader.getDataSet();
    }else{
        Log.e("ERROR","error the input file is null");
    }

try that and tell me if you get an error in the log cat and no Crash

Solution 2:

The source code you linked only contains a comment in weka.core.converters.ConverterUtils.java line 741, so I'm guessing that what you are actually using is the jar from here: https://www.pervasive.jku.at/Teaching/lvaInfo.php?key=346&do=uebungen

The problem there is that in the static class initializer, almost everything is commented out, leaving only line 741 that will fail because the static field m_FileLoaders is still null when m_FileLoaders.size() is called:

/** all available loaders (extension &lt;-&gt; classname). */protectedstatic Hashtable<String,String> m_FileLoaders;
[...]

// determine all loaders/saversstatic {
  Vector classnames;

  try {
    // generate properties // Note: does NOT work with RMI, hence m_FileLoadersCore/m_FileSaversCore/* GenericPropertiesCreator creator = new GenericPropertiesCreator();
       creator.execute(false);
       Properties props = creator.getOutputProperties();
       // init
       m_FileLoaders    = new Hashtable<String,String>();
       [...]
    */
    }
    catch (Exception e) {
      // ignore
    }
    finally {
      // loadersif (m_FileLoaders.size() == 0) {
      /*classnames = GenericObjectEditor.getClassnames(AbstractFileLoader.class.getName());
      [...]
      */
      }
    }
  }

All in all, my best guess is that the jar is broken, so either you fix it yourself or get a non-broken one.

(Btw: Another question with the same problem.)

Post a Comment for "Errors When Converting Csv To Arff In Android Using Weka"