第十八题 能提供过程的支付宝十元答谢
import numpy as np
import sklearn.naive_bayes as nb
x = np.array([
[0, 1, 0, 1],
[0, 0, 1, 1],
[1, 1, 1, 0],
[1, 0, 1, 0]
])
y = np.array([0, 0, 0, 1])
model = nb.GaussianNB()
model.fit(x, y)
x_test = np.array([1, 0, 1, 1])
result = model.predict(x_test.reshape(-1, 1))
print(result)