random initial values for rotation matrix in GPA rotations
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 45/100
調査の方向性
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
- フォーク
- 1
- PR マージ指標
- 30日以内にマージされた PR はありません
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
EducationalTestingService/factor_analyzer のほかの issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 55/100
EducationalTestingService/factor_analyzer#148 · コメント 4 件 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 55/100
EducationalTestingService/factor_analyzer#147 · リアクション 1 件 ·
-
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 件 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 55/100
EducationalTestingService/factor_analyzer の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
anthropics/skills#1811 · コメント 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
speaches-ai/speaches#678 ·
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
datalayer/mcp-compose#42 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
conda-forge/spacy-feedstock#177 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
UKGovernmentBEIS/inspect_evals#2523 ·