Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions .github/actions/setup-python-env/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: "Setup Python Env"
description: "Install project dependencies"
runs:
using: "composite"
steps:
- uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: Show where we are
shell: bash
run: |
echo "action path: $GITHUB_ACTION_PATH"
echo "workspace: $GITHUB_WORKSPACE"
pwd
ls -la

- name: Install dependencies
shell: bash
working-directory: ${{ github.workspace }} # <- repo root for pip
run: |
echo "CWD:" && pwd
test -f pyproject.toml && echo "Found pyproject.toml" || (echo "pyproject.toml MISSING" && exit 1)
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -r requirements_dev.txt
pip install -e .
13 changes: 13 additions & 0 deletions .github/workflows/mypy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: mypy

on:
- push
- pull_request

jobs:
typecheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-python-env
- run: mypy . --python-executable "$(command -v python)"
12 changes: 12 additions & 0 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: pytest

on:
[push, pull_request]

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-python-env
- run: pytest tests/
13 changes: 13 additions & 0 deletions .github/workflows/ruff.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: ruff

on:
[push, pull_request]

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-python-env
- run: ruff check src/*
- run: ruff check tests/*
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -93,3 +93,4 @@ dmypy.json
# Editors
.vscode/
.idea/
.ruff_cache/
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
[![PyPI version](https://badge.fury.io/py/RegularizedDiscriminantAnalysis.svg)](https://badge.fury.io/py/RegularizedDiscriminantAnalysis)
[![Python 3.8+](https://img.shields.io/badge/python-3.8+-blue.svg)](https://www.python.org/downloads/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![mypy](https://github.com/F3z11/RegularizedDiscriminantAnalysis/actions/workflows/mypy.yml/badge.svg)](https://github.com/F3z11/RegularizedDiscriminantAnalysis/actions/workflows/mypy.yml)
[![ruff](https://github.com/F3z11/RegularizedDiscriminantAnalysis/actions/workflows/mypy.yml/badge.svg)](https://github.com/F3z11/RegularizedDiscriminantAnalysis/actions/workflows/ruff.yml)
[![pytest](https://github.com/F3z11/RegularizedDiscriminantAnalysis/actions/workflows/mypy.yml/badge.svg)](https://github.com/F3z11/RegularizedDiscriminantAnalysis/actions/workflows/pytest.yml)


A scikit-learn compatible implementation of Regularized Discriminant Analysis (RDA) as proposed by Friedman (1989).

Expand Down
Binary file modified examples/rda_comparison.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
541 changes: 268 additions & 273 deletions examples/rda_example.ipynb

Large diffs are not rendered by default.

26 changes: 26 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,29 @@ dependencies = [
[project.urls]
"Homepage" = "https://github.com/F3z11/RDA_implementation"
"Bug Tracker" = "https://github.com/F3z11/RDA_implementation/issues"

[tool.ruff]
line-length = 100
target-version = "py38"
lint.extend-select = ["E", "F", "I", "UP", "B"]
lint.ignore = ["E501"]
lint.fixable = ["ALL"]

[tool.ruff.format]
quote-style = "double"

[tool.ruff.lint.isort]
known-first-party = ["regularizeddiscriminantanalysis"]

[tool.mypy]
mypy_path = "src"
strict = true
ignore_missing_imports = true
disallow_untyped_defs = true
disallow_any_unimported = true
no_implicit_optional = true
warn_unused_ignores = true
warn_return_any = true
warn_redundant_casts = true
warn_unused_configs = true
check_untyped_defs = true
26 changes: 26 additions & 0 deletions requirements_dev.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
pytest==9.0.1
ruff==0.14.7
mypy==1.19.0
mypy-extensions==1.1.0
scikit-learn-stubs==0.0.3
dataclasses==0.6

# install these to run the examples
contourpy==1.3.3
cycler==0.12.1
fonttools==4.61.0
kiwisolver==1.4.9
matplotlib==3.10.7
pillow==12.0.0
pyparsing==3.2.5
alembic==1.17.2
colorlog==6.10.1
mako==1.3.10
markupsafe==3.0.3
optuna==4.6.0
pyyaml==6.0.3
sqlalchemy==2.0.44
tqdm==4.67.1
pandas==2.3.3
pytz==2025.2
tzdata==2025.2
Loading