- Python
- Streamlit
- Pandas
- NumPy
- Scikit-learn
Click the thumbnail to watch the complete demonstration.
ContextLens is a context-aware machine-learning explorer for tabular CSV data.
It profiles a dataset, explains its modelling context, flags common data risks,
trains reproducible baseline pipelines, compares appropriate metrics, and exports
a Markdown analysis report.
Built as a portfolio project connecting context-aware computing, data analysis, explainable modelling, and practical Python application development.
- Upload any tabular CSV or open the included sample dataset.
- Select a target and auto-detect classification versus regression.
- Identify missingness, duplicates, constant columns, possible identifiers, high-cardinality categories, class imbalance, small samples, and high-dimensional settings.
- Compare leakage-safe scikit-learn pipelines.
- Use macro-F1 for classification and RMSE for regression.
- Inspect confusion matrices, per-class reports, and global feature importance.
- Export a portable Markdown report.
ContextLens does not claim that a heuristic is artificial intelligence. Its
context engine uses explicit rules that can be inspected in
contextlens/analysis.py. It adapts evaluation guidance and modelling warnings
to properties of the selected dataset and target.
CSV
│
├── Dataset profiler ──> transparent context rules ──> recommendations
│
└── Feature/target split
└── train-test split
└── preprocessing inside Pipeline
├── numeric: median imputation + scaling
└── categorical: mode imputation + one-hot encoding
└── baseline model comparison
└── diagnostics + Markdown report
Preprocessing is fitted only on the training partition through scikit-learn
Pipeline and ColumnTransformer, reducing leakage from imputation, scaling,
and categorical encoding.
git clone https://github.com/anam152/contextlens.git
cd contextlens
python -m venv .venvActivate the environment:
# Windows PowerShell
.venv\Scripts\Activate.ps1
# macOS/Linux
source .venv/bin/activateInstall and run:
pip install -r requirements.txt
streamlit run app.pyThen open the local URL shown by Streamlit.
python -m pytest- Push the repository to GitHub.
- In Streamlit Community Cloud, create a new app.
- Select the repository and branch.
- Set the entry point to
app.py. - Deploy.
streamlit · machine-learning · context-aware-computing · data-science
· scikit-learn · explainable-ai · python
This is an exploratory baseline application, not a full AutoML platform. Current limitations include:
- one hold-out train/test split rather than repeated cross-validation;
- no time-series-aware splitting;
- global importance rather than local SHAP explanations;
- limited baseline model families;
- no causal, fairness, or domain-validity guarantees.
- Repeated and nested cross-validation
- User-defined group and time-aware splits
- Genetic-algorithm feature selection
- SHAP explanations
- Saved experiment histories
- Domain-context template for healthcare datasets (Pima Indians Diabetes dtatset sample added)
- Domain-context template for IoT datasets
- Downloadable PDF report
Model scores are not proof of real-world validity. High-stakes applications require domain review, representative data, robust validation, fairness and privacy assessment, and appropriate governance.
MIT




