Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Leer Feature Selection vs. Feature Extraction | Section
Principal Component Analysis Fundamentals

bookFeature Selection vs. Feature Extraction

Veeg om het menu te tonen

High-dimensional datasets often have more features than you need. You can reduce features using two main strategies: feature selection and feature extraction.

  • Feature selection means keeping only the most important original features - like picking your favorite fruits from a basket;
  • Feature extraction creates new features by combining or transforming the originals - like blending all the fruits into a smoothie.

Principal Component Analysis (PCA) is a common feature extraction method, which you will explore in detail later.

12345678910111213141516171819202122
import pandas as pd from sklearn.decomposition import PCA # Example dataset data = { 'height': [150, 160, 170, 180], 'weight': [50, 60, 70, 80], 'age': [20, 25, 30, 35], 'score': [85, 90, 95, 100] } df = pd.DataFrame(data) # Feature selection: pick only 'height' and 'weight' selected_features = df[['height', 'weight']] print("Selected features (feature selection):") print(selected_features) # Feature extraction: combine features using PCA (placeholder, details later) pca = PCA(n_components=2) extracted_features = pca.fit_transform(df) print("\nExtracted features (feature extraction, via PCA):") print(extracted_features)
copy
Note
Note

PCA is a powerful feature extraction technique that creates new features (principal components) from your original data. The details of how PCA works will be covered in upcoming chapters.

Reducing the number of features can help you see patterns that might be hidden in higher dimensions. Using visualization, you can plot selected features to reveal clusters or trends more clearly. For instance, plotting only the most relevant features with seaborn can make relationships in your data stand out, making it easier to interpret and analyze.

question mark

Which statement best describes the difference between feature selection and feature extraction in dimensionality reduction

Selecteer het correcte antwoord

Was alles duidelijk?

Hoe kunnen we het verbeteren?

Bedankt voor je feedback!

Sectie 1. Hoofdstuk 3

Vraag AI

expand

Vraag AI

ChatGPT

Vraag wat u wilt of probeer een van de voorgestelde vragen om onze chat te starten.

Sectie 1. Hoofdstuk 3
some-alt