Challenge: Manual Feature Centering
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.
- Compute the per-feature means as a 1D array
feature_meansof shape(n_features,). - Create
X_centered = X - feature_meansusing broadcasting. - Compute column means of
X_centeredto verify they are approximately zero. - Do not use loops and do not modify
Xin place.
Рішення
Дякуємо за ваш відгук!
single
Запитати АІ
Запитати АІ
Запитайте про що завгодно або спробуйте одне із запропонованих запитань, щоб почати наш чат
Can you explain this in simpler terms?
What are the main benefits or drawbacks?
Can you give me a real-world example?
Awesome!
Completion rate improved to 5.26
Challenge: Manual Feature Centering
Свайпніть щоб показати меню
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.
- Compute the per-feature means as a 1D array
feature_meansof shape(n_features,). - Create
X_centered = X - feature_meansusing broadcasting. - Compute column means of
X_centeredto verify they are approximately zero. - Do not use loops and do not modify
Xin place.
Рішення
Дякуємо за ваш відгук!
single