Skip to main content

The interpretablefa package

Overview

This is a package, which is available on the Python Package Index, for performing interpretable factor analysis. This implements the priorimax rotation, including the associated interpretability index and plot, that are described here.

It also contains several helper and visualization functions and wraps several functions from the factor_analyzer package.

For more details about the methods implemented and some of the package's features, see Pairwise Target Rotation for Factor Models. The package's source code can be found here.

The linked paper provides some documentation to the package and docstrings are available. However, a comprehensive guide or documentation is still under development.

Example

For instance, suppose that data contains the dataset and q contains the questions. Then, one can fit a 4-factor priorimax model using the snippet below.

import pandas as pd
from interpretablefa import InterpretableFA

# Load the dataset and the questions
data = pd.read_csv("./data/ECR_data_clean.csv")
with open("./data/ECR_questions.txt") as questions_file:
    q = questions_file.read().split("\n")
    questions_file.close()

# Initialize the analyzer
analyzer = InterpretableFA(data)

# Fit the 4-factor model with the priorimax rotation
analyzer.fit_factor_model("model", 4, "priorimax", q)

# Get the results
print(analyzer.calculate_indices("model")["v_index"])
print(analyzer.models["model"].rotation_matrix_)

# Visualize the results
analyzer.var_factor_corr_plot("model")
analyzer.interp_plot("model")

Requirements

  • Python 3.8 or higher
  • numpy
  • pandas
  • scikit-learn
  • factor_analyzer
  • tensorflow_hub
  • scipy
  • seaborn
  • matplotlib
  • statsmodels

License

GNU General Public License 3.0

Metadata

Release files for interpretablefa 6.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for interpretablefa 6.1.0
File Size Uploaded
interpretablefa-6.1.0.tar.gz 28.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for interpretablefa 6.1.0
File Interpreter ABI Platform
interpretablefa-6.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 56.4 kB

Release files / interpretablefa-6.1.0.tar.gz

Download URL interpretablefa-6.1.0.tar.gz
Size 28.4 kB
Tags Source
SHA-256 checksum
How to use checksums
40eeb5d130825c2772fc42f3330e88da18ea8939c50c0b69f32ff0fcf62b0411
BLAKE2b-256 checksum
How to use checksums
daccdbad92634f53865125af6f86a9b3687cdb3fbf2856c5cd8ef967c65949bd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.6

Release files / interpretablefa-6.1.0-py3-none-any.whl

Download URL interpretablefa-6.1.0-py3-none-any.whl
Size 28.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
64ec835a6fac088d0698069e43a97d1dc281344c1c6076689dbfc430fdc17800
BLAKE2b-256 checksum
How to use checksums
f2b0954d0ad909c55b7613dbee36c06e7035dcf5183791f37d61e955638f2ec6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.6

Release history Release notifications | RSS feed

This release

6.1.0 This release

2 release files

6.0.9

2 release files

6.0.7

2 release files

6.0.6

2 release files

6.0.5

2 release files

6.0.3

2 release files

6.0.2

2 release files

6.0.1

2 release files

6.0.0

2 release files

5.1.0

2 release files

5.0.0

2 release files

4.0.3

2 release files

4.0.2

2 release files

4.0.1

2 release files

4.0.0

2 release files

3.0.0

2 release files

2.0.0

2 release files

1.2.0

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.0

2 release files

0.3.1

2 release files

0.3.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page