factor_analyzer icon indicating copy to clipboard operation
factor_analyzer copied to clipboard

`UnboundLocalError` with principal-lapack method types and any oblique rotations

Open vargava opened this issue 3 years ago • 1 comments

Describe the bug It appears to be an issue due to a variable new_order defined within a condition that excludes the principal method for EFA, but then calls upon the same variable in a conditional format when there is a structure matrix. Basically, there needs to be a more accessible definition of what the new_order is, in the event that we have a principal method choice and also have a structure matrix.

To Reproduce Steps to reproduce the behaviour: On initiating the FactorAnlyzer class, with the method is selected as principal, SVD as lapck, and the rotation as any of the available oblique rotations (promax, oblimin, quartimin), fitting the data results in an UnboundLocalError. While using varimax I don't hit this error with the same method and SVD choices.

Expected behaviour I get oblique factors regardless of the dataframe I pass to it (nonsense in should be nonsense out, at its worst)

Screenshots Screen Shot 2022-02-04 at 3 35 33 PM

Desktop (please complete the following information):

  • OS: LINUX
  • Browser jupyter/ CHROME v97.0.4692.99

Additional context The error occurs here: https://github.com/EducationalTestingService/factor_analyzer/blob/94ac334673cb58f2a1f1e732b1a446b7517fd23d/factor_analyzer/factor_analyzer.py#L684-L693

vargava avatar Feb 04 '22 10:02 vargava

Thanks for raising this. Will take a look soon!

jbiggsets avatar Mar 04 '22 17:03 jbiggsets