Skip to content

Commit b11e839

Browse files
authored
Merge pull request #91 from EducationalTestingService/release/0.4.0
Release/0.4.0
2 parents 58ca155 + 73908b0 commit b11e839

File tree

10 files changed

+66
-88
lines changed

10 files changed

+66
-88
lines changed

.gitlab-ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ stages:
44
- test
55

66
variables:
7-
PYVERSION: "3.8"
7+
PYVERSION: "3.9"
88
NOSE_WITH_COV: "1"
99
NOSE_COVER_PACKAGE: "factor_analyzer"
1010
LOGCAPTURE_LEVEL: "DEBUG"

README.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ Confirmatory factor analysis example.
187187
Requirements
188188
------------
189189

190-
- Python 3.4 or higher
190+
- Python 3.7 or higher
191191
- ``numpy``
192192
- ``pandas``
193193
- ``scipy``

conda-recipe/factor_analyzer/meta.yaml

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
{% set name = "factor_analyzer" %}
2-
{% set version = "0.3.2" %}
3-
{% set file_ext = "tar.gz" %}
4-
{% set hash_type = "sha256" %}
5-
{% set hash_value = "94ea4c7d46e846cc7174787adce47156cf58dc257905c878edc5181b4fa300ed" %}
2+
{% set version = "0.4.0" %}
63

74
package:
85
name: '{{ name|lower }}'

factor_analyzer/__init__.py

+15-20
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,24 @@
1-
# License: GLP2
1+
# License: GPL2
22
"""
33
:author: Jeremy Biggs (jbiggs@ets.org)
4-
:organization: ETS
4+
:author: Nitin Madnani (nmadnani@ets.org)
5+
:organization: Educational Testing Service
6+
:date: 2021-10-18
57
"""
68

9+
from .confirmatory_factor_analyzer import ConfirmatoryFactorAnalyzer, ModelSpecification, ModelSpecificationParser
10+
from .factor_analyzer import FactorAnalyzer, calculate_bartlett_sphericity, calculate_kmo
711
from .rotator import Rotator
8-
9-
from .factor_analyzer import (FactorAnalyzer,
10-
calculate_bartlett_sphericity,
11-
calculate_kmo)
12-
13-
from .confirmatory_factor_analyzer import (ConfirmatoryFactorAnalyzer,
14-
ModelSpecificationParser,
15-
ModelSpecification)
16-
17-
from .utils import (cov,
12+
from .utils import (commutation_matrix,
1813
corr,
19-
fill_lower_diag,
20-
impute_values,
21-
smc,
22-
partial_correlations,
23-
merge_variance_covariance,
14+
cov,
15+
covariance_to_correlation,
2416
duplication_matrix,
2517
duplication_matrix_pre_post,
26-
covariance_to_correlation,
27-
commutation_matrix,
18+
fill_lower_diag,
2819
get_symmetric_lower_idxs,
29-
get_symmetric_upper_idxs)
20+
get_symmetric_upper_idxs,
21+
impute_values,
22+
merge_variance_covariance,
23+
partial_correlations,
24+
smc)

factor_analyzer/confirmatory_factor_analyzer.py

+18-18
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,33 @@
11
"""
2-
Confirmatory factor analysis using ML.
2+
Confirmatory factor analysis using machine learning methods.
33
44
:author: Jeremy Biggs (jbiggs@ets.org)
5-
:date: 2/05/2019
6-
:organization: ETS
5+
:author: Nitin Madnani (nmadnani@ets.org)
6+
:organization: Educational Testing Service
7+
:date: 2021-10-18
78
"""
89

9-
import pandas as pd
10-
import numpy as np
1110
import warnings
12-
1311
from copy import deepcopy
14-
from scipy.optimize import minimize
15-
from scipy.linalg import block_diag
1612

13+
import numpy as np
14+
import pandas as pd
15+
from scipy.linalg import block_diag
16+
from scipy.optimize import minimize
1717
from sklearn.base import BaseEstimator, TransformerMixin
1818
from sklearn.utils import check_array
1919
from sklearn.utils.validation import check_is_fitted
2020

21-
from factor_analyzer.utils import (cov,
22-
covariance_to_correlation,
23-
commutation_matrix,
24-
duplication_matrix_pre_post,
25-
get_free_parameter_idxs,
26-
get_symmetric_lower_idxs,
27-
get_symmetric_upper_idxs,
28-
impute_values,
29-
unique_elements,
30-
merge_variance_covariance)
21+
from .utils import (commutation_matrix,
22+
cov,
23+
covariance_to_correlation,
24+
duplication_matrix_pre_post,
25+
get_free_parameter_idxs,
26+
get_symmetric_lower_idxs,
27+
get_symmetric_upper_idxs,
28+
impute_values,
29+
merge_variance_covariance,
30+
unique_elements)
3131

3232

3333
class ModelSpecification:

factor_analyzer/factor_analyzer.py

