artemmalykh commented on a change in pull request #5767: [ML] IGNITE-10573: 
Consistent API for Ensemble training
URL: https://github.com/apache/ignite/pull/5767#discussion_r247885884
 
 

 ##########
 File path: 
modules/ml/src/main/java/org/apache/ignite/ml/trainers/DatasetTrainer.java
 ##########
 @@ -362,4 +362,29 @@ public EmptyDatasetException() {
         }
     }
 
+    /**
+     * Returns the trainer which returns identity model.
+     *
+     * @param <I> Type of model input.
+     * @param <L> Type of labels in dataset.
+     * @return Trainer which returns identity model.
+     */
+    public static <I, L> DatasetTrainer<IgniteModel<I, I>, L> 
identityTrainer() {
+        return new DatasetTrainer<IgniteModel<I, I>, L>() {
+            @Override public <K, V> IgniteModel<I, I> fit(DatasetBuilder<K, V> 
datasetBuilder,
+                IgniteBiFunction<K, V, Vector> featureExtractor,
+                IgniteBiFunction<K, V, L> lbExtractor) {
+                return x -> x;
+            }
+
+            @Override protected boolean checkState(IgniteModel<I, I> mdl) {
 
 Review comment:
   Fixed.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to