我正在使用tensorflow。我有一个训练数据集X_train,我想从中创建多项式特征。具体来说,我想使用 sklearn.preprocessing 中的 PolynomialFeatures 。我收到了错误
ValueError:使用序列设置数组元素。
我尝试编译的代码是
n_features = 3
n_samples = 1000
X_train = tf.placeholder(tf.float32, shape=(n_samples,n_features))
poly = PolynomialFeatures(degree = 3)
poly.fit_transform(X_train)