You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2022/06/23 08:36:22 UTC

[GitHub] [flink-ml] yunfengzhou-hub opened a new pull request, #115: [FLINK-26828] Add flink-ml-examples module

yunfengzhou-hub opened a new pull request, #115:
URL: https://github.com/apache/flink-ml/pull/115

   This PR creates a new flink-ml-examples module and added example program for all existing offline algorithms.


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [flink-ml] lindong28 commented on a diff in pull request #115: [FLINK-26828] Add flink-ml-examples module

Posted by GitBox <gi...@apache.org>.
lindong28 commented on code in PR #115:
URL: https://github.com/apache/flink-ml/pull/115#discussion_r905811310


##########
flink-ml-examples/src/test/java/org/apache/flink/ml/examples/ExamplesTest.java:
##########
@@ -0,0 +1,129 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.ml.examples;
+
+import org.apache.flink.test.util.AbstractTestBase;
+
+import org.apache.commons.io.output.NullPrintStream;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.PrintStream;
+import java.lang.reflect.Method;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Objects;
+import java.util.concurrent.Callable;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.Future;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.TimeoutException;
+
+/** Extracts all example classes in this package and tests their main methods. */
+@RunWith(Parameterized.class)
+public class ExamplesTest extends AbstractTestBase {

Review Comment:
   Do we still need this class?



##########
docs/content/docs/try-flink-ml/quick-start.md:
##########
@@ -27,213 +27,64 @@ under the License.
 # Quick Start
 
 This document provides a quick introduction to using Flink ML. Readers of this

Review Comment:
   Is there anyway that users can find this doc by visiting the main README?



##########
docs/content/docs/try-flink-ml/quick-start.md:
##########
@@ -27,213 +27,64 @@ under the License.
 # Quick Start
 
 This document provides a quick introduction to using Flink ML. Readers of this
-document will be guided to create a simple Flink job that trains a Machine
+document will be guided to submit a simple Flink job that trains a Machine
 Learning Model and use it to provide prediction service.
 
-## Maven Setup
+## Prerequisite
 
-In order to use Flink ML in a Maven project, add the following dependencies to
-`pom.xml`.
+Please make sure you have installed Flink 1.15.0 in your local environment and

Review Comment:
   Could we make this README consistent with flink-ml-benchmark/README.md when describing the same thing (e.g. setting up Flink and `$FLINK_HOME`). We can also update flink-ml-benchmark/README.md when needed.



-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [flink-ml] lindong28 commented on a diff in pull request #115: [FLINK-26828] Add flink-ml-examples module

Posted by GitBox <gi...@apache.org>.
lindong28 commented on code in PR #115:
URL: https://github.com/apache/flink-ml/pull/115#discussion_r905821192


##########
docs/content/docs/try-flink-ml/quick-start.md:
##########
@@ -27,213 +27,64 @@ under the License.
 # Quick Start
 
 This document provides a quick introduction to using Flink ML. Readers of this
-document will be guided to create a simple Flink job that trains a Machine
+document will be guided to submit a simple Flink job that trains a Machine
 Learning Model and use it to provide prediction service.
 
-## Maven Setup
+## Prerequisite
 
-In order to use Flink ML in a Maven project, add the following dependencies to
-`pom.xml`.
+Please make sure you have installed Flink 1.15.0 in your local environment and
+configured `$FLINK_HOME`. For instructions of setting up Flink environment,
+please refer to [Flink's
+document](https://nightlies.apache.org/flink/flink-docs-release-1.15/docs/try-flink/local_installation/).
 
-{{< artifact flink-ml-core >}}
+## Download & Compile Flink ML
 
-{{< artifact flink-ml-iteration >}}
+<!-- TODO: Modify this section after Flink ML's binary distribution is released -->
 
-{{< artifact flink-ml-lib >}}
+In order to follow guidelines in this document, you need to have the latest
+binary distribution of Flink ML. You can acquire the distribution by building
+Flink ML's source code locally with the following command.
 
-The example code provided in this document requires additional dependencies on
-the Flink Table API. In order to execute the example code successfully, please
-make sure the following dependencies also exist in `pom.xml`.
-
-```xml
-<dependency>
-  <groupId>org.apache.flink</groupId>
-  <artifactId>flink-clients</artifactId>
-  <version>1.15.0</version>
-</dependency>
-```
-
-```xml
-<dependency>
-  <groupId>org.apache.flink</groupId>
-  <artifactId>flink-table-planner-loader</artifactId>
-  <version>1.15.0</version>
-</dependency>
-```
-
-## Flink ML Example
-
-Kmeans is a widely-used clustering algorithm and has been supported by Flink ML.
-The example code below creates a Flink job with Flink ML that initializes and
-trains a Kmeans model, and finally uses it to predict the cluster id of certain
-data points.
-
-```java
-import org.apache.flink.ml.clustering.kmeans.KMeans;
-import org.apache.flink.ml.clustering.kmeans.KMeansModel;
-import org.apache.flink.ml.linalg.DenseVector;
-import org.apache.flink.ml.linalg.Vectors;
-import org.apache.flink.streaming.api.datastream.DataStream;
-import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;
-import org.apache.flink.table.api.Table;
-import org.apache.flink.table.api.bridge.java.StreamTableEnvironment;
-import org.apache.flink.types.Row;
-import org.apache.flink.util.CloseableIterator;
-
-public class QuickStart {
-    public static void main(String[] args) {
-        StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
-        StreamTableEnvironment tEnv = StreamTableEnvironment.create(env);
-
-        String featuresCol = "features";
-        String predictionCol = "prediction";
-
-        // Generate train data and predict data as DataStream.
-        DataStream<DenseVector> inputStream = env.fromElements(
-                Vectors.dense(0.0, 0.0),
-                Vectors.dense(0.0, 0.3),
-                Vectors.dense(0.3, 0.0),
-                Vectors.dense(9.0, 0.0),
-                Vectors.dense(9.0, 0.6),
-                Vectors.dense(9.6, 0.0)
-        );
-
-        // Convert data from DataStream to Table, as Flink ML uses Table API.
-        Table input = tEnv.fromDataStream(inputStream).as(featuresCol);
-
-        // Creates a K-means object and initialize its parameters.
-        KMeans kmeans = new KMeans()
-                .setK(2)
-                .setSeed(1L)
-                .setFeaturesCol(featuresCol)
-                .setPredictionCol(predictionCol);
-
-        // Trains the K-means Model.
-        KMeansModel model = kmeans.fit(input);
-
-        // Use the K-means Model for predictions.
-        Table output = model.transform(input)[0];
-
-        // Extracts and displays prediction result.
-        for (CloseableIterator<Row> it = output.execute().collect(); it.hasNext(); ) {
-            Row row = it.next();
-            DenseVector vector = (DenseVector) row.getField(featuresCol);
-            int clusterId = (Integer) row.getField(predictionCol);
-            System.out.println("Vector: " + vector + "\tCluster ID: " + clusterId);
-        }
-    }
-}
+```bash
+cd ${path_to_flink_ml}
+mvn clean package -DskipTests
 ```
 
-After placing the code above into your Maven project and executing it,
-information like below will be printed out to your terminal window.
+Then you will find Flink ML's binary distribution in
+`./flink-ml-dist/target/flink-ml-*-bin/flink-ml*/`. Copy the generated jars to
+your Flink environment to finish the setup.
 
+```shell
+cd ./flink-ml-dist/target/flink-ml-*-bin/flink-ml*/
+cp ./lib/*.jar $FLINK_HOME/lib/
 ```
-Vector: [0.3, 0.0]	Cluster ID: 1
-Vector: [9.6, 0.0]	Cluster ID: 0
-Vector: [9.0, 0.6]	Cluster ID: 0
-Vector: [0.0, 0.0]	Cluster ID: 1
-Vector: [0.0, 0.3]	Cluster ID: 1
-Vector: [9.0, 0.0]	Cluster ID: 0
-```
-
-## Breaking Down The Code
-
-### The Execution Environment
 
-The first lines set up the `StreamExecutionEnvironment` to execute the Flink ML
-job. You would have been familiar with this concept if you have experience using
-Flink. For the example program in this document, a simple
-`StreamExecutionEnvironment` without specific configurations would be enough. 
+## Starting Flink cluster and submitting Flink ML example job
 
-Given that Flink ML uses Flink's Table API, a `StreamTableEnvironment` would
-also be necessary for the following program.
+Under `$FLINK_HOME` directory, you may follow these instructions to start a
+Flink cluster and submit Flink ML examples to it.
 
-```java
-StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
-StreamTableEnvironment tEnv = StreamTableEnvironment.create(env);
 ```
-
-### Creating Training & Inference Data Table
-
-Then the program creates the Table containing data for the training and
-prediction process of the following Kmeans algorithm. Flink ML operators
-search the names of the columns of the input table for input data, and produce
-prediction results to designated column of the output Table.
-
-```java
-DataStream<DenseVector> inputStream = env.fromElements(
-        Vectors.dense(0.0, 0.0),
-        Vectors.dense(0.0, 0.3),
-        Vectors.dense(0.3, 0.0),
-        Vectors.dense(9.0, 0.0),
-        Vectors.dense(9.0, 0.6),
-        Vectors.dense(9.6, 0.0)
-);
-
-Table input = tEnv.fromDataStream(inputStream).as(featuresCol);
+./bin/start-cluster.sh
+./bin/flink run -c org.apache.flink.ml.examples.clustering.KMeansExample ./lib/flink-ml-examples*.jar
 ```
 
-### Creating, Configuring, Training & Using Kmeans
-
-Flink ML classes for Kmeans algorithm include `KMeans` and `KMeansModel`.
-`KMeans` implements the training process of Kmeans algorithm based on the
-provided training data, and finally generates a `KMeansModel`.
-`KmeansModel.transform()` method encodes the Transformation logic of this
-algorithm and is used for predictions. 
-
-Both `KMeans` and `KMeansModel` provides getter/setter methods for Kmeans
-algorithm's configuration parameters. The example program explicitly sets the
-following parameters, and other configuration parameters will have their default
-values used.
-
-- `K`, the number of clusters to create
-- `seed`, the random seed to initialize cluster centers
-- `featuresCol`, name of the column containing input feature vectors
-- `predictionCol`, name of the column to output prediction results
+The command above would submit and execute Flink ML's `KMeansExample` job. There
+are also example jobs for other Flink ML algorithms, and you can find them in
+`flink-ml-examples` module.
 
-When the program invokes `KMeans.fit()` to generate a `KMeansModel`, the
-`KMeansModel` will inherit the `KMeans` object's configuration parameters. Thus
-it is supported to set `KMeansModel`'s parameters directly in `KMeans` object.
-
-```java
-KMeans kmeans = new KMeans()
-        .setK(2)
-        .setSeed(1L)
-        .setFeaturesCol(featuresCol)
-        .setPredictionCol(predictionCol);
-
-KMeansModel model = kmeans.fit(input);
-
-Table output = model.transform(input)[0];
+A sample output in your terminal is as follows.
 
 ```
+Features: [9.0, 0.0]    Cluster ID: 1
+Features: [0.3, 0.0]    Cluster ID: 0
+Features: [0.0, 0.3]    Cluster ID: 0
+Features: [9.6, 0.0]    Cluster ID: 1
+Features: [0.0, 0.0]    Cluster ID: 0
+Features: [9.0, 0.6]    Cluster ID: 1
 
-### Collecting Prediction Result
-
-Like all other Flink programs, the codes described in the sections above only
-configures the computation graph of a Flink job, and the program only evaluates
-the computation logic and collects outputs after the `execute()` method is
-invoked. Collected outputs from the output table would be `Row`s in which
-`featuresCol` contains input feature vectors, and `predictionCol` contains
-output prediction results, i.e., cluster IDs.
-
-```java
-for (CloseableIterator<Row> it = output.execute().collect(); it.hasNext(); ) {
-    Row row = it.next();
-    DenseVector vector = (DenseVector) row.getField(featuresCol);
-    int clusterId = (Integer) row.getField(predictionCol);
-    System.out.println("Vector: " + vector + "\tCluster ID: " + clusterId);
-}
 ```
 
-```
-Vector: [0.3, 0.0]	Cluster ID: 1
-Vector: [9.6, 0.0]	Cluster ID: 0
-Vector: [9.0, 0.6]	Cluster ID: 0
-Vector: [0.0, 0.0]	Cluster ID: 1
-Vector: [0.0, 0.3]	Cluster ID: 1
-Vector: [9.0, 0.0]	Cluster ID: 0
-```
+You have successfully ran a Flink ML job. Now please feel free to explore other

Review Comment:
   Is this paragraph copied and pasted from other places? It seems that there is no further section in this document.



-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [flink-ml] yunfengzhou-hub commented on a diff in pull request #115: [FLINK-26828] Add flink-ml-examples module

Posted by GitBox <gi...@apache.org>.
yunfengzhou-hub commented on code in PR #115:
URL: https://github.com/apache/flink-ml/pull/115#discussion_r905852595


##########
docs/content/docs/try-flink-ml/quick-start.md:
##########
@@ -27,213 +27,64 @@ under the License.
 # Quick Start
 
 This document provides a quick introduction to using Flink ML. Readers of this
-document will be guided to create a simple Flink job that trains a Machine
+document will be guided to submit a simple Flink job that trains a Machine
 Learning Model and use it to provide prediction service.
 
-## Maven Setup
+## Prerequisite
 
-In order to use Flink ML in a Maven project, add the following dependencies to
-`pom.xml`.
+Please make sure you have installed Flink 1.15.0 in your local environment and
+configured `$FLINK_HOME`. For instructions of setting up Flink environment,
+please refer to [Flink's
+document](https://nightlies.apache.org/flink/flink-docs-release-1.15/docs/try-flink/local_installation/).
 
-{{< artifact flink-ml-core >}}
+## Download & Compile Flink ML
 
-{{< artifact flink-ml-iteration >}}
+<!-- TODO: Modify this section after Flink ML's binary distribution is released -->
 
-{{< artifact flink-ml-lib >}}
+In order to follow guidelines in this document, you need to have the latest
+binary distribution of Flink ML. You can acquire the distribution by building
+Flink ML's source code locally with the following command.
 
-The example code provided in this document requires additional dependencies on
-the Flink Table API. In order to execute the example code successfully, please
-make sure the following dependencies also exist in `pom.xml`.
-
-```xml
-<dependency>
-  <groupId>org.apache.flink</groupId>
-  <artifactId>flink-clients</artifactId>
-  <version>1.15.0</version>
-</dependency>
-```
-
-```xml
-<dependency>
-  <groupId>org.apache.flink</groupId>
-  <artifactId>flink-table-planner-loader</artifactId>
-  <version>1.15.0</version>
-</dependency>
-```
-
-## Flink ML Example
-
-Kmeans is a widely-used clustering algorithm and has been supported by Flink ML.
-The example code below creates a Flink job with Flink ML that initializes and
-trains a Kmeans model, and finally uses it to predict the cluster id of certain
-data points.
-
-```java
-import org.apache.flink.ml.clustering.kmeans.KMeans;
-import org.apache.flink.ml.clustering.kmeans.KMeansModel;
-import org.apache.flink.ml.linalg.DenseVector;
-import org.apache.flink.ml.linalg.Vectors;
-import org.apache.flink.streaming.api.datastream.DataStream;
-import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;
-import org.apache.flink.table.api.Table;
-import org.apache.flink.table.api.bridge.java.StreamTableEnvironment;
-import org.apache.flink.types.Row;
-import org.apache.flink.util.CloseableIterator;
-
-public class QuickStart {
-    public static void main(String[] args) {
-        StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
-        StreamTableEnvironment tEnv = StreamTableEnvironment.create(env);
-
-        String featuresCol = "features";
-        String predictionCol = "prediction";
-
-        // Generate train data and predict data as DataStream.
-        DataStream<DenseVector> inputStream = env.fromElements(
-                Vectors.dense(0.0, 0.0),
-                Vectors.dense(0.0, 0.3),
-                Vectors.dense(0.3, 0.0),
-                Vectors.dense(9.0, 0.0),
-                Vectors.dense(9.0, 0.6),
-                Vectors.dense(9.6, 0.0)
-        );
-
-        // Convert data from DataStream to Table, as Flink ML uses Table API.
-        Table input = tEnv.fromDataStream(inputStream).as(featuresCol);
-
-        // Creates a K-means object and initialize its parameters.
-        KMeans kmeans = new KMeans()
-                .setK(2)
-                .setSeed(1L)
-                .setFeaturesCol(featuresCol)
-                .setPredictionCol(predictionCol);
-
-        // Trains the K-means Model.
-        KMeansModel model = kmeans.fit(input);
-
-        // Use the K-means Model for predictions.
-        Table output = model.transform(input)[0];
-
-        // Extracts and displays prediction result.
-        for (CloseableIterator<Row> it = output.execute().collect(); it.hasNext(); ) {
-            Row row = it.next();
-            DenseVector vector = (DenseVector) row.getField(featuresCol);
-            int clusterId = (Integer) row.getField(predictionCol);
-            System.out.println("Vector: " + vector + "\tCluster ID: " + clusterId);
-        }
-    }
-}
+```bash
+cd ${path_to_flink_ml}
+mvn clean package -DskipTests
 ```
 
-After placing the code above into your Maven project and executing it,
-information like below will be printed out to your terminal window.
+Then you will find Flink ML's binary distribution in
+`./flink-ml-dist/target/flink-ml-*-bin/flink-ml*/`. Copy the generated jars to
+your Flink environment to finish the setup.
 
+```shell
+cd ./flink-ml-dist/target/flink-ml-*-bin/flink-ml*/
+cp ./lib/*.jar $FLINK_HOME/lib/
 ```
-Vector: [0.3, 0.0]	Cluster ID: 1
-Vector: [9.6, 0.0]	Cluster ID: 0
-Vector: [9.0, 0.6]	Cluster ID: 0
-Vector: [0.0, 0.0]	Cluster ID: 1
-Vector: [0.0, 0.3]	Cluster ID: 1
-Vector: [9.0, 0.0]	Cluster ID: 0
-```
-
-## Breaking Down The Code
-
-### The Execution Environment
 
-The first lines set up the `StreamExecutionEnvironment` to execute the Flink ML
-job. You would have been familiar with this concept if you have experience using
-Flink. For the example program in this document, a simple
-`StreamExecutionEnvironment` without specific configurations would be enough. 
+## Starting Flink cluster and submitting Flink ML example job
 
-Given that Flink ML uses Flink's Table API, a `StreamTableEnvironment` would
-also be necessary for the following program.
+Under `$FLINK_HOME` directory, you may follow these instructions to start a
+Flink cluster and submit Flink ML examples to it.
 
-```java
-StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
-StreamTableEnvironment tEnv = StreamTableEnvironment.create(env);
 ```
-
-### Creating Training & Inference Data Table
-
-Then the program creates the Table containing data for the training and
-prediction process of the following Kmeans algorithm. Flink ML operators
-search the names of the columns of the input table for input data, and produce
-prediction results to designated column of the output Table.
-
-```java
-DataStream<DenseVector> inputStream = env.fromElements(
-        Vectors.dense(0.0, 0.0),
-        Vectors.dense(0.0, 0.3),
-        Vectors.dense(0.3, 0.0),
-        Vectors.dense(9.0, 0.0),
-        Vectors.dense(9.0, 0.6),
-        Vectors.dense(9.6, 0.0)
-);
-
-Table input = tEnv.fromDataStream(inputStream).as(featuresCol);
+./bin/start-cluster.sh
+./bin/flink run -c org.apache.flink.ml.examples.clustering.KMeansExample ./lib/flink-ml-examples*.jar
 ```
 
-### Creating, Configuring, Training & Using Kmeans
-
-Flink ML classes for Kmeans algorithm include `KMeans` and `KMeansModel`.
-`KMeans` implements the training process of Kmeans algorithm based on the
-provided training data, and finally generates a `KMeansModel`.
-`KmeansModel.transform()` method encodes the Transformation logic of this
-algorithm and is used for predictions. 
-
-Both `KMeans` and `KMeansModel` provides getter/setter methods for Kmeans
-algorithm's configuration parameters. The example program explicitly sets the
-following parameters, and other configuration parameters will have their default
-values used.
-
-- `K`, the number of clusters to create
-- `seed`, the random seed to initialize cluster centers
-- `featuresCol`, name of the column containing input feature vectors
-- `predictionCol`, name of the column to output prediction results
+The command above would submit and execute Flink ML's `KMeansExample` job. There
+are also example jobs for other Flink ML algorithms, and you can find them in
+`flink-ml-examples` module.
 
-When the program invokes `KMeans.fit()` to generate a `KMeansModel`, the
-`KMeansModel` will inherit the `KMeans` object's configuration parameters. Thus
-it is supported to set `KMeansModel`'s parameters directly in `KMeans` object.
-
-```java
-KMeans kmeans = new KMeans()
-        .setK(2)
-        .setSeed(1L)
-        .setFeaturesCol(featuresCol)
-        .setPredictionCol(predictionCol);
-
-KMeansModel model = kmeans.fit(input);
-
-Table output = model.transform(input)[0];
+A sample output in your terminal is as follows.
 
 ```
+Features: [9.0, 0.0]    Cluster ID: 1
+Features: [0.3, 0.0]    Cluster ID: 0
+Features: [0.0, 0.3]    Cluster ID: 0
+Features: [9.6, 0.0]    Cluster ID: 1
+Features: [0.0, 0.0]    Cluster ID: 0
+Features: [9.0, 0.6]    Cluster ID: 1
 
-### Collecting Prediction Result
-
-Like all other Flink programs, the codes described in the sections above only
-configures the computation graph of a Flink job, and the program only evaluates
-the computation logic and collects outputs after the `execute()` method is
-invoked. Collected outputs from the output table would be `Row`s in which
-`featuresCol` contains input feature vectors, and `predictionCol` contains
-output prediction results, i.e., cluster IDs.
-
-```java
-for (CloseableIterator<Row> it = output.execute().collect(); it.hasNext(); ) {
-    Row row = it.next();
-    DenseVector vector = (DenseVector) row.getField(featuresCol);
-    int clusterId = (Integer) row.getField(predictionCol);
-    System.out.println("Vector: " + vector + "\tCluster ID: " + clusterId);
-}
 ```
 
-```
-Vector: [0.3, 0.0]	Cluster ID: 1
-Vector: [9.6, 0.0]	Cluster ID: 0
-Vector: [9.0, 0.6]	Cluster ID: 0
-Vector: [0.0, 0.0]	Cluster ID: 1
-Vector: [0.0, 0.3]	Cluster ID: 1
-Vector: [9.0, 0.0]	Cluster ID: 0
-```
+You have successfully ran a Flink ML job. Now please feel free to explore other

Review Comment:
   I agree that it might be ambiguous. I'll remove this line.



-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [flink-ml] yunfengzhou-hub commented on a diff in pull request #115: [FLINK-26828] Add flink-ml-examples module

Posted by GitBox <gi...@apache.org>.
yunfengzhou-hub commented on code in PR #115:
URL: https://github.com/apache/flink-ml/pull/115#discussion_r905876473


##########
docs/content/docs/try-flink-ml/quick-start.md:
##########
@@ -27,213 +27,64 @@ under the License.
 # Quick Start
 
 This document provides a quick introduction to using Flink ML. Readers of this

Review Comment:
   According to the offline discussion, I have added a "Getting Started" section to the main README.



-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [flink-ml] lindong28 commented on a diff in pull request #115: [FLINK-26828] Add flink-ml-examples module

Posted by GitBox <gi...@apache.org>.
lindong28 commented on code in PR #115:
URL: https://github.com/apache/flink-ml/pull/115#discussion_r905811310


##########
flink-ml-examples/src/test/java/org/apache/flink/ml/examples/ExamplesTest.java:
##########
@@ -0,0 +1,129 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.ml.examples;
+
+import org.apache.flink.test.util.AbstractTestBase;
+
+import org.apache.commons.io.output.NullPrintStream;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.PrintStream;
+import java.lang.reflect.Method;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Objects;
+import java.util.concurrent.Callable;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.Future;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.TimeoutException;
+
+/** Extracts all example classes in this package and tests their main methods. */
+@RunWith(Parameterized.class)
+public class ExamplesTest extends AbstractTestBase {

Review Comment:
   Do we still need this class?



-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [flink-ml] yunfengzhou-hub commented on a diff in pull request #115: [FLINK-26828] Add flink-ml-examples module

Posted by GitBox <gi...@apache.org>.
yunfengzhou-hub commented on code in PR #115:
URL: https://github.com/apache/flink-ml/pull/115#discussion_r905844469


##########
docs/content/docs/try-flink-ml/quick-start.md:
##########
@@ -27,213 +27,64 @@ under the License.
 # Quick Start
 
 This document provides a quick introduction to using Flink ML. Readers of this

Review Comment:
   There is a `document` section in the main README that can guide users to the document website. In the front page of the website there is a "try flink ml" section that contains a link to the quick start page.



-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [flink-ml] yunfengzhou-hub commented on a diff in pull request #115: [FLINK-26828] Add flink-ml-examples module

Posted by GitBox <gi...@apache.org>.
yunfengzhou-hub commented on code in PR #115:
URL: https://github.com/apache/flink-ml/pull/115#discussion_r905850369


##########
docs/content/docs/try-flink-ml/quick-start.md:
##########
@@ -27,213 +27,64 @@ under the License.
 # Quick Start
 
 This document provides a quick introduction to using Flink ML. Readers of this
-document will be guided to create a simple Flink job that trains a Machine
+document will be guided to submit a simple Flink job that trains a Machine
 Learning Model and use it to provide prediction service.
 
-## Maven Setup
+## Prerequisite
 
-In order to use Flink ML in a Maven project, add the following dependencies to
-`pom.xml`.
+Please make sure you have installed Flink 1.15.0 in your local environment and

Review Comment:
   I think flink-ml-benchmark/README.md is a good example. I'll modify the document as the README describes.



-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [flink-ml] lindong28 commented on pull request #115: [FLINK-26828] Add flink-ml-examples module

Posted by GitBox <gi...@apache.org>.
lindong28 commented on PR #115:
URL: https://github.com/apache/flink-ml/pull/115#issuecomment-1165635613

   @yunfengzhou-hub Thanks for the update! LGTM.


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [flink-ml] lindong28 merged pull request #115: [FLINK-26828] Add flink-ml-examples module

Posted by GitBox <gi...@apache.org>.
lindong28 merged PR #115:
URL: https://github.com/apache/flink-ml/pull/115


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org