zhengruifeng commented on PR #36062:
URL: https://github.com/apache/spark/pull/36062#issuecomment-1087576474
```
import org.apache.spark.ml.stat.pandas._
val seq = Array.range(0, 10000000).map(_.toDouble / 10).zipWithIndex
val df = sc.parallelize(seq).toDF("value", "index")
EWM.ewm(df, Seq(col("index")), Seq(col("value")), alpha=Some(0.5)).show()
scala> EWM.ewm(df, Seq(col("index")), Seq(col("value")),
alpha=Some(0.5)).show()
22/04/04 21:27:24 WARN TaskSetManager: Stage 0 contains a task of very large
size (24418 KiB). The maximum recommended task size is 1000 KiB.
22/04/04 21:27:37 WARN TaskSetManager: Stage 1 contains a task of very large
size (24418 KiB). The maximum recommended task size is 1000 KiB.
numPartitions: 13 (0 + 12) /
12]
col 0:
[(0,0),(149803.000,2.00000000),(300353.600,2.00000000),(458835.600,2.00000000),(619207.000,2.00000000),(779324.800,2.00000000),(939453.800,2.00000000),(1108437.20,2.00000000),(1270155.40,2.00000000),(1438556.80,2.00000000),(1608458.00,2.00000000),(1769088.60,2.00000000),(1928755.20,2.00000000)]
22/04/04 21:27:53 WARN TaskSetManager: Stage 4 contains a task of very large
size (24418 KiB). The maximum recommended task size is 1000 KiB.
22/04/04 21:28:03 WARN TaskSetManager: Stage 5 contains a task of very large
size (24418 KiB). The maximum recommended task size is 1000 KiB.
22/04/04 21:28:14 WARN DAGScheduler: Broadcasting large task binary with
size 2.3 MiB
+-----+--------------------+
|index| _ewma_|
+-----+--------------------+
| 0| [0.0]|
| 1|[0.06666666666666...|
| 2|[0.14285714285714...|
| 3|[0.22666666666666...|
| 4|[0.3161290322580645]|
| 5|[0.4095238095238095]|
| 6|[0.5055118110236221]|
| 7|[0.6031372549019608]|
| 8|[0.7017612524461839]|
| 9|[0.8009775171065494]|
| 10|[0.9005373717635564]|
| 11|[1.0002930402930403]|
| 12|[1.1001587107801245]|
| 13|[1.2000854544344748]|
| 14| [1.300045777764214]|
| 15|[1.4000244144350347]|
| 16| [1.500012970069657]|
| 17|[1.6000068664812717]|
| 18|[1.7000036239693146]|
| 19|[1.8000019073504518]|
+-----+--------------------+
only showing top 20 rows
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]