{ "info": { "author": "Jeremy Biggs", "author_email": "jbiggs@ets.org", "bugtrack_url": null, "classifiers": [ "Intended Audience :: Developers", "Intended Audience :: Science/Research", "Operating System :: MacOS", "Operating System :: Microsoft :: Windows", "Operating System :: POSIX", "Operating System :: Unix", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Topic :: Scientific/Engineering" ], "description": "FactorAnalyzer\n--------------\n\n.. image:: https://circleci.com/gh/EducationalTestingService/factor_analyzer/tree/master.svg?style=shield\n :alt: Build status\n :target: https://circleci.com/gh/EducationalTestingService/factor_analyzer\n\n.. image:: https://coveralls.io/repos/github/EducationalTestingService/factor_analyzer/badge.svg?branch=master\n :target: https://coveralls.io/github/EducationalTestingService/factor_analyzer?branch=master\n\n.. image:: https://anaconda.org/desilinguist/factor_analyzer/badges/installer/conda.svg\n :target: https://anaconda.org/desilinguist/factor_analyzer/\n\n\nThis is a Python module to perform exploratory and factor analysis (EFA), with several \noptional rotations. It also includes a class to perform confirmatory factor\nanalysis (CFA), with certain pre-defined constraints. In expoloratory factor analysis,\nfactor extraction can be performed using a variety of estimation techniques. The\n``factor_analyzer`` package allows users to perfrom EFA using either (1) a minimum\nresidual (MINRES) solution, (2) a maximum likelihood (ML) solution, or (3) a principal\nfactor solution. However, CFA can only be performe using an ML solution.\n\nBoth the EFA and CFA classes within this package are fully compatible with `scikit-learn`.\nPortions of this code are ported from the excellent R library `psych`, and the `sem`\npackage provided inspiration for the CFA class.\n\nPlease see the `official documentation `__ for additional details.\n\n\nDescription\n-----------\n\nExploratory factor analysis (EFA) is a statistical technique used to\nidentify latent relationships among sets of observed variables in a\ndataset. In particular, EFA seeks to model a large set of observed\nvariables as linear combinations of some smaller set of unobserved,\nlatent factors. The matrix of weights, or factor loadings, generated\nfrom an EFA model describes the underlying relationships between each\nvariable and the latent factors.\n\nConfirmatory factor analysis (CFA), a closely associated technique, is\nused to test an a priori hypothesis about latent relationships among sets\nof observed variables. In CFA, the researcher specifies the expected pattern\nof factor loadings (and possibly other constraints), and fits a model according\nto this specification.\n\nTypically, a number of factors (K) in an EFA or CFA model is selected\nsuch that it is substantially smaller than the number of variables. The\nfactor analysis model can be estimated using a variety of standard\nestimation methods, including but not limited MINRES or ML.\n\nFactor loadings are similar to standardized regression coefficients, and\nvariables with higher loadings on a particular factor can be interpreted\nas explaining a larger proportion of the variation in that factor. In the\ncase of EFA, factor loading matrices are usually rotated after the factor\nanalysis model is estimated in order to produce a simpler, more interpretable\nstructure to identify which variables are loading on a particular factor.\n\nTwo common types of rotations are:\n\n1. The **varimax** rotation, which rotates the factor loading matrix so\n as to maximize the sum of the variance of squared loadings, while\n preserving the orthogonality of the loading matrix.\n\n2. The **promax** rotation, a method for oblique rotation, which builds\n upon the varimax rotation, but ultimately allows factors to become\n correlated.\n\nThis package includes a ``factor_analyzer`` module with a stand-alone\n``FactorAnalyzer`` class. The class includes ``fit()`` and ``transform()`` \nmethods that enable users to perform factor analysis and score new data\nusing the fitted factor model. Users can also perform optional otations\non a factor loading matrix using the ``Rotator`` class.\n\nThe following rotation options are available in both ``FactorAnalyzer`` \nand ``Rotator``:\n\n (a) varimax (orthogonal rotation)\n (b) promax (oblique rotation)\n (c) oblimin (oblique rotation)\n (d) oblimax (orthogonal rotation)\n (e) quartimin (oblique rotation)\n (f) quartimax (orthogonal rotation)\n (g) equamax (orthogonal rotation)\n\nIn adddition, the package includes a ``confirmatory_factor_analyzer``\nmodule with a stand-alone ``ConfirmatoryFactorAnalyzer`` class. The\nclass includes ``fit()`` and ``transform()`` that enable users to perform\nconfirmatory factor analysis and score new data using the fitted model.\nPerforming CFA requires users to specify in advance a model specification\nwith the expected factor loading relationships. This can be done using\nthe ``ModelSpecificationParser`` class.\n\nExamples\n--------\n\nExploratory factor analysis example.\n\n.. code:: python\n\n In [1]: import pandas as pd \n ...: from factor_analyzer import FactorAnalyzer \n\n In [2]: df_features = pd.read_csv('tests/data/test02.csv') \n\n In [3]: fa = FactorAnalyzer(rotation=None) \n\n In [4]: fa.fit(df_features) \n Out[4]: \n FactorAnalyzer(bounds=(0.005, 1), impute='median', is_corr_matrix=False,\n method='minres', n_factors=3, rotation=None, rotation_kwargs={},\n use_smc=True)\n\n In [5]: fa.loadings_ \n Out[5]: \n array([[-0.12991218, 0.16398151, 0.73823491],\n [ 0.03899558, 0.04658425, 0.01150343],\n [ 0.34874135, 0.61452341, -0.07255666],\n [ 0.45318006, 0.7192668 , -0.0754647 ],\n [ 0.36688794, 0.44377343, -0.01737066],\n [ 0.74141382, -0.15008235, 0.29977513],\n [ 0.741675 , -0.16123009, -0.20744497],\n [ 0.82910167, -0.20519428, 0.04930817],\n [ 0.76041819, -0.23768727, -0.12068582],\n [ 0.81533404, -0.12494695, 0.17639684]])\n\n In [6]: fa.get_communalities() \n Out[6]: \n array([0.5887579 , 0.00382308, 0.50452402, 0.72841182, 0.33184336,\n 0.66208429, 0.61911037, 0.73194557, 0.64929612, 0.71149718])\n\nConfirmatory factor analysis example.\n\n.. code:: python\n\n In [1]: import pandas as pd \n\n In [2]: from factor_analyzer import (ConfirmatoryFactorAnalyzer, \n ...: ModelSpecificationParser) \n\n In [3]: df_features = pd.read_csv('tests/data/test11.csv') \n\n In [4]: model_dict = {\"F1\": [\"V1\", \"V2\", \"V3\", \"V4\"], \n ...: \"F2\": [\"V5\", \"V6\", \"V7\", \"V8\"]} \n In [5]: model_spec = ModelSpecificationParser.parse_model_specification_from_dict(df_features,\n ...: model_dict)\n\n In [6]: cfa = ConfirmatoryFactorAnalyzer(model_spec, disp=False) \n\n In [7]: cfa.fit(df_features.values) \n\n In [8]: cfa.loadings_ \n Out[8]: \n array([[0.99131285, 0. ],\n [0.46074919, 0. ],\n [0.3502267 , 0. ],\n [0.58331488, 0. ],\n [0. , 0.98621042],\n [0. , 0.73389239],\n [0. , 0.37602988],\n [0. , 0.50049507]])\n\n In [9]: cfa.factor_varcovs_ \n Out[9]: \n array([[1. , 0.17385704],\n [0.17385704, 1. ]])\n\n In [10]: cfa.transform(df_features.values) \n Out[10]: \n array([[-0.46852166, -1.08708035],\n [ 2.59025301, 1.20227783],\n [-0.47215977, 2.65697245],\n ...,\n [-1.5930886 , -0.91804114],\n [ 0.19430887, 0.88174818],\n [-0.27863554, -0.7695101 ]])\n\nRequirements\n------------\n\n- Python 3.4 or higher\n- ``numpy``\n- ``pandas``\n- ``scipy``\n- ``scikit-learn``\n\nContributing\n------------\n\nContributions to ``factor_analyzer`` are very welcome. Please file an issue\non GitHub, or contact jbiggs@ets.org if you would like to contribute.\n\nInstallation\n------------\n\nYou can install this package via ``pip`` with:\n\n``$ pip install factor_analyzer``\n\nAlternatively, you can install via ``conda`` with:\n\n``$ conda install -c ets factor_analyzer``\n\nLicense\n-------\n\nGNU General Public License (>= 2)\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/EducationalTestingService/factor_analyzer", "keywords": "factor analysis", "license": "", "maintainer": "", "maintainer_email": "", "name": "factor-analyzer", "package_url": "https://pypi.org/project/factor-analyzer/", "platform": "", "project_url": "https://pypi.org/project/factor-analyzer/", "project_urls": { "Homepage": "https://github.com/EducationalTestingService/factor_analyzer" }, "release_url": "https://pypi.org/project/factor-analyzer/0.3.1/", "requires_dist": [ "pandas", "scipy", "numpy", "scikit-learn" ], "requires_python": "", "summary": "A Factor Analysis class", "version": "0.3.1" }, "last_serial": 5115199, "releases": { "0.2.1": [ { "comment_text": "adding files for 0.2.1", "digests": { "md5": "bf1adf2996d7e7f0b9f4be4f11b97085", "sha256": "4e6a790830a081f22acb6c5b10baf11f328b662fdd53d6036192919d34594e6a" }, "downloads": -1, "filename": "factor_analyzer-0.2.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "bf1adf2996d7e7f0b9f4be4f11b97085", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 15592, "upload_time": "2017-12-07T21:25:36", "url": "https://files.pythonhosted.org/packages/97/a2/41be95025cc1cba46c36727bb45ef7e8f41053aa4ef5439ba5a974698697/factor_analyzer-0.2.1-py2.py3-none-any.whl" }, { "comment_text": "adding files for 0.2.1", "digests": { "md5": "64963e50ef3201ca70049506c5aedd39", "sha256": "94ea4c7d46e846cc7174787adce47156cf58dc257905c878edc5181b4fa300ed" }, "downloads": -1, "filename": "factor_analyzer-0.2.1.tar.gz", "has_sig": false, "md5_digest": "64963e50ef3201ca70049506c5aedd39", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19780, "upload_time": "2017-12-07T21:25:38", "url": "https://files.pythonhosted.org/packages/b3/a2/34ccef2a56f9d34c36c43ecb251979a059364dc9578ce6c8a7b702701db5/factor_analyzer-0.2.1.tar.gz" } ], "0.2.2": [ { "comment_text": "", "digests": { "md5": "1445aa7d1f937525d537d174e08f4ce5", "sha256": "a507748e3b928458f197fc9463918dbea5b8460d3d56569a1c9052f3a6ad3fb9" }, "downloads": -1, "filename": "factor_analyzer-0.2.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "1445aa7d1f937525d537d174e08f4ce5", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 15804, "upload_time": "2017-12-14T12:47:10", "url": "https://files.pythonhosted.org/packages/26/52/784e842f3d77be2a0839a7ffcf8bcafb6ee02010df68cd5c07579d2b9fb5/factor_analyzer-0.2.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "abd4c4c3dcbf2fdc556f6711f6762568", "sha256": "0b01efb746da59ff13961aa261427bd4724f0ec65b63931a5bbbba101b2db033" }, "downloads": -1, "filename": "factor_analyzer-0.2.2.tar.gz", "has_sig": false, "md5_digest": "abd4c4c3dcbf2fdc556f6711f6762568", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19948, "upload_time": "2017-12-14T12:47:12", "url": "https://files.pythonhosted.org/packages/91/e7/a321a3e287fda151761d3e32cad3aaffb6d08eae56542f284a490dc39b1f/factor_analyzer-0.2.2.tar.gz" } ], "0.2.3": [ { "comment_text": "", "digests": { "md5": "6c0a3e49589fe46b3392c317bac0714d", "sha256": "1eb98e39cdad9d3cc3512228f1456f4df383e9e5ad0153d1ea28504c5f340359" }, "downloads": -1, "filename": "factor_analyzer-0.2.3-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "6c0a3e49589fe46b3392c317bac0714d", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 23324, "upload_time": "2018-06-07T14:17:53", "url": "https://files.pythonhosted.org/packages/79/1b/84808bbeee0f3a8753c3d8034baf0aa0013cf08957eff750f366ce83f04a/factor_analyzer-0.2.3-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "cd06baeb5086fcdcad10505b178cced7", "sha256": "391a52f26cfb3089815bb0d5eff6eea30b2295d2895b83a27f3a734e592c81c0" }, "downloads": -1, "filename": "factor_analyzer-0.2.3.tar.gz", "has_sig": false, "md5_digest": "cd06baeb5086fcdcad10505b178cced7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 26077, "upload_time": "2018-06-07T14:17:54", "url": "https://files.pythonhosted.org/packages/a6/be/7b7da46156d31976766ccaed69fc33f3cd5ae58de557d081269064d400de/factor_analyzer-0.2.3.tar.gz" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "e5af3793968475c9d61665a17decaea7", "sha256": "b0f60081f3c53f706311dd264d2874d00581a3b87599df93ce9d9c2dd37fe953" }, "downloads": -1, "filename": "factor_analyzer-0.3.0-py3-none-any.whl", "has_sig": false, "md5_digest": "e5af3793968475c9d61665a17decaea7", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 41268, "upload_time": "2019-04-03T20:19:30", "url": "https://files.pythonhosted.org/packages/08/73/af99b617fa1c48166007097b0e28d3142f9e2b3a506820b23677dfede427/factor_analyzer-0.3.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "a05370a12569083e08dff1f3a80d8775", "sha256": "6284f014c2f68e71465602e9930a76c40464c5c2d9f882611cabd418e1ecc602" }, "downloads": -1, "filename": "factor_analyzer-0.3.0.tar.gz", "has_sig": false, "md5_digest": "a05370a12569083e08dff1f3a80d8775", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 40361, "upload_time": "2019-04-03T20:19:31", "url": "https://files.pythonhosted.org/packages/af/ce/ec76a271f0ea721c12d2f1ffc1600c952e04fcce4196b1234f28ae65db9f/factor_analyzer-0.3.0.tar.gz" } ], "0.3.1": [ { "comment_text": "", "digests": { "md5": "3aae22b2890f6a28c87e34cb282e2139", "sha256": "cab18b2e7846b504687c27751eec4d7cee6a4f5550e49929414410421e8c2dcf" }, "downloads": -1, "filename": "factor_analyzer-0.3.1-py3-none-any.whl", "has_sig": false, "md5_digest": "3aae22b2890f6a28c87e34cb282e2139", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 41289, "upload_time": "2019-04-08T19:31:56", "url": "https://files.pythonhosted.org/packages/dc/a1/df0babd5c16f59c7de85655cc0be9f8efc042a5d6a32508344078e1d8c4f/factor_analyzer-0.3.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "9b5356c229f0f00af1d1843d198c00c2", "sha256": "09614dca96e6134505fa15a9b35a479a95c7e5473049a52a8ca1dd7ea2d5abf9" }, "downloads": -1, "filename": "factor_analyzer-0.3.1.tar.gz", "has_sig": false, "md5_digest": "9b5356c229f0f00af1d1843d198c00c2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 39549, "upload_time": "2019-04-08T19:31:58", "url": "https://files.pythonhosted.org/packages/c6/5a/6058a8ed81de2d9ecaac8a9e09369676dafb23b0f2c3b0bca7ff035cbf89/factor_analyzer-0.3.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "3aae22b2890f6a28c87e34cb282e2139", "sha256": "cab18b2e7846b504687c27751eec4d7cee6a4f5550e49929414410421e8c2dcf" }, "downloads": -1, "filename": "factor_analyzer-0.3.1-py3-none-any.whl", "has_sig": false, "md5_digest": "3aae22b2890f6a28c87e34cb282e2139", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 41289, "upload_time": "2019-04-08T19:31:56", "url": "https://files.pythonhosted.org/packages/dc/a1/df0babd5c16f59c7de85655cc0be9f8efc042a5d6a32508344078e1d8c4f/factor_analyzer-0.3.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "9b5356c229f0f00af1d1843d198c00c2", "sha256": "09614dca96e6134505fa15a9b35a479a95c7e5473049a52a8ca1dd7ea2d5abf9" }, "downloads": -1, "filename": "factor_analyzer-0.3.1.tar.gz", "has_sig": false, "md5_digest": "9b5356c229f0f00af1d1843d198c00c2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 39549, "upload_time": "2019-04-08T19:31:58", "url": "https://files.pythonhosted.org/packages/c6/5a/6058a8ed81de2d9ecaac8a9e09369676dafb23b0f2c3b0bca7ff035cbf89/factor_analyzer-0.3.1.tar.gz" } ] }