from keras.utils.np_utils import *

# 类别向量定义
b = [0, 1, 2, 3, 4, 5, 6, 7, 8]
# 调用to_categorical将b按照9个类别来进行转换
b = to_categorical(b, 9)
print(b)

 

来源:https://blog.csdn.net/moyu123456789/article/details/83444140

相关文章:

  • 2021-11-10
  • 2022-12-23
  • 2021-11-29
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-12-08
  • 2021-08-21
  • 2022-12-23
  • 2022-01-01
  • 2022-12-23
  • 2022-12-23
  • 2021-10-04
相关资源
相似解决方案