1. <strong id="7actg"></strong>
    2. <table id="7actg"></table>

    3. <address id="7actg"></address>
      <address id="7actg"></address>
      1. <object id="7actg"><tt id="7actg"></tt></object>

        MILKPython 機器學習工具包

        聯合創(chuàng)作 · 2023-09-26 04:27

        MILK(MACHINE LEARNING TOOLKIT) 是 Python 語言的機器學習工具包。

        它主要是在很多可得到的分類比如 SVMS、K-NN、隨機森林以及決策樹中使用監(jiān)督分類法,它還可執(zhí)行特征選擇。這些分類器在許多方面相結合,可以形成不同的例如無監(jiān)督學習、密切關系傳播和由 MILK 支持的 K-means 聚類等分類系統(tǒng)。

        MILK 關注速度和內存的使用,因此大多數對性能比較敏感的代碼都是用 C++ 編寫的。為了方便起見,基于 Python 實現了接口。

        示例代碼

        測試對一些 features,labels 數據的分類情況,通過交叉驗證測量:

        import numpy as np
        import milk
        features = np.random.rand(100,10) # 2d array of features: 100 examples of 10 features each
        labels = np.zeros(100)
        features[50:] += .5
        labels[50:] = 1
        confusion_matrix, names = milk.nfoldcrossvalidation(features, labels)
        print 'Accuracy:', confusion_matrix.trace()/float(confusion_matrix.sum())

        如果想要使用分類器,可以創(chuàng)建一個 learner object 并調用它的 train() 方法:

        import numpy as np
        import milk
        features = np.random.rand(100,10)
        labels = np.zeros(100)
        features[50:] += .5
        labels[50:] = 1
        learner = milk.defaultclassifier()
        model = learner.train(features, labels)
        # Now you can use the model on new examples:
        example = np.random.rand(10)
        print model.apply(example)
        example2 = np.random.rand(10)
        example2 += .5
        print model.apply(example2)

        特性

        • 支持向量機。使用封裝了 pythonesque 的 libsvm solver

        • LASSO 算法

        • K-means 使用的內存小,可有效地對數百萬個實例進行集群

        • 隨機森林

        • 自組織地圖

        • 逐步判別分析特征選擇

        • 非負矩陣分解(Non-negative Matrix Factorization,NMF)算法

        • AP(Affinity Propagation)聚類算法

        瀏覽 22
        點贊
        評論
        收藏
        分享

        手機掃一掃分享

        編輯 分享
        舉報
        評論
        圖片
        表情
        推薦
        點贊
        評論
        收藏
        分享

        手機掃一掃分享

        編輯 分享
        舉報
        1. <strong id="7actg"></strong>
        2. <table id="7actg"></table>

        3. <address id="7actg"></address>
          <address id="7actg"></address>
          1. <object id="7actg"><tt id="7actg"></tt></object>
            第一次做受被躁爽到高潮 | 97人人爽人人模人人38tv | 操逼www..com | 国产97在线观看 | 一区二区三区日韩免费 | 中国无码电影 | www.17c久久久嫩草成人 | 国产精品V无码A片在线看吃奶 | 淫荡自拍| 国产午夜精品一区二区 |