本文整理匯總了Java中org.apache.flink.test.testdata.KMeansData類的典型用法代碼示例。如果您正苦於以下問題:Java KMeansData類的具體用法?Java KMeansData怎麽用?Java KMeansData使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
KMeansData類屬於org.apache.flink.test.testdata包,在下文中一共展示了KMeansData類的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: testKMeansJobWithCustomClassLoader
import org.apache.flink.test.testdata.KMeansData; //導入依賴的package包/類
@Test
public void testKMeansJobWithCustomClassLoader() throws IOException, ProgramInvocationException {
PackagedProgram kMeansProg = new PackagedProgram(
new File(KMEANS_JAR_PATH),
new String[] {
KMeansData.DATAPOINTS,
KMeansData.INITIAL_CENTERS,
"25"
});
TestEnvironment.setAsContext(
testCluster,
parallelism,
Collections.singleton(new Path(KMEANS_JAR_PATH)),
Collections.<URL>emptyList());
kMeansProg.invokeInteractiveModeForExecution();
}
示例2: postSubmit
import org.apache.flink.test.testdata.KMeansData; //導入依賴的package包/類
@Override
protected void postSubmit() throws Exception {
List<String> resultLines = new ArrayList<String>();
readAllResultLines(resultLines, resultPath);
KMeansData.checkResultsWithDelta(KMeansData.CENTERS_AFTER_20_ITERATIONS_SINGLE_DIGIT, resultLines, 0.1);
}
示例3: preSubmit
import org.apache.flink.test.testdata.KMeansData; //導入依賴的package包/類
@Override
protected void preSubmit() throws Exception {
dataPath = createTempFile("datapoints.txt", KMeansData.DATAPOINTS);
clusterPath = createTempFile("initial_centers.txt", KMeansData.INITIAL_CENTERS);
resultPath = getTempDirPath("result");
}
示例4: postSubmit
import org.apache.flink.test.testdata.KMeansData; //導入依賴的package包/類
@Override
protected void postSubmit() throws Exception {
compareResultsByLinesInMemory(KMeansData.CENTERS_AFTER_20_ITERATIONS_SINGLE_DIGIT, resultPath);
}