logo
Loading...

Cannot cast array data from dtype('int64') to dtype('int32') - Cupoy

import seaborn as snsimport matplotlib.pyplot as p...

顯示

Cannot cast array data from dtype('int64') to dtype('int32')

2020/03/07 03:15 AM
機器學習新手論壇
Jeff Huang
觀看數:0
回答數:2
收藏數:0
顯示


import seaborn as sns

import matplotlib.pyplot as plt

sns.regplot(x = df['1stFlrSF'][:train_num], y=train_Y)

plt.show()


# 做線性迴歸, 觀察分數

train_X = MMEncoder.fit_transform(df)

estimator = LinearRegression()

cross_val_score(estimator, train_X, train_Y, cv=5).mean()


TypeError: Cannot cast array data from dtype('int64') to dtype('int32') according to the rule 'safe'


附上程式碼, 出現如上Error, 求解!