You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by ag...@apache.org on 2018/04/16 13:57:48 UTC
[38/50] [abbrv] ignite git commit: IGNITE-8232: ML package cleanup
for 2.5 release
http://git-wip-us.apache.org/repos/asf/ignite/blob/47cfdc27/modules/ml/src/test/java/org/apache/ignite/ml/trainers/group/TestTrainingLoopStep.java
----------------------------------------------------------------------
diff --git a/modules/ml/src/test/java/org/apache/ignite/ml/trainers/group/TestTrainingLoopStep.java b/modules/ml/src/test/java/org/apache/ignite/ml/trainers/group/TestTrainingLoopStep.java
deleted file mode 100644
index caf92f6..0000000
--- a/modules/ml/src/test/java/org/apache/ignite/ml/trainers/group/TestTrainingLoopStep.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * 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.ignite.ml.trainers.group;
-
-import java.util.List;
-import java.util.UUID;
-import java.util.stream.Stream;
-import org.apache.ignite.Ignition;
-import org.apache.ignite.ml.math.functions.IgniteFunction;
-import org.apache.ignite.ml.math.functions.IgniteSupplier;
-import org.apache.ignite.ml.trainers.group.chain.DistributedEntryProcessingStep;
-import org.apache.ignite.ml.trainers.group.chain.EntryAndContext;
-
-/** */
-public class TestTrainingLoopStep implements DistributedEntryProcessingStep<TestGroupTrainerLocalContext,
- Double, Integer, Void, Double, Double> {
- /** {@inheritDoc} */
- @Override public IgniteSupplier<Void> remoteContextSupplier(Double input, TestGroupTrainerLocalContext locCtx) {
- // No context is needed.
- return () -> null;
- }
-
- /** {@inheritDoc} */
- @Override public IgniteFunction<EntryAndContext<Double, Integer, Void>, ResultAndUpdates<Double>> worker() {
- return entryAndContext -> {
- Integer oldVal = entryAndContext.entry().getValue();
- double v = oldVal * oldVal;
- ResultAndUpdates<Double> res = ResultAndUpdates.of(v);
- res.updateCache(TestGroupTrainingCache.getOrCreate(Ignition.localIgnite()),
- entryAndContext.entry().getKey(), (int)v);
- return res;
- };
- }
-
- /** {@inheritDoc} */
- @Override public IgniteSupplier<Stream<GroupTrainerCacheKey<Double>>> keys(Double input,
- TestGroupTrainerLocalContext locCtx) {
- // Copying here because otherwise locCtx will be serialized with supplier returned in result.
- int limit = locCtx.limit();
- int cnt = locCtx.eachNumberCnt();
- UUID uuid = locCtx.trainingUUID();
-
- return () -> TestGroupTrainingCache.allKeys(limit, cnt, uuid);
- }
-
- /** {@inheritDoc} */
- @Override public IgniteFunction<List<Double>, Double> reducer() {
- return doubles -> doubles.stream().mapToDouble(x -> x).sum();
- }
-}
http://git-wip-us.apache.org/repos/asf/ignite/blob/47cfdc27/modules/ml/src/test/java/org/apache/ignite/ml/trainers/group/TrainersGroupTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/ml/src/test/java/org/apache/ignite/ml/trainers/group/TrainersGroupTestSuite.java b/modules/ml/src/test/java/org/apache/ignite/ml/trainers/group/TrainersGroupTestSuite.java
deleted file mode 100644
index 0ec5afb..0000000
--- a/modules/ml/src/test/java/org/apache/ignite/ml/trainers/group/TrainersGroupTestSuite.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * 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.ignite.ml.trainers.group;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-/**
- * Test suite for group trainer tests.
- */
-@RunWith(Suite.class)
-@Suite.SuiteClasses({
- DistributedWorkersChainTest.class,
- GroupTrainerTest.class
-})
-public class TrainersGroupTestSuite {
-}
http://git-wip-us.apache.org/repos/asf/ignite/blob/47cfdc27/modules/yardstick/src/main/java/org/apache/ignite/yardstick/ml/regression/IgniteOLSMultipleLinearRegressionBenchmark.java
----------------------------------------------------------------------
diff --git a/modules/yardstick/src/main/java/org/apache/ignite/yardstick/ml/regression/IgniteOLSMultipleLinearRegressionBenchmark.java b/modules/yardstick/src/main/java/org/apache/ignite/yardstick/ml/regression/IgniteOLSMultipleLinearRegressionBenchmark.java
deleted file mode 100644
index 89b5471..0000000
--- a/modules/yardstick/src/main/java/org/apache/ignite/yardstick/ml/regression/IgniteOLSMultipleLinearRegressionBenchmark.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * 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.ignite.yardstick.ml.regression;
-
-import java.util.Map;
-import org.apache.ignite.ml.math.impls.matrix.DenseLocalOnHeapMatrix;
-import org.apache.ignite.ml.regressions.linear.LinearRegressionModel;
-import org.apache.ignite.ml.regressions.linear.LinearRegressionQRTrainer;
-import org.apache.ignite.yardstick.IgniteAbstractBenchmark;
-
-/**
- * Ignite benchmark that performs ML Grid operations.
- */
-@SuppressWarnings("unused")
-public class IgniteOLSMultipleLinearRegressionBenchmark extends IgniteAbstractBenchmark {
- /** {@inheritDoc} */
- @Override public boolean test(Map<Object, Object> ctx) throws Exception {
- runLongly();
-
- return true;
- }
-
- /**
- * Based on OLSMultipleLinearRegressionTest#testLongly.
- */
- private void runLongly() {
- // Y values are first, then independent vars
- // Each row is one observation
- double[][] data = new double[][] {
- { 60323, 83.0, 234289, 2356, 1590, 107608, 1947 },
- { 61122, 88.5, 259426, 2325, 1456, 108632, 1948 },
- { 60171, 88.2, 258054, 3682, 1616, 109773, 1949 },
- { 61187, 89.5, 284599, 3351, 1650, 110929, 1950 },
- { 63221, 96.2, 328975, 2099, 3099, 112075, 1951 },
- { 63639, 98.1, 346999, 1932, 3594, 113270, 1952 },
- { 64989, 99.0, 365385, 1870, 3547, 115094, 1953 },
- { 63761, 100.0, 363112, 3578, 3350, 116219, 1954 },
- { 66019, 101.2, 397469, 2904, 3048, 117388, 1955 },
- { 67857, 104.6, 419180, 2822, 2857, 118734, 1956 },
- { 68169, 108.4, 442769, 2936, 2798, 120445, 1957 },
- { 66513, 110.8, 444546, 4681, 2637, 121950, 1958 },
- { 68655, 112.6, 482704, 3813, 2552, 123366, 1959 },
- { 69564, 114.2, 502601, 3931, 2514, 125368, 1960 },
- { 69331, 115.7, 518173, 4806, 2572, 127852, 1961 },
- { 70551, 116.9, 554894, 4007, 2827, 130081, 1962 }
- };
-
- final int nobs = 16;
- final int nvars = 6;
-
- LinearRegressionQRTrainer trainer = new LinearRegressionQRTrainer();
- LinearRegressionModel model = trainer.train(new DenseLocalOnHeapMatrix(data));
- }
-}
http://git-wip-us.apache.org/repos/asf/ignite/blob/47cfdc27/modules/yardstick/src/main/java/org/apache/ignite/yardstick/ml/regression/package-info.java
----------------------------------------------------------------------
diff --git a/modules/yardstick/src/main/java/org/apache/ignite/yardstick/ml/regression/package-info.java b/modules/yardstick/src/main/java/org/apache/ignite/yardstick/ml/regression/package-info.java
deleted file mode 100644
index 0a5dc1a..0000000
--- a/modules/yardstick/src/main/java/org/apache/ignite/yardstick/ml/regression/package-info.java
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * 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 description. -->
- * ML Grid regression benchmarks.
- */
-package org.apache.ignite.yardstick.ml.regression;
\ No newline at end of file