Skip to content

Commit cac47b8

Browse files
committed
add classtag
1 parent 2821b3b commit cac47b8

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

mllib/src/main/scala/org/apache/spark/mllib/regression/StreamingLinearAlgorithm.scala

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717

1818
package org.apache.spark.mllib.regression
1919

20+
import scala.reflect.ClassTag
21+
2022
import org.apache.spark.Logging
2123
import org.apache.spark.annotation.DeveloperApi
2224
import org.apache.spark.mllib.linalg.Vector
@@ -112,7 +114,7 @@ abstract class StreamingLinearAlgorithm[
112114
* @tparam K key type
113115
* @return DStream containing the input keys and the predictions as values
114116
*/
115-
def predictOnValues[K](data: DStream[(K, Vector)]): DStream[(K, Double)] = {
117+
def predictOnValues[K: ClassTag](data: DStream[(K, Vector)]): DStream[(K, Double)] = {
116118
if (Option(model.weights) == None) {
117119
val msg = "Initial weights must be set before starting prediction"
118120
logError(msg)

0 commit comments

Comments
 (0)