diff --git a/CHANGELOG.md b/CHANGELOG.md index cb740fa..7881e29 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,29 @@ Full parity with the R `moderndive` and `infer` packages. +- **Parity with R `moderndive` PR #144**: + - `get_correlation()` now accepts multiple right-hand-side predictors + (`"y ~ x1 + x2"`) — long output by default, `wide=True` for one column per + predictor; a suppressible (`quiet=True`) note points to a full pairwise matrix. + - `get_regression_table()`, `get_regression_points()`, and + `get_regression_summaries()` now accept fitted **`glm()`** models. GLM points + are on the response scale (e.g. probabilities), summaries are GLM-shaped + (`deviance`, `null_deviance`, `aic`, `bic`, `log_lik`, …), and the table gains + an `exponentiate=` argument for odds/rate ratios. + - `get_regression_points()` handles **in-formula transformations**: a + transformed outcome like `np.log(mpg)` is shown on the model scale as + `log_mpg`/`log_mpg_hat`, and transformed predictors (`poly()`, `scale()`, + `I()`) are shown as their original columns rather than leaking basis matrices. + - New **`plot_3d_regression(data, "z ~ x + y")`**: interactive 3D scatter with a + fitted regression plane (plotly). + - New **`View()`**: renders a data frame as an interactive, searchable table via + the optional `itables` package (`pip install "moderndive[view]"`) — the Python + counterpart of R's `DT::datatable()` — with a graceful fallback when itables + isn't installed. + - `geom_categorical_model()` is available as an alias of `gg_categorical_model()`. + - Messages and errors are now beginner-friendly, in the `infer` style (a short + summary line followed by `→` hint bullets); informational notes use a + dedicated, suppressible `ModernDiveMessage` category. - **`count_missing()`**: a beginner-friendly helper that counts `null` values per column and returns a tidy `column`/`n_missing` data frame sorted from most to fewest missing — a gentler alternative to `df.select(pl.all().is_null().sum())`. diff --git a/doc/_build/html/.doctrees/api.doctree b/doc/_build/html/.doctrees/api.doctree index 4ee6fb2..ffe85ed 100644 Binary files a/doc/_build/html/.doctrees/api.doctree and b/doc/_build/html/.doctrees/api.doctree differ diff --git a/doc/_build/html/.doctrees/environment.pickle b/doc/_build/html/.doctrees/environment.pickle index 32d544f..b1654b5 100644 Binary files a/doc/_build/html/.doctrees/environment.pickle and b/doc/_build/html/.doctrees/environment.pickle differ diff --git a/doc/_build/html/.doctrees/getting-started.doctree b/doc/_build/html/.doctrees/getting-started.doctree index 86761dc..858009c 100644 Binary files a/doc/_build/html/.doctrees/getting-started.doctree and b/doc/_build/html/.doctrees/getting-started.doctree differ diff --git a/doc/_build/html/.doctrees/guides/confidence-intervals.doctree b/doc/_build/html/.doctrees/guides/confidence-intervals.doctree index 09c464e..5f734c9 100644 Binary files a/doc/_build/html/.doctrees/guides/confidence-intervals.doctree and b/doc/_build/html/.doctrees/guides/confidence-intervals.doctree differ diff --git a/doc/_build/html/.doctrees/guides/hypothesis-testing.doctree b/doc/_build/html/.doctrees/guides/hypothesis-testing.doctree index efd13ea..a31e2c0 100644 Binary files a/doc/_build/html/.doctrees/guides/hypothesis-testing.doctree and b/doc/_build/html/.doctrees/guides/hypothesis-testing.doctree differ diff --git a/doc/_build/html/.doctrees/guides/messages.doctree b/doc/_build/html/.doctrees/guides/messages.doctree new file mode 100644 index 0000000..858f6a4 Binary files /dev/null and b/doc/_build/html/.doctrees/guides/messages.doctree differ diff --git a/doc/_build/html/.doctrees/guides/plotting.doctree b/doc/_build/html/.doctrees/guides/plotting.doctree index 5b08f33..27a2be7 100644 Binary files a/doc/_build/html/.doctrees/guides/plotting.doctree and b/doc/_build/html/.doctrees/guides/plotting.doctree differ diff --git a/doc/_build/html/.doctrees/guides/regression.doctree b/doc/_build/html/.doctrees/guides/regression.doctree index 97b30c5..82a5b83 100644 Binary files a/doc/_build/html/.doctrees/guides/regression.doctree and b/doc/_build/html/.doctrees/guides/regression.doctree differ diff --git a/doc/_build/html/.doctrees/guides/theory-based.doctree b/doc/_build/html/.doctrees/guides/theory-based.doctree index 98e6f69..44d4dab 100644 Binary files a/doc/_build/html/.doctrees/guides/theory-based.doctree and b/doc/_build/html/.doctrees/guides/theory-based.doctree differ diff --git a/doc/_build/html/.doctrees/index.doctree b/doc/_build/html/.doctrees/index.doctree index 73bb499..da8fc55 100644 Binary files a/doc/_build/html/.doctrees/index.doctree and b/doc/_build/html/.doctrees/index.doctree differ diff --git a/doc/_build/html/_images/8b54ea7be43ae3d659ee4cbf06d3ee5f39423bcfb5a220bab5f8e47a400c71ef.png b/doc/_build/html/_images/8b54ea7be43ae3d659ee4cbf06d3ee5f39423bcfb5a220bab5f8e47a400c71ef.png new file mode 100644 index 0000000..6498fed Binary files /dev/null and b/doc/_build/html/_images/8b54ea7be43ae3d659ee4cbf06d3ee5f39423bcfb5a220bab5f8e47a400c71ef.png differ diff --git a/doc/_build/html/_modules/index.html b/doc/_build/html/_modules/index.html index 3da3475..357cc75 100644 --- a/doc/_build/html/_modules/index.html +++ b/doc/_build/html/_modules/index.html @@ -209,6 +209,7 @@
  • Regression
  • Theory-based inference
  • Plotting: plotly & plotnine
  • +
  • Helpful messages & errors
  • Reference

    diff --git a/doc/_build/html/_modules/moderndive/correlation.html b/doc/_build/html/_modules/moderndive/correlation.html index 2a558e2..5ad5e00 100644 --- a/doc/_build/html/_modules/moderndive/correlation.html +++ b/doc/_build/html/_modules/moderndive/correlation.html @@ -209,6 +209,7 @@
  • Regression
  • Theory-based inference
  • Plotting: plotly & plotnine
  • +
  • Helpful messages & errors
  • Reference

    Reference

    Reference

    Reference

    Reference

    Reference

    Reference

    Reference

    Reference

    Reference

    Reference

    Reference

    Reference

    Reference

    @@ -1058,6 +1079,63 @@

    Sampling and plots +
    +moderndive.geom_categorical_model(data, response, explanatory, *, engine='plotly')
    +

    Regression with one categorical predictor (~ geom_categorical_model).

    +

    Fits response ~ C(explanatory); each category’s fitted value is its group +mean, drawn as a horizontal marker over the (jittered) data points.

    +
    +
    Parameters:
    +
      +
    • response (str)

    • +
    • explanatory (str)

    • +
    • engine (str)

    • +
    +
    +
    +
    + +
    +
    +moderndive.plot_3d_regression(data, formula, n=25)[source]
    +

    Interactive 3D scatterplot with a fitted regression plane.

    +

    Mirrors moderndive::plot_3d_regression. Pass a formula z ~ x + y — +one numeric outcome and exactly two numeric predictors — and get a plotly +go.Figure with the data points and the fitted lm plane.

    +

    In-formula transformations (e.g. log(z) ~ x + y) are not supported, +since the plane and the raw points would be on different scales; transform +the columns of data first and pass plain names. n sets the plane’s +grid resolution per axis.

    +
    +
    Parameters:
    +
    +
    +
    +
    + + +
    +

    Viewing data

    +
    +
    +moderndive.View(x, title=None)[source]
    +

    Display a data frame as an interactive table (search, sort, paginate).

    +

    In a notebook / Quarto context this renders an interactive table via the +optional itables package (install with pip install "moderndive[view]"). +Without itables it returns the data frame so it still displays. Accepts a +polars or pandas DataFrame (or anything coercible to one). title is shown +as the table caption.

    +
    +
    Parameters:
    +

    title (str | None)

    +
    +
    +
    +

    Datasets

    @@ -1098,14 +1176,14 @@

    Datasets