Skip to main content

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:

  1. The problem type: regression, classification, or clustering, inferred from the data.
  2. 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).
  3. 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

Metadata

Release files for firstlook 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for firstlook 0.1.0
File Size Uploaded
firstlook-0.1.0.tar.gz 15.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for firstlook 0.1.0
File Interpreter ABI Platform
firstlook-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 28.4 kB

Release files / firstlook-0.1.0.tar.gz

Download URL firstlook-0.1.0.tar.gz
Size 15.0 kB
Tags Source
SHA-256 checksum
How to use checksums
55816bc042eca341cddfc0e4ef75995a97abaf6736c908b83cef285e3a4f910c
BLAKE2b-256 checksum
How to use checksums
35d02749fbceacd96d779e22796600032521e0f115b49e1eac33c0c83f4add74
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.11

Release files / firstlook-0.1.0-py3-none-any.whl

Download URL firstlook-0.1.0-py3-none-any.whl
Size 13.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7fe830395994155a4fbf0de800c61a4d1c6cfa06245d08b7cdb00f6932d731b7
BLAKE2b-256 checksum
How to use checksums
cdca111a0652d2aba6987723a34dc2c7765ee44041b81ffadb657208a262e5bd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.11

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page