Metadata-Version: 2.4
Name: student_signal
Version: 0.1.0
Summary: Domain library for student dropout prediction: data preparation, ranking, and evaluation
Project-URL: Repository, https://github.com/cedanl/student-signal
Project-URL: Issues, https://github.com/cedanl/student-signal/issues
Project-URL: Changelog, https://github.com/cedanl/student-signal/releases
Author: CEDA
License: 
        The MIT License (MIT)
        Copyright (c) 2024, Mondriaan
        
        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: dropout,education,intervention,machine-learning,prediction,student
Classifier: Development Status :: 4 - Beta
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Education
Classifier: Topic :: Scientific/Engineering :: Information Analysis
Requires-Python: >=3.13
Requires-Dist: joblib>=1.4.2
Requires-Dist: matplotlib>=3.8.0
Requires-Dist: numpy>=2.2.2
Requires-Dist: pandas>=2.2.3
Requires-Dist: pyyaml>=6.0.2
Requires-Dist: scikit-learn>=1.6.1
Description-Content-Type: text/markdown

# student-signal

Domain library for student dropout prediction. Prepares student data, trains sklearn-compatible models, and ranks students by predicted dropout probability using the invitation rule methodology (Eegdeman, 2022).

## Installation

Requires Python 3.13+ and [uv](https://docs.astral.sh/uv/getting-started/installation/).

```bash
git clone https://github.com/cedanl/student-signal.git
cd student-signal
uv sync
```

## Usage

The library exposes three entry points: `prepare()`, `rank()`, and `evaluate()`.

```python
import pandas as pd
from student_signal.pipeline import prepare, rank, evaluate

train_df = pd.read_csv("data/01-raw/demo/synth_data_train.csv", sep="\t")
pred_df  = pd.read_csv("data/01-raw/demo/synth_data_pred.csv",  sep="\t")

# 1. Clean and transform
prepared = prepare(train_df, pred_df, target_col="Dropout", id_col="Studentnummer")

# 2. Train your model (any sklearn-compatible estimator)
from sklearn.ensemble import RandomForestRegressor
model = RandomForestRegressor(random_state=42)
model.fit(prepared.X_train, prepared.y_train)

# 3. Rank students by dropout risk
ranking = rank(model, prepared)

# 4. Evaluate with stoplight methodology
results = evaluate({"Random Forest": (model, False)}, prepared, invite_pct=20)
```

`rank()` returns a DataFrame with columns `ranking`, `Studentnummer`, and `voorspelling`, sorted highest risk first.

`evaluate()` returns precision/recall metrics at multiple invitation thresholds with a traffic light status (Betrouwbaar / Gebruik met voorzichtigheid / Niet bruikbaar).

## Development

Open in devcontainer or run locally:

```bash
uv sync
uv run pytest          # run tests
uv run ruff check src  # lint
```

## License

MIT
