我有以下标签的矩阵和向量: 想法是根据y中的标签(1和-1)在点内绘制点。假定计算功能true_label起作用。
using (var context = new UsbContext())
{
var haljiaUsbRelays = context.List().Where(d => d.ProductId == 0x7523 && d.VendorId == 0x1a86);
Console.WriteLine($"{haljiaUsbRelays.Count()} relays found.");
foreach (UsbDevice x in haljiaUsbRelays)
{
Console.WriteLine($"Portnumber: {x.PortNumber}");
string portName = ConvertPortNumberToPortName(x.PortNumber);//I need this function
var port = new SerialPort(portName);
}
}
但是我似乎无法使它正常工作。
M = [5, 10, 15, 25, 70]
for m in M:
points = np.random.multivariate_normal(np.zeros(2), np.eye(2), m)
true_labels = true_label(points)
y = np.where(true_labels, 1, -1)
fig, ax = plt.subplots(1, 1)
colors = ['green', 'red', 'blue']
plt.plot(points, c=y, cmap=matplotlib.colors.ListedColormap(colors))
# red is 1, blue is -1
plt.show()
是我不断得到的。我已经更新了matplotlib,所以我真的不明白为什么这不起作用。关于如何轻松完成此操作的任何建议?