机器学习框架 KeystoneML

码农软件 · 软件分类 · 机器学习/深度学习 · 2019-08-07 10:28:05

软件介绍

KeystoneML 是一个用 Scala 编写的软件框架,来自伯克利大学 AMPLab 实验室。该项目主要目的是简化构造大规模、端到端的机器学习管道,基于 Apache Spark 构建。

示例代码:

val trainData = NewsGroupsDataLoader(sc, trainingDir)

val predictor = Trim.then(LowerCase())
  .then(Tokenizer())
  .then(new NGramsFeaturizer(1 to conf.nGrams))
  .then(TermFrequency(x => 1))
  .thenEstimator(CommonSparseFeatures(conf.commonFeatures))
  .fit(trainData.data)
  .thenLabelEstimator(NaiveBayesEstimator(numClasses))
  .fit(trainData.data, trainData.labels)
  .then(MaxClassifier)

测试:

val test = NewsGroupsDataLoader(sc, testingDir)
val predictions = predictor(test.data)
val eval = MulticlassClassifierEvaluator(predictions, test.labels, numClasses)

println(eval.summary(newsgroupsData.classes))

输出:

Avg Accuracy:    0.980
Macro Precision:0.816
Macro Recall:    0.797
Macro F1:    0.797
Total Accuracy:    0.804
Micro Precision:0.804
Micro Recall:    0.804
Micro F1:    0.804

本文地址:https://codercto.com/soft/d/11830.html

Professional JavaScript for Web Developers

Professional JavaScript for Web Developers

Nicholas C. Zakas / Wrox / 2009-1-14 / USD 49.99

This eagerly anticipated update to the breakout book on JavaScript offers you an in-depth look at the numerous advances to the techniques and technology of the JavaScript language. You'll see why Java......一起来看看 《Professional JavaScript for Web Developers》 这本书的介绍吧!

CSS 压缩/解压工具
CSS 压缩/解压工具

在线压缩/解压 CSS 代码

随机密码生成器
随机密码生成器

多种字符组合密码