如何重塑线性回归的数据?

2024-06-01 11:56:15 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在尝试对我的数据进行线性回归。但是我有一个数据重塑的问题。我有个错误:

array=[1547977519 1547977513].
Reshape your data either using array.reshape(-1, 1) if your data has a single feature or array.reshape(1, -1) if it contains a single sample.

这是我的代码:

^{pr2}$

我试着添加。整形,但它不能正常工作。它给了我一个错误:

    X = X.reshape(-1, 1)
AttributeError: 'list' object has no attribute 'reshape'

Tags: 数据yourdataif错误线性arrayfeature