python - 如何处理 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'
解决我的问题的解决方案是什么?您的帮助将非常宝贵,谢谢
解决方案
推荐阅读
- java - 当表有外键时,Telosys 代码生成失败
- javascript - Angular - 将自定义验证器分配给 FormGroup
- swift - 许多 ImageView 的类似 UITapGestureRecognizer 操作
- sql - 基于其他列值的回填值
- angular - Ionic 3 Angular 4 上的意外令牌)
- laravel - Laravel JWT Auth Apache 设置转换为 Nginx
- list - 将循环中的值存储在列表列表或元组列表中
- mysql - MYSQL 按位与
- javascript - 以编程方式设置 for 循环的第三条语句
- java - Android:数组循环返回空元素