gpt4 book ai didi

apache-spark - Spark 或其他技术中的混合效应模型

转载 作者:行者123 更新时间:2023-12-03 14:44:49 26 4
gpt4 key购买 nike

是否可以在 Spark 中运行混合效应回归模型? (就像我们可以在 R 中使用 lme4,在 Julia 中使用 MixedModels 或在 Python 中使用 Statsmodels MixedLM 所做的那样)。
任何例子都会很棒。

我读过有一个 GLMix 函数,但我不知道用户是否可以直接使用它来拟合模型并获取系数和 p 值,或者它是否只能由机器学习库在内部使用。

我想转移到 Spark,因为我的数据集比内存大得多。

是否有任何其他通用数据库或框架能够执行类似从磁盘流式传输数据的操作?
我只看到一些能够做简单的线性回归。

问候

最佳答案

是的,这绝对可以通过 Spark 实现。
我首先要研究的是一个相当流行的库,称为 ML Lib。我不确定它是否正是您需要的那种模型,但绝对不仅仅是“简单的线性回归”。
另一个图书馆'linkedin/photon-ml' ,我不熟悉,确实明确提到了混合效应模型。
以下是使用 Generalized Additive Mixed Effects 驱动程序的示例:

spark-submit \
--class com.linkedin.photon.ml.cli.game.GameTrainingDriver \
--master local[*] \
--num-executors 4 \
--driver-memory 1G \
--executor-memory 1G \
"./build/photon-all_2.10/libs/photon-all_2.10-1.0.0.jar" \
--input-data-directories "./a1a/train/" \
--validation-data-directories "./a1a/test/" \
--root-output-directory "out" \
--feature-shard-configurations "name=globalShard,feature.bags=features" \
--coordinate-configurations "name=global,feature.shard=globalShard,min.partitions=4,optimizer=LBFGS,tolerance=1.0E-6,max.iter=50,regularization=L2,reg.weights=0.1|1|10|100" \
--coordinate-update-sequence "global" \
--coordinate-descent-iterations 1 \
--training-task "LOGISTIC_REGRESSION"

关于apache-spark - Spark 或其他技术中的混合效应模型,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39790820/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com