[英]Installing FlinkML DenseVector dependency - why are there two different implementations?
I'm a bit confused as to how to install the dependencies I actually need.对于如何安装我实际需要的依赖项,我有点困惑。
I'm new to both Java and Flink, and I think I'm missing something minor here.我是 Java 和 Flink 的新手,我想我在这里遗漏了一些小东西。 I'm doing a basic exercise where I need the DenseVector
class, that supports basic mathematical operations.我正在做一个基本练习,我需要DenseVector
class,它支持基本的数学运算。
I searched for flink
docs and found this class .我搜索了flink
文档并找到了这个 class 。 So it's artefact id is org.apache.flink.ml.common.linalg.DenseVector
.所以它的人工制品 ID 是org.apache.flink.ml.common.linalg.DenseVector
。 This class supports operations such as dot product.这个class支持点积等操作。
Now I go to the flinkml
tutorial page and it says I need the following dependency现在我 go 到flinkml
教程页面,它说我需要以下依赖项
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-ml-uber</artifactId>
<version>2.1.0</version>
</dependency>
When I install that however, the only DenseVector
I get installed is this one , which seems to be representing the same entity, but the API is very limited - it basically supports no mathematical operations.然而,当我安装它时,我安装的唯一DenseVector
是这个,它似乎代表同一个实体,但 API 非常有限 - 它基本上不支持任何数学运算。
My question is: I can't seem to find a way to install a dependency that would give me access to org.apache.flink.ml.common.linalg.DenseVector
.我的问题是:我似乎无法找到一种方法来安装可以让我访问org.apache.flink.ml.common.linalg.DenseVector
的依赖项。 What maven dependency do I need to get that?我需要什么 maven 依赖才能得到它? I've checked a few packages at https://mvnrepository.com/ , but could not find the one I need.我已经在https://mvnrepository.com/检查了几个包,但找不到我需要的包。 What am I missing?我错过了什么?
Thanks!谢谢!
There are two different implementations because there was a major refactor with FlinkML 2.0.有两种不同的实现,因为 FlinkML 2.0 进行了重大重构。
You can install the dependency according to https://nightlies.apache.org/flink/flink-ml-docs-release-2.1/docs/try-flink-ml/build-your-own-project/ .您可以根据https://nightlies.apache.org/flink/flink-ml-docs-release-2.1/docs/try-flink-ml/build-your-own-project/安装依赖。 Then you can get access to those mathematical operations by using this class https://github.com/apache/flink-ml/blob/master/flink-ml-core/src/main/java/org/apache/flink/ml/linalg/BLAS.java .然后,您可以使用此 class https://github.com/apache/flink-ml/blob/master/flink-ml-core/src/main/java/org/apache/flink/ml访问这些数学运算/linalg/BLAS.java 。
Maybe we can use the answer provided by the owner and close this thread.也许我们可以使用所有者提供的答案并关闭此线程。
Okay, so I figured out what was going on.好的,所以我知道发生了什么事。 Apparently, there was a major refactor with FlinkML 2.0, because the package I'm interested in is available all the way up to this version显然,FlinkML 2.0 有一个重大的重构,因为我感兴趣的 package 一直可用到这个版本
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-ml-lib_2.12</artifactId>
<version>1.12.7</version>
</dependency>
With this version, the latest update that is有了这个版本,最新的更新就是
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-ml-lib_2.12</artifactId>
<version>2.0.0</version>
</dependency>
the codebase was refactored as the dependency I was looking for can now be find with this import: import org.apache.flink.ml.math.DenseVector;
代码库被重构,因为现在可以通过此导入找到我正在寻找的依赖项: import org.apache.flink.ml.math.DenseVector;
This vector implementation has all mathematical operations I was interested in.这个向量实现包含我感兴趣的所有数学运算。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.