2014-04-14 66 views
0

我使用Weka進行文檔分類研究。我需要設定一個基準,以表明我的貢獻會改善分類。但是,在Weka API中使用默認的潛在語義分析會導致OutOfMemory錯誤。WEKA中潛在語義分析的可擴展性

執行一些預處理後,我的數據集由9,603個實例中使用的25,765個屬性組成。這是針對火車組的,對於測試集我有相同數量的類和常規屬性,但在這裏我有3299。

我有8GB的ram,並且已經將Java堆大小設置爲4Gb,但我仍然遇到OutOfMemory錯誤。以下是錯誤消息:

Exception in thread "main" java.lang.OutOfMemoryError: Java heap space 
at weka.core.matrix.Matrix.getArrayCopy(Matrix.java:301) 
at weka.core.matrix.SingularValueDecomposition.<init>(SingularValueDecomposition.java:76) 
at weka.core.matrix.Matrix.svd(Matrix.java:913) 
at weka.attributeSelection.LatentSemanticAnalysis.buildAttributeConstructor(LatentSemanticAnalysis.java:511) 
at weka.attributeSelection.LatentSemanticAnalysis.buildEvaluator(LatentSemanticAnalysis.java:416) 
at weka.attributeSelection.AttributeSelection.SelectAttributes(AttributeSelection.java:596) 
at weka.filters.supervised.attribute.AttributeSelection.batchFinished(AttributeSelection.java:455) 
at weka.filters.Filter.useFilter(Filter.java:682) 
at test.main(test.java:44) 

我已經測試我的代碼以更小的數據集,並有一切正常,因爲它應該,所以它不是一個代碼相關的問題。有人能解釋我如何擴大LSA以適應我的要求嗎?或者還有另一個類似的過程,我可以應用這個更具擴展性的過程?

+1

如果你沒有綁定Weka,gensim有一個非常可靠的/可擴展的LSA實現。 –

+0

@RobNeuhaus感謝您的輸入,但不幸的是,我被綁定到WEKA – RazorAlliance192

+0

http://stackoverflow.com/questions/19067449/increase-heap-to-avoid-out-of-memory-error-in-weka – tazaree

回答

2

你不會喜歡答案,但WEKA無法處理它。無論如何,該實現都使用完整的SVD。所以如果你有超過幾千個數據點,那麼只需要完整的SVD就需要花費大量的時間。

更不用說WEKA使用的內存比一般需要的要多得多。

就這一切而言,Weka創建了一個密集矩陣來執行SVD。您可能使用它來獲取稀疏數據,這將會破壞您使用Weka進行LSA的任何希望。

事實是,你要使用除Weka以外的東西來完成LSA。

+0

事實上,我不喜歡答案,但它回答了我的問題!謝謝 – RazorAlliance192