No video

Don't use .values when passing a pandas object to scikit-learn

  Рет қаралды 3,043

Data School

Data School

Күн бұрын

There's no need to use ".values" when passing a DataFrame or Series to scikit-learn... it knows how to access the underlying NumPy array!
👉 New tips every TUESDAY and THURSDAY! 👈
🎥 Watch all tips: • scikit-learn tips
🗒️ Code for all tips: github.com/jus...
💌 Get tips via email: scikit-learn.tips
=== WANT TO GET BETTER AT MACHINE LEARNING? ===
1) LEARN THE FUNDAMENTALS in my intro course (free!): courses.datasc...
2) BUILD YOUR ML CONFIDENCE in my intermediate course: courses.datasc...
3) LET'S CONNECT!
- Newsletter: www.dataschool...
- Twitter: / justmarkham
- Facebook: / datascienceschool
- LinkedIn: / justmarkham

Пікірлер: 3
@dataschool
@dataschool 3 жыл бұрын
Want more scikit-learn tips? Check out this playlist: kzfaq.info/sun/PL5-da3qGB5ID7YYAqireYEew2mWVvgmj6
@rachitban
@rachitban 3 жыл бұрын
We add .values just to make it more speedy so that it doesn't have to convert to numpy array by itself.
@dataschool
@dataschool 3 жыл бұрын
That's fine, though that means you won't be able to access columns by name with ColumnTransformer, and starting in scikit-learn 1.0 (coming soon) you will miss out on some additional functionality with respect to feature names.
Most parameters should be passed as keyword arguments
1:56
Data School
Рет қаралды 2,8 М.
Use OrdinalEncoder instead of OneHotEncoder with tree-based models
6:59
ISSEI & yellow girl 💛
00:33
ISSEI / いっせい
Рет қаралды 22 МЛН
Little brothers couldn't stay calm when they noticed a bin lorry #shorts
00:32
Fabiosa Best Lifehacks
Рет қаралды 19 МЛН
Kind Waiter's Gesture to Homeless Boy #shorts
00:32
I migliori trucchetti di Fabiosa
Рет қаралды 13 МЛН
21 more pandas tricks
24:40
Data School
Рет қаралды 47 М.
Internet is going wild over this problem
9:12
MindYourDecisions
Рет қаралды 122 М.
scikit-learn Version 1.5.0 Release Highlights
12:54
scikit-learn
Рет қаралды 1,2 М.
Passthrough some columns and drop others in a ColumnTransformer
3:11
My top 50 scikit-learn tips
2:47:31
Data School
Рет қаралды 12 М.
Tune multiple models simultaneously with GridSearchCV
5:07
Data School
Рет қаралды 7 М.
Adapt this pattern to solve many Machine Learning problems
7:49
Data School
Рет қаралды 12 М.
Create feature interactions using PolynomialFeatures
4:08
Data School
Рет қаралды 7 М.
ISSEI & yellow girl 💛
00:33
ISSEI / いっせい
Рет қаралды 22 МЛН