首页 > 解决方案 > 如何处理 TypeError:不支持的操作数类型 -: 'list' 和 'list'

问题描述

我尝试构建FRNN的模型:

X_train = token_train
X_test = token_test
y = train_data['Label']

clf = FRNN(upper_weights=strict(), lower_weights=strict())
cl = clf.construct(X_train, y)

但是,我收到一个错误:

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-51-8fae26120bd6> in <module>()
      4 
      5 clf = FRNN(upper_weights=strict(), lower_weights=strict())
----> 6 cl = clf.construct(X_train, y)

/content/frlearn/neighbours/classifiers.py in construct(self, X, y)
    112 
    113     def construct(self, X, y) -> Model:
--> 114         scale = (np.max(X, axis=0) - np.min(X, axis=0)) * X.shape[1]
    115         scale = np.where(scale == 0, 1, scale)
    116         X = X.copy() / scale

TypeError: unsupported operand type(s) for -: 'list' and 'list'

解决我的问题的解决方案是什么?您的帮助将非常宝贵,谢谢

标签: pythonlistfuzzy

解决方案


推荐阅读