Feature Engineering Calculator
Generate a complete sklearn ColumnTransformer + Pipeline for your features. Configure scalers, encoders, and vectorizers for numeric, categorical, text, and datetime columns — get production-ready code instantly.
Frequently Asked Questions
What is a ColumnTransformer and why use it?▼
ColumnTransformer applies different preprocessing steps to different columns in a single, sklearn-compatible object. For example: StandardScaler on numeric columns, OneHotEncoder on categorical columns, and TfidfVectorizer on text columns — all in one pipeline step. This is the canonical sklearn approach because it prevents data leakage (fit only on training data, transform both train and test), integrates with cross-validation and GridSearchCV, and makes the full pipeline serializable with joblib.dump().
When should I use StandardScaler vs MinMaxScaler vs RobustScaler?▼
StandardScaler (z-score normalization) works best for algorithms that assume Gaussian distributions like linear regression, logistic regression, and SVM. It's sensitive to outliers. MinMaxScaler scales to [0, 1] — good for neural networks and when you need bounded values, but extremely sensitive to outliers. RobustScaler uses median and IQR instead of mean/std — the best choice when your data has significant outliers (income, price, usage data). Tree-based models (Random Forest, XGBoost) don't require scaling at all.
What encoding should I use for categorical features?▼
OneHotEncoder creates a binary column per category — best for nominal categories (country, color) and linear models, but creates high-dimensional output for high-cardinality columns. OrdinalEncoder assigns integers 0,1,2... — works for ordered categories (education level, size: S/M/L/XL) and tree-based models. TargetEncoder replaces categories with the mean target value — powerful for high-cardinality features but requires careful cross-validation to avoid leakage. For very high cardinality (>100 categories), consider embedding or frequency encoding.
How do I handle datetime features in sklearn pipelines?▼
Datetime columns must be decomposed into numeric features before sklearn can use them. Extract components like year, month, day, dayofweek (0=Monday), hour, and quarter using .dt accessor. Cyclical features (month, hour, dayofweek) are better represented as sin/cos pairs to capture their circular nature: sin(2π × month/12), cos(2π × month/12). The FunctionTransformer in sklearn allows wrapping any pandas datetime extraction into a pipeline step. Always parse dates before splitting train/test to avoid type errors.
Related Products
on GumroadDevToolkit Starter Kit
A ready-to-deploy developer tools website with 12 built-in tools. Astro + Preact + Tailwind. Deploy to Cloudflare Pages for free. Built-in SEO, dark mode, and ad-ready layout.
Buy on Gumroad →TypeScript Quick Reference Toolkit
5 practical reference files for TypeScript developers: cheatsheet, TS vs JS comparison, 20 utility types with real examples, tsconfig best practices template, and 15 common mistakes guide. Print it. Keep it on your desk.
Buy on Gumroad →Developer Productivity Bundle
Stop rebuilding the same setup every project. 51 VSCode snippets, 40 Git aliases, 5 Docker Compose stacks, 5 GitHub Actions workflows, 5 README templates, and a dotfiles kit. Set up a professional dev environment in under an hour.
Buy on Gumroad →You Might Also Need
GitHub Actions Workflow Generator
Generate GitHub Actions YAML workflows instantly. Choose triggers (push, PR, schedule), runtime (Node.js, Python, Go, Rust), and jobs (test, lint, build, Docker, GitHub Pages). Copy-ready .github/work
Open free tool →
Regex Tester Pro
Free Regex Tester Pro with real-time match highlighting. Test regular expressions with live visual feedback. Supports JS, Python, and Ruby flavors, all flags, capture groups, and 6 built-in presets. R
Open free tool →
Dockerfile Generator
Interactive wizard to generate production-ready Dockerfiles for Node.js, Python, Go, Java, and Rust. Multi-stage builds, port config, custom layers.
Open free tool →
More Free Tools
Related Articles
uv: The Blazing-Fast Python Package Manager Replacing pip & Poetry
uv is 10-100x faster than pip and replaces pip, pip-tools, virtualenv, and pyenv in one tool. Complete migration guide from pip, poetry, and conda for 2025.
DSPy: Building Self-Optimizing LLM Pipelines in 2026
DSPy 2026: build self-optimizing LLM pipelines with signatures, modules, and teleprompters. Real-world examples vs manual prompting for developers.
MLOps Platforms in 2026: MLflow vs Kubeflow vs Vertex AI vs SageMaker
Complete MLOps platform comparison for 2026. MLflow vs Kubeflow vs Vertex AI vs SageMaker — deployment patterns, pricing, pros/cons, and which to choose.
Aider AI: The Ultimate Terminal-Based AI Coding Assistant for 2026
Complete guide to Aider AI coding assistant. Setup, best practices, model options, and how this terminal-based tool compares to GUI editors for serious developer workflows.
Model Context Protocol (MCP): The Developer Guide to AI Tool Integration 2026
Build production-grade MCP servers from scratch. Covers TypeScript and Python SDKs, resources vs tools vs prompts, testing with Inspector, security patterns, and real integrations for Claude Desktop, Cursor, and Zed.
Enjoying this tool? Get more like it.
Weekly developer tool guides, productivity playbooks & AI tricks. Free. No spam.
Unlock AI-Powered Dev Tools
- ⚡ AI Code Review, Doc Generator & SQL Builder
- ⚡ All premium templates & early access
- ⚡ Member discounts on Gumroad products
$9/mo after trial · Cancel anytime
Want the full toolkit?
Get DevPlaybook Pro
Every template, guide, boilerplate, and automation script in one bundle. 13 premium products — grab them all at once and save big.
MIT licensed · Instant download · No subscription
See what's included → Browse all deals →