dmitrievanthony commented on a change in pull request #6232: IGNITE-11449: 
Vectorizer API for feature/label extracting
URL: https://github.com/apache/ignite/pull/6232#discussion_r267791673
 
 

 ##########
 File path: 
modules/ml/src/main/java/org/apache/ignite/ml/dataset/feature/extractor/Vectorizer.java
 ##########
 @@ -0,0 +1,303 @@
+/*
+ * 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.dataset.feature.extractor;
+
+import java.io.Serializable;
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.List;
+import java.util.stream.Collectors;
+import org.apache.ignite.binary.BinaryObject;
+import org.apache.ignite.internal.util.typedef.internal.A;
+import org.apache.ignite.ml.math.functions.IgniteFunction;
+import org.apache.ignite.ml.math.primitives.vector.Vector;
+import org.apache.ignite.ml.math.primitives.vector.impl.DenseVector;
+import org.apache.ignite.ml.structures.LabeledVector;
+import org.apache.ignite.ml.trainers.FeatureLabelExtractor;
+
+/**
+ * Class for extracting labeled vectors from upstream. This is an abstract 
class providing API for extracting feature
+ * and label values by "coordinates" of them from upstream objects. For 
example {@link BinaryObject} can be upstream
+ * object and coordinates for them are names of fields with double-values.
+ *
+ * @param <K> Type of keys in upstream.
+ * @param <V> Type of values in upstream.
+ * @param <C> Type of "coordinate" - index of feature value in upstream object.
+ * @param <L> Type of label for resulting vectors.
+ */
+public abstract class Vectorizer<K, V, C, L> implements 
FeatureLabelExtractor<K, V, L>, Serializable {
+    /** Label coordinate shortcut. */
+    private LabelCoordinate lbCoordinateShortcut = null;
+
+    /** Serial version uid. */
+    private static final long serialVersionUID = 4301406952131379459L;
+    /** If useAllValues == true then Vectorizer extract all fields as features 
from upstream object (except label). */
 
 Review comment:
   Empty line between field declarations.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to