我试图根据数组中的数据制作彩色散点图:
plt.scatter(150, 93, c=y_pred)
此处y_pred
为:
array([ 5, 6, 8, 16, 21, 12, 12, 13, 6, 6, 17, 11, 6, 12, 12, 23, 6,
6, 15, 6, 6, 6, 6, 6, 6, 23, 22, 6, 12, 17, 6, 20, 0, 6,
6, 12, 12, 0, 6, 6, 6, 6, 6, 6, 5, 17, 6, 6, 11, 10, 13,
6, 22, 24, 23, 6, 6, 13, 6, 6, 6, 12, 9, 15, 13, 14, 6, 18,
1, 6, 9, 6, 6, 11, 6, 5, 16, 9, 23, 2, 14, 24, 9, 5, 9,
10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 1, 6, 19, 6, 23, 3,
20, 10, 4, 8, 9, 6, 6, 9, 22, 23, 6, 6, 11, 6, 6, 6, 22,
24, 14, 4, 7, 12, 6, 19, 6, 12, 3, 22, 6, 11, 6, 21, 23, 4,
6, 6, 6, 4, 10, 22, 15, 6, 6, 18, 6, 14, 4, 5], dtype=int32)
这给了我一个错误:
ValueError:无效的RGBA参数:17
我不明白为什么。相同的解决方案适用于others。你能帮我理解这个错误吗?