Hi 상형,

If you need some sample codes about plotting with Pyspark, please see this
notebook( by @felixcheung ).

https://www.zeppelinhub.com/viewer/notebooks/aHR0cHM6Ly9yYXcuZ2l0aHVidXNlcmNvbnRlbnQuY29tL2ZlbGl4Y2hldW5nL3NwYXJrLW5vdGVib29rLWV4YW1wbGVzL21hc3Rlci9aZXBwZWxpbl9ub3RlYm9vay8yQU1YNUNWQ1Uvbm90ZS5qc29u

Hope this help! : )
Ahyoung


2016년 2월 11일 (목) 오후 10:29, 진상형 <jsh90...@gmail.com>님이 작성:

> Hi, I'm getting trouble to plotting in pyspark
>
> There is a dataframe (col:"features", col:"predictions") which is result
> from kmeans.
>
> And my goal is to plot the feature_vector(x,y) and predictions of
> kmeans_model.
>
> HERE ARE CODES AND RESULTS
>
>
> z.put("result", model.transform(norm_featured_2f))
>
> //res~: Object = [norm_2f_features: vector]
>
>
> %pyspark
> import matplotlib
> matplotlib.use('Agg')
> import matplotlib.pyplot as plt; plt.rcdefaults()
> import numpy as np
> import StringIO
>
> def show(p):
>     img = StringIO.StringIO()
>     p.savefig(img, format='svg')
>     img.seek(0)
>     print "%html <div style='width:600px'>" + img.buf + "</div>"
>
> data = z["result"]
> x = []
> y = []
> for i in data[0]:
>     x.append(i._1())
>     y.append(i._2())
>
> //TypeError: 'JavaObject' object is not callable
>
>
> Anyone help
>
> Is there any sample codes, or notebook about this?
>
>
>

Reply via email to