小编Mas*_*lah的帖子

未知标签类型:“连续”

我的团队,遇到了问题
----------------------

   Avg.SessionLength TimeonApp  TimeonWebsite LengthofMembership Yearly Amount Spent
    0   34.497268   12.655651    39.577668     4.082621                 587.951054
    1   31.926272   11.109461    37.268959     2.664034                 392.204933
    2   33.000915   11.330278    37.110597     4.104543                 487.547505
    3   34.305557   13.717514    36.721283     3.120179                 581.852344
    4   33.330673   12.795189    37.536653     4.446308                 599.406092
    5   33.871038   12.026925    34.476878     5.493507                 637.102448
    6   32.021596   11.366348    36.683776     4.685017                 521.572175 
Run Code Online (Sandbox Code Playgroud)

想申请KNN

X = df[['Avg. Session Length', 'Time on App','Time on Website', 'Length of Membership']] 
y = df['Yearly Amount Spent'] 

from sklearn.model_selection import train_test_split
X_train, X_test, y_train, y_test = train_test_split(X, …
Run Code Online (Sandbox Code Playgroud)

python knn pandas scikit-learn

2
推荐指数
1
解决办法
3888
查看次数

标签 统计

knn ×1

pandas ×1

python ×1

scikit-learn ×1