Skip to content

Instantly share code, notes, and snippets.

@Crepu
Created January 5, 2019 01:13
Show Gist options
  • Select an option

  • Save Crepu/7f540a12a7cf1e1a84b9cdd6f8d7c7b0 to your computer and use it in GitHub Desktop.

Select an option

Save Crepu/7f540a12a7cf1e1a84b9cdd6f8d7c7b0 to your computer and use it in GitHub Desktop.
#vectores de caracteristicas
datos=[[1,1,1],
[1,1,1],
[1,1,1],
[1,1,0],
[1,0,0],
[1,0,0]]
etiquetas=[1,1,1,-1,-1,-1]
test=[[1,1,1],
[1,0,0]]
from sklearn.naive_bayes import MultinomialNB
modelo=MultinomialNB()
modelo.fit(datos,etiquetas)
print(modelo.predict(test))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment