- Machine Learning with Swift
- Alexander Sosnovshchenko
- 56字
- 2025-02-17 21:20:57
Separating features from labels
Let's separate our features from the labels, as we will feed them into the model separately:
In []: features = df.loc[:,:'fluffy'] labels = df.label
This horrible construction df.loc[:,:'fluffy'] tells the data frame that we want all the rows (the first column), and the columns starting from the first, finishing with 'fluffy'.