You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@predictionio.apache.org by ta...@apache.org on 2017/10/12 02:00:30 UTC
[1/4] incubator-predictionio-template-attribute-based-classifier git
commit: Fix use of case class
Repository: incubator-predictionio-template-attribute-based-classifier
Updated Branches:
refs/heads/master bfe284ad4 -> 569deb091
Fix use of case class
Closes #11
Project: http://git-wip-us.apache.org/repos/asf/incubator-predictionio-template-attribute-based-classifier/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-predictionio-template-attribute-based-classifier/commit/3ad98d63
Tree: http://git-wip-us.apache.org/repos/asf/incubator-predictionio-template-attribute-based-classifier/tree/3ad98d63
Diff: http://git-wip-us.apache.org/repos/asf/incubator-predictionio-template-attribute-based-classifier/diff/3ad98d63
Branch: refs/heads/master
Commit: 3ad98d63e465253633b9d0e99088a011eae2e0df
Parents: 903f9ee
Author: Naoki Takezoe <ta...@apache.org>
Authored: Sun Jul 16 01:50:49 2017 +0900
Committer: Naoki Takezoe <ta...@apache.org>
Committed: Sun Jul 16 01:50:49 2017 +0900
----------------------------------------------------------------------
src/main/scala/DataSource.scala | 2 +-
src/main/scala/Engine.scala | 22 +++++++++++-----------
src/main/scala/Evaluation.scala | 2 +-
src/main/scala/NaiveBayesAlgorithm.scala | 2 +-
src/main/scala/PrecisionEvaluation.scala | 2 +-
5 files changed, 15 insertions(+), 15 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-predictionio-template-attribute-based-classifier/blob/3ad98d63/src/main/scala/DataSource.scala
----------------------------------------------------------------------
diff --git a/src/main/scala/DataSource.scala b/src/main/scala/DataSource.scala
index 96d245e..f981e9e 100644
--- a/src/main/scala/DataSource.scala
+++ b/src/main/scala/DataSource.scala
@@ -102,7 +102,7 @@ class DataSource(val dsp: DataSourceParams)
new TrainingData(trainingPoints),
new EmptyEvaluationInfo(),
testingPoints.map {
- p => (new Query(p.features(0), p.features(1), p.features(2)), new ActualResult(p.label))
+ p => (Query(p.features(0), p.features(1), p.features(2)), ActualResult(p.label))
}
)
}
http://git-wip-us.apache.org/repos/asf/incubator-predictionio-template-attribute-based-classifier/blob/3ad98d63/src/main/scala/Engine.scala
----------------------------------------------------------------------
diff --git a/src/main/scala/Engine.scala b/src/main/scala/Engine.scala
index 72c2515..3549f94 100644
--- a/src/main/scala/Engine.scala
+++ b/src/main/scala/Engine.scala
@@ -3,19 +3,19 @@ package org.example.classification
import org.apache.predictionio.controller.EngineFactory
import org.apache.predictionio.controller.Engine
-class Query(
- val attr0 : Double,
- val attr1 : Double,
- val attr2 : Double
-) extends Serializable
+case class Query(
+ attr0 : Double,
+ attr1 : Double,
+ attr2 : Double
+)
-class PredictedResult(
- val label: Double
-) extends Serializable
+case class PredictedResult(
+ label: Double
+)
-class ActualResult(
- val label: Double
-) extends Serializable
+case class ActualResult(
+ label: Double
+)
object ClassificationEngine extends EngineFactory {
def apply() = {
http://git-wip-us.apache.org/repos/asf/incubator-predictionio-template-attribute-based-classifier/blob/3ad98d63/src/main/scala/Evaluation.scala
----------------------------------------------------------------------
diff --git a/src/main/scala/Evaluation.scala b/src/main/scala/Evaluation.scala
index 9916f03..d17e39e 100644
--- a/src/main/scala/Evaluation.scala
+++ b/src/main/scala/Evaluation.scala
@@ -14,7 +14,7 @@ case class Accuracy()
object AccuracyEvaluation extends Evaluation {
// Define Engine and Metric used in Evaluation
- engineMetric = (ClassificationEngine(), new Accuracy())
+ engineMetric = (ClassificationEngine(), Accuracy())
}
object EngineParamsList extends EngineParamsGenerator {
http://git-wip-us.apache.org/repos/asf/incubator-predictionio-template-attribute-based-classifier/blob/3ad98d63/src/main/scala/NaiveBayesAlgorithm.scala
----------------------------------------------------------------------
diff --git a/src/main/scala/NaiveBayesAlgorithm.scala b/src/main/scala/NaiveBayesAlgorithm.scala
index 5723bc1..603a652 100644
--- a/src/main/scala/NaiveBayesAlgorithm.scala
+++ b/src/main/scala/NaiveBayesAlgorithm.scala
@@ -34,7 +34,7 @@ class NaiveBayesAlgorithm(val ap: AlgorithmParams)
val label = model.predict(Vectors.dense(
Array(query.attr0, query.attr1, query.attr2)
))
- new PredictedResult(label)
+ PredictedResult(label)
}
}
http://git-wip-us.apache.org/repos/asf/incubator-predictionio-template-attribute-based-classifier/blob/3ad98d63/src/main/scala/PrecisionEvaluation.scala
----------------------------------------------------------------------
diff --git a/src/main/scala/PrecisionEvaluation.scala b/src/main/scala/PrecisionEvaluation.scala
index 71d391a..d0914f1 100644
--- a/src/main/scala/PrecisionEvaluation.scala
+++ b/src/main/scala/PrecisionEvaluation.scala
@@ -23,5 +23,5 @@ case class Precision(label: Double)
}
object PrecisionEvaluation extends Evaluation {
- engineMetric = (ClassificationEngine(), new Precision(label = 1.0))
+ engineMetric = (ClassificationEngine(), Precision(label = 1.0))
}
[2/4] incubator-predictionio-template-attribute-based-classifier git
commit: updated spark verison to 2.1.1
Posted by ta...@apache.org.
updated spark verison to 2.1.1
Closes #13
Project: http://git-wip-us.apache.org/repos/asf/incubator-predictionio-template-attribute-based-classifier/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-predictionio-template-attribute-based-classifier/commit/89ccf888
Tree: http://git-wip-us.apache.org/repos/asf/incubator-predictionio-template-attribute-based-classifier/tree/89ccf888
Diff: http://git-wip-us.apache.org/repos/asf/incubator-predictionio-template-attribute-based-classifier/diff/89ccf888
Branch: refs/heads/master
Commit: 89ccf88829b7a43dfb5d98743aa589ad7cdfad1a
Parents: 3ad98d6
Author: Rajdeep Dua <du...@yahoo.com>
Authored: Thu Oct 12 10:49:01 2017 +0900
Committer: Naoki Takezoe <ta...@apache.org>
Committed: Thu Oct 12 10:50:03 2017 +0900
----------------------------------------------------------------------
build.sbt | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-predictionio-template-attribute-based-classifier/blob/89ccf888/build.sbt
----------------------------------------------------------------------
diff --git a/build.sbt b/build.sbt
index 560eb77..9010379 100644
--- a/build.sbt
+++ b/build.sbt
@@ -1,6 +1,6 @@
name := "template-scala-parallel-classification"
-
+scalaVersion := "2.11.8"
libraryDependencies ++= Seq(
"org.apache.predictionio" %% "apache-predictionio-core" % "0.11.0-incubating" % "provided",
- "org.apache.spark" %% "spark-core" % "1.3.1" % "provided",
- "org.apache.spark" %% "spark-mllib" % "1.3.1" % "provided")
+ "org.apache.spark" %% "spark-core" % "2.1.1" % "provided",
+ "org.apache.spark" %% "spark-mllib" % "2.1.1" % "provided")
[3/4] incubator-predictionio-template-attribute-based-classifier git
commit: 0.12.0-incubating release
Posted by ta...@apache.org.
0.12.0-incubating release
Closes #12
Project: http://git-wip-us.apache.org/repos/asf/incubator-predictionio-template-attribute-based-classifier/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-predictionio-template-attribute-based-classifier/commit/7bb4aa21
Tree: http://git-wip-us.apache.org/repos/asf/incubator-predictionio-template-attribute-based-classifier/tree/7bb4aa21
Diff: http://git-wip-us.apache.org/repos/asf/incubator-predictionio-template-attribute-based-classifier/diff/7bb4aa21
Branch: refs/heads/master
Commit: 7bb4aa2160711b0f22b3b515f98cda85e4621f63
Parents: 89ccf88
Author: shimamoto <sh...@apache.org>
Authored: Thu Oct 12 10:55:18 2017 +0900
Committer: Naoki Takezoe <ta...@apache.org>
Committed: Thu Oct 12 10:56:03 2017 +0900
----------------------------------------------------------------------
README.md | 9 ++++++++-
build.sbt | 4 ++--
project/assembly.sbt | 2 +-
project/build.properties | 2 +-
4 files changed, 12 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-predictionio-template-attribute-based-classifier/blob/7bb4aa21/README.md
----------------------------------------------------------------------
diff --git a/README.md b/README.md
index d8bac33..31dd678 100644
--- a/README.md
+++ b/README.md
@@ -2,10 +2,17 @@
## Documentation
-Please refer to http://predictionio.incubator.apache.org/templates/classification/quickstart/
+Please refer to
+http://predictionio.incubator.apache.org/templates/classification/quickstart/
## Versions
+### v0.12.0-incubating
+
+- Bump version number to track PredictionIO version
+- Sets default build targets according to PredictionIO
+- Fix use of case class
+
### v0.11.0-incubating
- Bump version number to track PredictionIO version
http://git-wip-us.apache.org/repos/asf/incubator-predictionio-template-attribute-based-classifier/blob/7bb4aa21/build.sbt
----------------------------------------------------------------------
diff --git a/build.sbt b/build.sbt
index 9010379..4956083 100644
--- a/build.sbt
+++ b/build.sbt
@@ -1,6 +1,6 @@
name := "template-scala-parallel-classification"
+
scalaVersion := "2.11.8"
libraryDependencies ++= Seq(
- "org.apache.predictionio" %% "apache-predictionio-core" % "0.11.0-incubating" % "provided",
- "org.apache.spark" %% "spark-core" % "2.1.1" % "provided",
+ "org.apache.predictionio" %% "apache-predictionio-core" % "0.12.0-incubating" % "provided",
"org.apache.spark" %% "spark-mllib" % "2.1.1" % "provided")
http://git-wip-us.apache.org/repos/asf/incubator-predictionio-template-attribute-based-classifier/blob/7bb4aa21/project/assembly.sbt
----------------------------------------------------------------------
diff --git a/project/assembly.sbt b/project/assembly.sbt
index e17409e..15a88b0 100644
--- a/project/assembly.sbt
+++ b/project/assembly.sbt
@@ -1 +1 @@
-addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.4")
+addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.5")
http://git-wip-us.apache.org/repos/asf/incubator-predictionio-template-attribute-based-classifier/blob/7bb4aa21/project/build.properties
----------------------------------------------------------------------
diff --git a/project/build.properties b/project/build.properties
index 64317fd..c091b86 100644
--- a/project/build.properties
+++ b/project/build.properties
@@ -1 +1 @@
-sbt.version=0.13.15
+sbt.version=0.13.16
[4/4] incubator-predictionio-template-attribute-based-classifier git
commit: Merge branch 'develop'
Posted by ta...@apache.org.
Merge branch 'develop'
Project: http://git-wip-us.apache.org/repos/asf/incubator-predictionio-template-attribute-based-classifier/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-predictionio-template-attribute-based-classifier/commit/569deb09
Tree: http://git-wip-us.apache.org/repos/asf/incubator-predictionio-template-attribute-based-classifier/tree/569deb09
Diff: http://git-wip-us.apache.org/repos/asf/incubator-predictionio-template-attribute-based-classifier/diff/569deb09
Branch: refs/heads/master
Commit: 569deb09114b0cd6f2fe32936b171ab92f9cc614
Parents: bfe284a 7bb4aa2
Author: Naoki Takezoe <ta...@apache.org>
Authored: Thu Oct 12 10:59:14 2017 +0900
Committer: Naoki Takezoe <ta...@apache.org>
Committed: Thu Oct 12 10:59:14 2017 +0900
----------------------------------------------------------------------
README.md | 9 ++++++++-
build.sbt | 6 +++---
project/assembly.sbt | 2 +-
project/build.properties | 2 +-
src/main/scala/DataSource.scala | 2 +-
src/main/scala/Engine.scala | 22 +++++++++++-----------
src/main/scala/Evaluation.scala | 2 +-
src/main/scala/NaiveBayesAlgorithm.scala | 2 +-
src/main/scala/PrecisionEvaluation.scala | 2 +-
9 files changed, 28 insertions(+), 21 deletions(-)
----------------------------------------------------------------------