+9-18
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,27 @@
11
"""
2-
Factor analysis using MINRES or ML,
3-
with optional rotation using Varimax or Promax.
2+
Factor analysis using MINRES or ML, with optional rotation using Varimax or Promax.
43
54
:author: Jeremy Biggs (jbiggs@ets.org)
65
:author: Nitin Madnani (nmadnani@ets.org)
7-
:date: 10/25/2017
8-
:organization: ETS
6+
:organization: Educational Testing Service
7+
:date: 2021-10-18
98
"""
109

1110
import warnings
1211

1312
import numpy as np
14-
import scipy as sp
1513
import pandas as pd
16-
17-
from scipy.stats import chi2, pearsonr
14+
import scipy as sp
1815
from scipy.optimize import minimize
19-
16+
from scipy.stats import chi2, pearsonr
2017
from sklearn.base import BaseEstimator, TransformerMixin
21-
22-
from factor_analyzer.utils import (corr,
23-
impute_values,
24-
partial_correlations,
25-
smc)
26-
from factor_analyzer.rotator import Rotator
27-
from factor_analyzer.rotator import POSSIBLE_ROTATIONS, OBLIQUE_ROTATIONS
28-
29-
30-
from sklearn.utils.extmath import randomized_svd
3118
from sklearn.utils import check_array
19+
from sklearn.utils.extmath import randomized_svd
3220
from sklearn.utils.validation import check_is_fitted
3321

22+
from .rotator import OBLIQUE_ROTATIONS, POSSIBLE_ROTATIONS, Rotator
23+
from .utils import corr, impute_values, partial_correlations, smc
24+
3425
POSSIBLE_SVDS = ['randomized', 'lapack']
3526

3627
POSSIBLE_IMPUTATIONS = ['mean', 'median', 'drop']

factor_analyzer/rotator.py

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
"""
2-
Rotator class to perform various
3-
rotations of factor loading matrices.
2+
Class to perform various rotations of factor loading matrices.
43
54
:author: Jeremy Biggs (jbiggs@ets.org)
6-
:date: 05/21/2018
7-
:organization: ETS
5+
:author: Nitin Madnani (nmadnani@ets.org)
6+
:organization: Educational Testing Service
7+
:date: 2021-10-18
88
"""
99

1010
import numpy as np
1111
import scipy as sp
12-
1312
from sklearn.base import BaseEstimator
1413

1514
ORTHOGONAL_ROTATIONS = ['varimax', 'oblimax', 'quartimax', 'equamax', 'geomin_ort']

factor_analyzer/test_utils.py

+8-12
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,21 @@
11
"""
2-
Testing utilities
2+
Utility functions used for testing.
33
44
:author: Jeremy Biggs (jbiggs@ets.org)
5-
:date: 05/21/2018
6-
:organization: ETS
5+
:author: Nitin Madnani (nmadnani@ets.org)
6+
:organization: Educational Testing Service
7+
:date: 2021-10-18
78
"""
89

9-
import os
10-
import math
1110
import json
11+
import math
12+
import os
13+
from os.path import join
1214

1315
import numpy as np
1416
import pandas as pd
15-
from os.path import join
16-
17+
from factor_analyzer import ConfirmatoryFactorAnalyzer, FactorAnalyzer, ModelSpecificationParser, Rotator
1718
from factor_analyzer.utils import unique_elements
18-
from factor_analyzer import ModelSpecificationParser
19-
from factor_analyzer import ConfirmatoryFactorAnalyzer
20-
from factor_analyzer import FactorAnalyzer
21-
from factor_analyzer import Rotator
22-
2319

2420
DATA_DIR = os.path.join('tests', 'data')
2521
JSON_DIR = os.path.join('tests', 'model')

factor_analyzer/utils.py

+6-5
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
"""
2-
Utility functions, used primarily by
3-
the confirmatory factor analysis module.
2+
Utility functions, used primarily by the confirmatory factor analysis module.
43
54
:author: Jeremy Biggs (jbiggs@ets.org)
6-
:date: 2/05/2019
7-
:organization: ETS
5+
:author: Nitin Madnani (nmadnani@ets.org)
6+
:organization: Educational Testing Service
7+
:date: 2021-10-18
88
"""
9-
import numpy as np
109
import warnings
10+
11+
import numpy as np
1112
from scipy.linalg import cholesky
1213

1314

setup.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def requirements():
1616

1717

1818
setup(name='factor_analyzer',
19-
version='0.3.2',
19+
version='0.4.0',
2020
description='A Factor Analysis class',
2121
long_description=readme(),
2222
keywords='factor analysis',
@@ -35,9 +35,8 @@ def requirements():
3535
'Operating System :: Unix',
3636
'Operating System :: MacOS',
3737
'Programming Language :: Python :: 3',
38-
'Programming Language :: Python :: 3.4',
39-
'Programming Language :: Python :: 3.5',
40-
'Programming Language :: Python :: 3.6',
4138
'Programming Language :: Python :: 3.7',
39+
'Programming Language :: Python :: 3.8',
40+
'Programming Language :: Python :: 3.9',
4241
],
4342
zip_safe=True)

0 commit comments

Comments
 (0)