no normalization
This commit is contained in:
parent
87dc42a466
commit
5c1990e4ff
@ -30,6 +30,10 @@ trait BenchmarkAlgorithm extends Logging {
|
||||
ctx: MLBenchContext,
|
||||
trainingSet: DataFrame): Transformer
|
||||
|
||||
/**
|
||||
* The unnormalized score of the training procedure on a dataset. The normalization is
|
||||
* performed by the caller.
|
||||
*/
|
||||
@throws[Exception]("if scoring fails")
|
||||
def score(
|
||||
ctx: MLBenchContext,
|
||||
|
||||
@ -16,6 +16,7 @@ class MLTransformerBenchmarkable(
|
||||
|
||||
private var testData: DataFrame = null
|
||||
private var trainingData: DataFrame = null
|
||||
private var testDataCount: Option[Long] = None
|
||||
private val param = MLBenchContext(params, sqlContext)
|
||||
|
||||
override val name = test.name
|
||||
@ -27,7 +28,7 @@ class MLTransformerBenchmarkable(
|
||||
try {
|
||||
testData = test.testDataSet(param)
|
||||
testData.cache()
|
||||
testData.count()
|
||||
testDataCount = Some(testData.count())
|
||||
trainingData = test.trainingDataSet(param)
|
||||
trainingData.cache()
|
||||
trainingData.count()
|
||||
@ -57,7 +58,7 @@ class MLTransformerBenchmarkable(
|
||||
trainingTime = Some(trainingTime.toMillis),
|
||||
trainingMetric = Some(scoreTraining),
|
||||
testTime = Some(scoreTestTime.toMillis),
|
||||
testMetric = Some(scoreTest))
|
||||
testMetric = Some(scoreTest / testDataCount.get))
|
||||
|
||||
BenchmarkResult(
|
||||
name = name,
|
||||
|
||||
@ -38,6 +38,7 @@ object LogisticRegression extends BenchmarkAlgorithm
|
||||
import ctx.params._
|
||||
val lr = new ml.classification.LogisticRegression()
|
||||
.setTol(tol)
|
||||
.setMaxIter(maxIter)
|
||||
.setRegParam(regParam)
|
||||
lr.fit(trainingSet)
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user