Hello Fabian,
Thank you for the response, but I have been stuck on how to iterate over
the DataSet, perform operations and return a new modified DataSet similar
to that of list operation as shown below.
Eg: Currently I am doing the following:
for (Centroid centroid : centroids.collect()) {
for
I would try to do the outlier compuation with the DataSet API instead of
fetching the results to the client with collect().
If you do that, you can directly use writeAsCsv because the result is still
a DataSet.
What you have to do, is to translate your findOutliers method into DataSet
API code.
B
Hello Fabian,
As written before code:
*DataSet fElements =
env.fromCollection(findOutliers(clusteredPoints,
finalCentroids));fElements.writeAsCsv(outputPath, "\n", "
");env.execute("KMeans Example");*
I am very new to flink so not so clear about what you suggested, by
option(1) you meant that I
Hi Subash,
I would not fetch the data to the client, do the computation there, and
send it back, just for the purpose of writing it to a file.
Either 1) pull the results to the client and write the file from there or
2) compute the outliers in the cluster.
I did not study your code completely, bu
Hi Subash,
how is findOutliers implemented?
It might be that you mix-up local and cluster computation. All DataSets are
processed in the cluster. Please note the following:
- ExecutionEnvironment.fromCollection() transforms a client local
connection into a DataSet by serializing it and sending it
Hello Stefano,
Yeah the type casting worked, thank you. But not able to print the Dataset
to the file.
The default below code which writes the KMeans points along with their
centroid numbers to the file works fine:
// feed new centroids back into next iteration
DataSet finalCentro
Assuming your EnvironmentContext is named `env` Simply call:
DataSet> fElements = env.*fromCollection*
(finalElements);
Does this help?
On Tue, Feb 9, 2016 at 6:06 PM, subash basnet wrote:
> Hello all,
>
> I have performed a modification in KMeans code to detect outliers. I have
> printed the
Hello all,
I have performed a modification in KMeans code to detect outliers. I have
printed the output in the console but I am not able to write it to the file
using the given 'writeAsCsv' method.
The problem is I generate a list of tuples.
My List is:
List finalElements = new ArrayList();
Follow