random initial values for rotation matrix in GPA rotations
还没有人认领这个 Issue。
评估
调研方向
从 factor_analyzer/rotator.py 中的 Rotator._oblique、Rotator._orthogonal 和 Rotator._varimax 开始,然后检查其他旋转方法是否使用相同的初始化方式。验证当前的单位矩阵行为,定义 random_state 如何控制正交初始化,并确认默认值保持不变。
由索引模型根据 Issue 内容生成。
描述
Hi all. First, thanks so much to the devs of factor_analyzer. It's a fantastic and much needed package!
Is your feature request related to a problem? Please describe.
As has been pointed out, the GPA rotation methods often converge to local minima (Browne, 2001; Bernaards & Jennrich, 2005; Nguyen & Waller, 2022). As such, it's been recommended researchers initialize the GPA from many starting values when searching for a global minimum. I'm wondering if the Rotator class could be amended in order to allow initializing the GPA from different starting values.
Describe the solution you'd like
One simple solution would be for the Rotator class to accept a new argument, random_state, which defaults to None. When random_state = None, the rotation matrix is initialized with np.eye(n_cols) as is currently implemented (L326, L416, L493). When a user specifies a seed, however, the rotation matrix is initialized as a random orthogonal matrix from scipy.stats.ortho_group. That is,:
# initialize the rotation matrix
_, n_cols = loadings.shape
if self.random_state == None:
rotation_matrix = np.eye(n_cols)
else:
rotation_matrix = sp.stats.ortho_group(dim=n_cols, seed=self.random_state).rvs()
A solution like the above could be added to the Rotator._oblique, Rotator._orthogonal, Rotator._varimax methods (and any others that I missed).
Apologies in advance if the above is already possible and I've simply missed how. If the above sounds like it may be useful, I'd be happy to attempt a PR.
All the best,
Sam (@szorowi1)
- 主要语言
- Python
- 星标
- 6
- 派生
- 2
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
EducationalTestingService/factor_analyzer 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 72/100
-
难度 1/5 1 小时以内 新手友好度 55/100
EducationalTestingService/factor_analyzer#148 · 4 条评论 ·
-
难度 1/5 1 小时以内 新手友好度 55/100
EducationalTestingService/factor_analyzer#147 · 1 个 reaction ·
-
Order of variables when DF is fed to fit with CFA: either document or actually use the column names?未关闭
难度 4/5 3-5 天 新手友好度 35/100
EducationalTestingService/factor_analyzer#146 · 1 条评论 ·
-
难度 4/5 3-5 天 新手友好度 25/100
EducationalTestingService/factor_analyzer#145 · 3 条评论 ·
查看 EducationalTestingService/factor_analyzer 的全部 Issue
相似的 Issue
-
upstream update
难度 2/5 1-3 小时 新手友好度 75/100
conan-io/conan-center-index#31098 ·
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
john-kurkowski/tldextract#382 ·
-
comp/tools duplicate P2 sweeper:risk-compatibility tool/mcp type/bug
难度 1/5 1 小时以内 新手友好度 88/100
NousResearch/hermes-agent#132042 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
deepset-ai/haystack#13092 ·
维护者通常 1 天内回复
-
难度 1/5 1-3 小时 新手友好度 85/100
feder-cr/invisible_playwright_mcp#1408 ·
维护者通常 1 天内回复