简体   繁体   English

Apache Spark MLlib:Java中的OLS回归

[英]Apache Spark MLlib : OLS regression in Java

I have been looking at the documentation of Apache Spark MLlib, and can't seem to find Linear Regression that uses Ordinary Least Squares (OLS). 我一直在查看Apache Spark MLlib的文档,但似乎找不到使用普通最小二乘(OLS)的线性回归。 I only see examples of the numerical based algorithm for Stochastic Gradient Descent (SGD) method of doing Linear Regression. 我只看到进行线性回归的基于随机梯度下降(SGD)方法的基于数字算法的示例。 I need the closed form OLS Linear Regression method, not SGD. 我需要封闭形式的OLS线性回归方法,而不是SGD。

I am surprised how hard it is to try to find OLS regression in this, when OLS regression is one of the first most basic of Linear Regression methods. 当OLS回归是最基本的线性回归方法之一时,我很难在其中找到OLS回归。

It is hard to find because Spark doesn't provide an implementation. 很难找到,因为Spark没有提供实现。 The rationale is pretty simple. 基本原理很简单。 If you have data which requires Spark then the cost of computing an analytical solution will be prohibitive. 如果您有需要Spark的数据,那么计算分析解决方案的成本将是惊人的。

If you really need this then RowMatrix provides tallSkinnyQR . 如果您确实需要此功能,那么RowMatrix提供tallSkinnyQR It should give you something to work with although it is rather unlikely to be useful in practice. 尽管它不太可能在实践中有用,但它应该为您提供一些有用的东西。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM