Metadata-Version: 2.5
Name: tppis
Version: 0.1.0
Summary: Truncated Preconditioned Profiled Independence Screening for high-dimensional data with multicollinearity.
Project-URL: Homepage, https://github.com/Mohammed-Aswath/tppis
Project-URL: Documentation, https://github.com/Mohammed-Aswath/tppis
Project-URL: Source, https://github.com/Mohammed-Aswath/tppis
Project-URL: Issues, https://github.com/Mohammed-Aswath/tppis/issues
Author-email: Mohammed Aswath M <mohammed.aswath07@gmail.com>
Maintainer-email: Mohammed Aswath M <mohammed.aswath07@gmail.com>
License: MIT License
        
        Copyright (c) 2026 Mohammed Aswath M
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: LICENSE
Keywords: SIS,TPPIS,factor-analysis,feature-selection,high-dimensional,multicollinearity,variable-screening
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering :: Mathematics
Classifier: Typing :: Typed
Requires-Python: >=3.10
Requires-Dist: numpy>=1.24
Requires-Dist: scikit-learn>=1.6
Requires-Dist: scipy>=1.10
Provides-Extra: datasets
Requires-Dist: pandas>=2.0; extra == 'datasets'
Provides-Extra: dev
Requires-Dist: hypothesis>=6.82; extra == 'dev'
Requires-Dist: mypy>=1.8; extra == 'dev'
Requires-Dist: pandas>=2.0; extra == 'dev'
Requires-Dist: pre-commit>=3.6; extra == 'dev'
Requires-Dist: pytest-cov>=4.1; extra == 'dev'
Requires-Dist: pytest>=7.4; extra == 'dev'
Requires-Dist: ruff>=0.5; extra == 'dev'
Provides-Extra: docs
Requires-Dist: mkdocs-material>=9.5; extra == 'docs'
Requires-Dist: mkdocstrings[python]>=0.24; extra == 'docs'
Provides-Extra: repro
Requires-Dist: joblib>=1.3; extra == 'repro'
Requires-Dist: matplotlib>=3.7; extra == 'repro'
Requires-Dist: pandas>=2.0; extra == 'repro'
Description-Content-Type: text/markdown

# tppis

Open-source Python implementation of **Truncated Preconditioned Profiled Independence Screening** (TPPIS) from Tanaka and Matsui (2023), plus the baselines SIS, FPSIS (and FPSIS-BIC), and PPIS.

The method screens variables in high-dimensional regression when predictors are strongly multicollinear. A factor-analysis transform removes the common factors; TPPIS then *truncates* the tail of that transform so the unique-factor signal is not washed out.

**Maintainer:** [Mohammed Aswath M](https://github.com/Mohammed-Aswath) · [mohammed.aswath07@gmail.com](mailto:mohammed.aswath07@gmail.com) · issues: [github.com/Mohammed-Aswath/tppis](https://github.com/Mohammed-Aswath/tppis/issues)

## Install

```bash
pip install tppis
```

The package requires Python 3.10+, NumPy, SciPy, and **scikit-learn 1.6+**.

From a clone of this repository:

```bash
python -m venv .venv
source .venv/bin/activate   # Windows: .venv\Scripts\activate
pip install -e ".[dev]"
```

Requires Python 3.10+, NumPy, SciPy, and scikit-learn 1.6+.

## Quickstart

```python
from tppis import TPPIS, make_example1

data = make_example1(n=100, p=80, phi=0.7, seed=0)
est = TPPIS().fit(data.X, data.y)

est.get_support(indices=True)   # selected columns, ranking order
est.d_, est.alpha_, est.k_      # BIC-chosen parameters
est.bic_
est.grid_                       # every (d, alpha, k, bic) evaluated
```

Fixed parameters, no search:

```python
TPPIS(d=20, alpha=0.4, k=10).fit(data.X, data.y)
```

Inside a scikit-learn pipeline:

```python
from sklearn.linear_model import LinearRegression
from sklearn.pipeline import Pipeline
from tppis import TPPIS

pipe = Pipeline([
    ("select", TPPIS(d=8, alpha=0.6, k=10)),
    ("lm", LinearRegression()),
])
pipe.fit(data.X, data.y)
```

The functional entry point `screen(X, y, method="tppis")` returns the same fitted estimator.

## When to use which method

| Method | Transform | How `d` is chosen |
| --- | --- | --- |
| SIS | none (`X.T @ y`) | — |
| FPSIS | project out leading `d` factors | singular-value ratio (3) |
| FPSIS-BIC | same | BIC grid |
| PPIS | Puffer whitening of the tail | singular-value ratio (3) |
| TPPIS | PPIS with the tail truncated at `[n α]` | joint BIC over `d`, `α`, `k` |

TPPIS at `alpha=1` is exactly PPIS. That identity is tested.

## Citation

If you use the method, cite the paper. If you use this software, cite the package as well.

```
Tanaka, S. and Matsui, H. (2023). Variable screening using factor analysis
for high-dimensional data with multicollinearity. arXiv:2306.05702.
```

See [`CITATION.cff`](CITATION.cff).

## License

MIT. See [`LICENSE`](LICENSE).
