You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by GitBox <gi...@apache.org> on 2019/01/23 12:46:50 UTC

[GitHub] dmitrievanthony commented on a change in pull request #5881: IGNITE-10834: Add NamedVector into ML module.

dmitrievanthony commented on a change in pull request #5881: IGNITE-10834: Add NamedVector into ML module.
URL: https://github.com/apache/ignite/pull/5881#discussion_r250179644
 
 

 ##########
 File path: modules/ml/src/main/java/org/apache/ignite/ml/math/primitives/vector/VectorUtils.java
 ##########
 @@ -218,6 +221,28 @@ public static Vector of(Double[] values) {
         return answer;
     }
 
+    /**
+     * Creates named vector based on map of keys and values.
+     *
+     * @param values Values.
+     * @return Named vector.
+     */
+    public static NamedVector of(Map<String, Double> values) {
+        SparseVector vector = new SparseVector(values.size(), StorageConstants.RANDOM_ACCESS_MODE);
+        for (int i = 0; i < values.size(); i++)
 
 Review comment:
   Updated.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services