- Machine Learning with Swift
- Alexander Sosnovshchenko
- 56字
- 2021-06-24 18:54:56
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'.