Skip to main content

PLS-SEM compute engine, a maintained fork of plspm-python with advanced analyses (PLSc, IPMA, PLSpredict, moderation, FIMIX-PLS, Gaussian-copula endogeneity) and extended metrics (SRMR, d_ULS, HTMT, HTMT2, Q², MGA) powering OpenPLS.

Project description

OpenPLS Engine

CI PyPI version Python versions License: GPL-3.0-or-later DOI Validation DOI

The compute engine behind OpenPLS, a Python 3 library for Partial Least Squares Structural Equation Modeling (PLS-SEM).

openpls-engine is a fork of plspm-python by Jez Humble (Google). It keeps the original algorithm intact and adds the metrics and quality criteria that modern PLS-SEM reporting requires: HTMT (and HTMT2 geometric-mean variant), SRMR, d_ULS, adjusted R², BIC, Stone-Geisser Q², Cronbach α, Dijkstra-Henseler ρ, VIF (per-indicator and per-predictor), CTA-PLS (confirmatory tetrad analysis for reflective measurement), multi-group analysis, and a progress-streaming long bootstrap. It also ships advanced analyses that go beyond what plspm-python covers: PLSc (consistent PLS, Dijkstra & Henseler 2015) for measurement-error attenuation correction in reflective models, PLSpredict out-of-sample validation, IPMA (Importance-Performance Map Analysis), two-stage moderation, FIMIX-PLS finite-mixture segmentation, the Gaussian-copula endogeneity test (Park & Gupta 2012; Hult et al. 2018), and a quasi-Newton (BFGS) inner-weighting scheme and a Lohmöller PCA scheme, two new alternatives to the classical centroid, factorial, and path schemes (five inner-weighting schemes total).

The engine also powers OpenPLS (the hosted web application) and the CLI / Docker self-host distribution planned for the next phase of the roadmap.

Status: stable as of 1.0.0. Public API (Plspm, Config, Mode, Scheme, IPMA, PLSpredict, Moderation, FIMIX) follows semver. Numerical alignment with reference implementations is tracked in TODO.md. See CHANGELOG.md for the version history.

Documentation

Hosted docs at openpls.app/engine:

  • Introduction - what the library does and who it is for.
  • Installation - pip and source installs.
  • Quickstart - end-to-end fit on the satisfaction dataset.
  • Core concepts - PLS-SEM, Mode A/B, inner-weighting schemes, missing-value strategies.
  • API reference - the full public surface (Plspm, Config, VIF, CTAPLS, PLSc, GaussianCopula, IPMA, PLSpredict, Moderation, FIMIX, MGA, LongBootstrap).
  • Examples - runnable snippets for each advanced analysis.
  • Changelog - version history with per-feature notes.

Why fork

  • Upstream has not seen a release since 2020.
  • OpenPLS adds substantial extensions: SRMR, d_ULS, HTMT, Q², adjusted R², BIC, multi-group analysis (MGA), permutation tests, mean replacement, and a long-running bootstrap with BCa confidence intervals.
  • The OpenPLS hosted product depends on a single source of truth for the algorithm; a maintained, versioned package makes that practical.

Installation

openpls-engine is published on PyPI:

pip install openpls-engine

Or pin a specific version for reproducible analyses:

pip install openpls-engine==1.2.0

To work from source instead:

git clone https://github.com/jojacobsen/openpls-engine.git
cd openpls-engine
python3 -m pip install -e .

Development

python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements-dev.txt
pip install -e .

pytest          # run the test suite
ruff check .    # lint

CI runs lint and tests on Python 3.10 through 3.13 against every push and pull request against main.

Versioning

openpls-engine follows Semantic Versioning. The public API is stable as of 1.0.0. Tagged releases (vX.Y.Z) trigger a GitHub Actions workflow that builds the package and publishes it to PyPI via OIDC trusted publishing. The version is the single source of truth in pyproject.toml and is exposed at runtime as openpls.__version__.

See CHANGELOG.md for the per-version history. 1.0.0 renamed the import namespace from plspm to openpls; consumers upgrading from 0.7.x must rewrite their imports (see CHANGELOG → Breaking).

Usage

import pandas as pd
from openpls import Plspm
import openpls.config as c
from openpls.scheme import Scheme
from openpls.mode import Mode

satisfaction = pd.read_csv("tests/data/satisfaction.csv", index_col=0)

structure = c.Structure()
structure.add_path(["IMAG"], ["EXPE", "SAT", "LOY"])
structure.add_path(["EXPE"], ["QUAL", "VAL", "SAT"])
structure.add_path(["QUAL"], ["VAL", "SAT"])
structure.add_path(["VAL"], ["SAT"])
structure.add_path(["SAT"], ["LOY"])

config = c.Config(structure.path(), scaled=False)
for lv in ["IMAG", "EXPE", "QUAL", "VAL", "SAT", "LOY"]:
    config.add_lv_with_columns_named(lv, Mode.A, satisfaction, lv.lower())

result = Plspm(satisfaction, config, Scheme.CENTROID)
print(result.inner_summary())
print(result.path_coefficients())

License

GNU General Public License v3.0, see LICENSE. Inherited from upstream plspm-python (also GPL-3.0).

Attribution

This project is a fork of googlecloudplatform/plspm-python by Jez Humble. The upstream R package plspm by Gaston Sanchez and the seminr package by Soumya Ray and Nicholas Danks remain the conceptual references for the algorithm. See ATTRIBUTION.md for details.

OpenPLS is an independent project and not affiliated with Google.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

openpls_engine-1.2.0.tar.gz (99.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

openpls_engine-1.2.0-py3-none-any.whl (91.3 kB view details)

Uploaded Python 3

File details

Details for the file openpls_engine-1.2.0.tar.gz.

File metadata

  • Download URL: openpls_engine-1.2.0.tar.gz
  • Upload date:
  • Size: 99.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for openpls_engine-1.2.0.tar.gz
Algorithm Hash digest
SHA256 d22646da02e3947dc2177fa7870d3cf18b37c5b27735530be18c92d28dc03419
MD5 516e586cff9a092b95af5d9d5a8cf4e5
BLAKE2b-256 ff18b39ef20e488988c95c9364c698e10c558c6e51357fe568d5eb1ea66573c6

See more details on using hashes here.

Provenance

The following attestation bundles were made for openpls_engine-1.2.0.tar.gz:

Publisher: release.yml on jojacobsen/openpls-engine

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file openpls_engine-1.2.0-py3-none-any.whl.

File metadata

  • Download URL: openpls_engine-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 91.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for openpls_engine-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8f7052e68f8c6e9a9b963a4a4fa331fada2b08d27d4573983b4e23ae2d25ad37
MD5 b3cfd1dff5bd3108ed4ec33116259e8a
BLAKE2b-256 be781d3616186abfcaaeeebf02272b1d41f29aed6dea649306a739fc6c368dc5

See more details on using hashes here.

Provenance

The following attestation bundles were made for openpls_engine-1.2.0-py3-none-any.whl:

Publisher: release.yml on jojacobsen/openpls-engine

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page