Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Apprendre Challenge: Manual Feature Centering | Foundations of Feature Scaling
Feature Scaling and Normalization Deep Dive

bookChallenge: Manual Feature Centering

Tâche

Swipe to start coding

You are given a small dataset X as a NumPy array of shape (n_samples, n_features). Your goal is to manually center each feature (column) by subtracting its mean, without using scikit-learn. Use vectorized NumPy operations.

  1. Compute the per-feature means as a 1D array feature_means of shape (n_features,).
  2. Create X_centered = X - feature_means using broadcasting.
  3. Compute column means of X_centered to verify they are approximately zero.
  4. Do not use loops and do not modify X in place.

Solution

Tout était clair ?

Comment pouvons-nous l'améliorer ?

Merci pour vos commentaires !

Section 1. Chapitre 4
single

single

Demandez à l'IA

expand

Demandez à l'IA

ChatGPT

Posez n'importe quelle question ou essayez l'une des questions suggérées pour commencer notre discussion

close

Awesome!

Completion rate improved to 5.26

bookChallenge: Manual Feature Centering

Glissez pour afficher le menu

Tâche

Swipe to start coding

You are given a small dataset X as a NumPy array of shape (n_samples, n_features). Your goal is to manually center each feature (column) by subtracting its mean, without using scikit-learn. Use vectorized NumPy operations.

  1. Compute the per-feature means as a 1D array feature_means of shape (n_features,).
  2. Create X_centered = X - feature_means using broadcasting.
  3. Compute column means of X_centered to verify they are approximately zero.
  4. Do not use loops and do not modify X in place.

Solution

Switch to desktopPassez à un bureau pour une pratique réelleContinuez d'où vous êtes en utilisant l'une des options ci-dessous
Tout était clair ?

Comment pouvons-nous l'améliorer ?

Merci pour vos commentaires !

Section 1. Chapitre 4
single

single

some-alt