2013-04-06 2 views
0

weka.core.Instances 개체를 공급하는 데 사용되는 데이터베이스의 텍스트가 특정 형식을 준수해야합니까?weka 데이터베이스의 텍스트 형식

Exception in thread "main" 
weka.core.UnsupportedAttributeTypeException: 
    weka.classifiers.functions.SMO: Cannot handle numeric class! at 
    weka.core.Capabilities.test(Unknown Source)  at 
    weka.core.Capabilities.test(Unknown Source)  at 
    weka.core.Capabilities.test(Unknown Source)  at 
    weka.core.Capabilities.testWithFail(Unknown Source)  at 
    weka.classifiers.functions.SMO.buildClassifier(Unknown Source) at 
    Test.main(Test.java:135) 

답변

0

당신에게이 숫자 속성이 있는지 위치 : 난 단지 그 이외의 클래스가 나는 다음과 같은 예외가 속성으로 (weka.experiment.InstanceQuery.query.retrieveInstances()를 통해 데이터베이스에서 공급) 포맷되지 않은 텍스트가 포함 된 weka.core.Instances 객체와 분류를 구축 할 때 클래스 속성이 아닌 것으로 간주됩니다. 귀하의 예외는 Google 검색에서 first hit으로 표시됩니다. 다음 코드를 출력 해 줄 수 있습니까?

Instances data = null; 

    try { 
     DatabaseUtils utils = new DatabaseUtils(); 

     InstanceQuery query = new InstanceQuery(); 

     query.setUsername(username); 
     query.setPassword(password); 
     query.setQuery(pSql); 

     data = query.retrieveInstances(); 
     data.setRelationName(pInstanceRelationName); 


     if (data.classIndex() == -1) 
     { 
      data.setClassIndex(data.numAttributes() - 1); 
     } 
        // this line will print out your header + data. 
        // add your header information to your question. 
     System.out.println(data) 
    } 

     catch (Exception e) { 
     throw new RuntimeException(e); 
    } 
관련 문제