Github user feynmanliang commented on a diff in the pull request:
https://github.com/apache/spark/pull/11374#discussion_r85647843
--- Diff:
mllib/src/main/scala/org/apache/spark/mllib/api/python/PythonMLLibAPI.scala ---
@@ -1576,17 +1616,49 @@ private[spark] object SerDe extends SerDeBase with
Serializable {
}
}
+ private[python] class BinarySamplePickler extends
BasePickler[BinarySample] {
+ def saveState(obj: Object, out: OutputStream, pickler: Pickler): Unit
= {
+ val binarySample = obj.asInstanceOf[BinarySample]
+ saveObjects(out, pickler, binarySample.isExperiment,
binarySample.value)
+ }
+
+ def construct(args: Array[AnyRef]): AnyRef = {
+ if (args.length != 2) {
+ throw new PickleException("should be 2")
+ }
+ BinarySample(args(0).asInstanceOf[Boolean],
args(1).asInstanceOf[Double])
+ }
+ }
+
+ private[python] class StreamingTestResultPickler extends
BasePickler[StreamingTestResult] {
--- End diff --
Do we need to test these in `PythonMLLibAPISuite`?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]