項目首頁:
http://code.google.com/p/python-data-mining-platform/ (可能需翻牆)
目前已經在該googlecode中加入了Tutorial等內容,可以在wiki中查看
項目介紹(複製自項目首頁的說明):
這是一個能夠根據來源資料(比如說用csv格式表示的矩陣,或者中文文檔)使用多種多樣的演算法去得到結果的一個平台。
演算法能夠通過xml設定檔去一個一個的運行,比如在開始的時候,我們可以先運行一下主成分分析演算法去做特種選擇,然後我們再運行隨機森林演算法來做分類。
目前演算法主要是針對那些單機能夠完成的任務,該架構良好的擴充性能夠讓你在很短的時間內完成自己想要的演算法,並且用於工程之中(相信我,肯定比Weka更快更好)。該項目的另一個特色是能夠很好的支援中文文本的分類、聚類等操作。
只需要寫下下面的程式,就能夠得到神奇的結果(對文本進行特徵選取、得到naive bayes分類模型,並且預測):
1: #load config
2: config = Configuration.FromFile("conf/test.xml")
3: PyMining.Init(config, "__global__")
4:
5: #get matrix from source text
6: matCreater = ClassifierMatrix(config, "__matrix__")
7: [trainx, trainy] = matCreater.CreateTrainMatrix("data/train.txt")
8:
9: #get chi square filter
10: chiFilter = ChiSquareFilter(config, "__filter__")
11: chiFilter.TrainFilter(trainx, trainy)
12:
13: #runs naive-bayes model to get model
14: nbModel = TwcNaiveBayes(config, "twc_naive_bayes")
15: nbModel.Train(trainx, trainy)
16:
17: #using the model to predict an unseen doc to target class
18: [testx, testy] = matCreater.CreatePredictMatrix("data/test.txt")
19: [testx, testy] = chiFilter.MatrixFilter(testx, testy)
20: retY = nbModel.TestMatrix(testx, testy)
目前的版本:
Ver 0.1(第二個開發版)
Features:
上一版的Feature:
- 能夠支援中文文本輸入,並且對其進行分詞等操作,作為分類的來源資料
- 帶有卡方檢測(chi square test)的特徵詞選取器(feature selector)
- 參數的調整(parameter tuning)支援通過xml設定檔進行
新增Feature:
- 加入了K-Means演算法,能夠對文本進行聚類
- 加入了基於補集的樸素貝葉斯演算法,大大提升了分類的準確率,目前該演算法在搜狗實驗室文本分類資料中,對20000篇、8分類左右的資料的預測準確率在90%左右
- 加入了Sogou實驗室文本分類資料的匯入器,可以進行更多的實驗
擷取PyMining:
於http://code.google.com/p/python-data-mining-platform/downloads/detail?name=pymining_0_1.zip&can=2&q=#makechanges,可擷取目前最新的ver 0.1版(可能需要翻牆)
不用翻牆的版本:http://files.cnblogs.com/LeftNotEasy/pymining_0_1.zip