Skip to content

Docs: README usage example and examples/ quickstart notebook (#7) - #15

Closed
mertcankaratass wants to merge 4 commits into
octacity-org:mainfrom
mertcankaratass:docs/quickstart-notebook
Closed

mertcankaratass wants to merge 4 commits into
octacity-org:mainfrom
mertcankaratass:docs/quickstart-notebook

Conversation

@mertcankaratass

Copy link
Copy Markdown

Closes #7

Summary

Adds a runnable quick start example to the README and an end-to-end interactive tutorial notebook in examples/quickstart.ipynb.

  • README quick start: replaced the planned API note with a runnable inline DataFrame example showing fit_transform on train, transform on test, and get_feature_names_out(). The printed output matches code execution exactly.
  • examples/quickstart.ipynb:
    • Generates a self-contained synthetic customer classification dataset (runs completely offline without downloads).
    • Demonstrates each block individually (MissingValueImputer, CategoricalEncoder, FeatureScaler), then composes them in Pipeline.
    • Shows feature names tracking after one-hot encoding with get_feature_names_out().
    • Integrates with scikit-learn via make_pipeline and cross_val_score(cv=5).
    • Explains and demonstrates data leakage prevention by comparing training center with test set statistics.
    • Executed and committed with outputs.
  • pyproject.toml: added jupyter and nbconvert to dev extra.

Note: This branch includes PR #12 (CategoricalEncoder) so that the notebook and README run cleanly end-to-end. Once PR #12 is merged into main, this PR will only contain the documentation and notebook changes.

How was it tested

  • pytest: 134 passed in 1.92s
  • jupyter nbconvert --to notebook --execute --inplace examples/quickstart.ipynb: runs cleanly with exit code 0
  • ruff check .: All checks passed!
  • ruff format --check .: 15 files already formatted

Checklist

  • ruff format . and ruff check . pass
  • pytest passes
  • New or changed blocks follow the block rules in CONTRIBUTING.md
  • Block tests include a leakage test (statistics come from the training data only) and a run inside sklearn cross_val_score

mehmeterencakmak and others added 4 commits October 21, 2026 12:16
Encodes object, string and category columns using sorted categories
learned in fit; numeric columns pass through. Overrides
get_feature_names_out for the generated one-hot columns.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Cover both methods, unknown handling, validation, missing values,
name collisions, get_feature_names_out and scikit-learn compatibility.
Compute codes with Index.get_indexer, since building a Categorical from
values outside its categories is deprecated in pandas.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

README usage example and examples/ quickstart notebook

3 participants