Quiz 2

Feature Engineering

81 words
1 min read
Python Week 1: the first filter for runtime behavior
Visual companion
Python
Type and operator map

Python Week 1: the first filter for runtime behavior

View
Revision summary

What this note is really saying

Short form

# Feature Engineering ## Encoding Categorical Data ## Feature Scaling ## Feature Selection Method Description When to Use Filter (correlation) Remove highly correlated features Quick preprocessing Wrapper (RFE) Recursive feature elimination Small to medium data Embedded (Lasso) L1 regularization High-dimensional dat...

Feature Engineering

Encoding Categorical Data

python
import pandas as pd
from sklearn.preprocessing import LabelEncoder, OneHotEncoder
# One-hot encoding
df = pd.DataFrame({'color': ['red', 'blue', 'green', 'blue']})
encoded = pd.get_dummies(df, columns=['color'])
print(encoded)

Feature Scaling

python
from sklearn.preprocessing import StandardScaler, MinMaxScaler
scaler = StandardScaler()
X_scaled = scaler.fit_transform(X)

Feature Selection

MethodDescriptionWhen to Use
Filter (correlation)Remove highly correlated featuresQuick preprocessing
Wrapper (RFE)Recursive feature eliminationSmall to medium data
Embedded (Lasso)L1 regularizationHigh-dimensional data
Tree-based importanceRandom Forest feature importanceNon-linear relationships
Document outline

Keep your place and jump directly to a heading.

Table of Contents
System Normal // Awaiting Context

Intelligence Hub

Navigate the knowledge graph to generate context. The Hub adapts dynamically to surface backlinks, related notes, and metadata insights.