Drop in any dataframe and get models worth trying plus the right charts.
Project description
firstlook
Drop in any dataframe and get models worth trying plus the right charts. The first look you take at any dataset, done for you.
import firstlook
firstlook.at(df, target="species")
One call and you get three things back:
- The problem type: regression, classification, or clustering, inferred from the data.
- Models to try: ranked, with a one-line reason each, plus data-aware warnings (class imbalance, categoricals that need encoding, missing values, too few rows).
- The right charts: a dark, interactive Plotly dashboard that picks the chart per column: bar/histogram for the target, a scatter colored by class (or feature-vs-target for regression), a correlation heatmap, and a closer look.
It works in Jupyter (rich card + interactive charts render inline) and in plain scripts (prints the recommendation; report.to_html("out.html") for the visuals).
See it on real data: examples/ runs the full understand → visualize → model arc on three datasets — breast cancer, diabetes, and a messy churn set — with the dashboards rendered.
Why
Every project starts the same way: load the data, squint at it, remember which chart goes with which column, half-remember the sklearn cheat-sheet. firstlook does that opening move for you so you can get to the actual modeling without writing a wall of matplotlib.
Install
pip install firstlook
From source, for development:
git clone https://github.com/siddhant-rajhans/firstlook
cd firstlook
pip install -e ".[dev]"
Use
import firstlook
from sklearn.datasets import load_iris
iris = load_iris(as_frame=True).frame
report = firstlook.at(iris, target="target")
report.task # "classification"
report.start # "LogisticRegression"
report.models # [("LogisticRegression", "..."), ...]
report.notes # ["3 classes", ...]
report.figure # the Plotly figure (restyle or export it)
report.to_html("iris.html")
Need just one piece?
firstlook.detect_task(df, target="price") # "regression"
firstlook.recommend(df, target="price") # a Recommendation (task, start, models, notes)
firstlook.visualize(df, target="price") # a Plotly figure
The dark theme is also a registered Plotly template you can use on your own figures:
fig.update_layout(template="firstlook")
(firstlook.at and firstlook.play are the same call.)
Get a baseline score, too
Pass fit=True and firstlook trains the recommended model and cross-validates it, so the recommendation comes with a real score attached. Preprocessing (impute, scale, one-hot) is built in, so it fits straight on messy data:
report = firstlook.at(df, target="price", fit=True)
report.baseline # Baseline(model="LinearRegression", metric="R2", score=0.97, ...)
Needs scikit-learn: pip install "firstlook[fit]".
What it handles today
Tabular regression, classification, and clustering. Image / text / time-series problems are out of scope for now.
Roadmap
- More chart types (pair plots, missingness maps, target-vs-time).
- A light/lab theme alongside the dark one.
- Image / text / time-series support beyond tabular.
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file firstlook-0.1.0.tar.gz.
File metadata
- Download URL: firstlook-0.1.0.tar.gz
- Upload date:
- Size: 15.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
55816bc042eca341cddfc0e4ef75995a97abaf6736c908b83cef285e3a4f910c
|
|
| MD5 |
779e369dac56322b14cc5d32498114d1
|
|
| BLAKE2b-256 |
35d02749fbceacd96d779e22796600032521e0f115b49e1eac33c0c83f4add74
|
File details
Details for the file firstlook-0.1.0-py3-none-any.whl.
File metadata
- Download URL: firstlook-0.1.0-py3-none-any.whl
- Upload date:
- Size: 13.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7fe830395994155a4fbf0de800c61a4d1c6cfa06245d08b7cdb00f6932d731b7
|
|
| MD5 |
7e75157ce88a6d3355ec9837c04fa991
|
|
| BLAKE2b-256 |
cdca111a0652d2aba6987723a34dc2c7765ee44041b81ffadb657208a262e5bd
|