<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 Title
Step1:  Create Binary Feature And Target Data
Step2:  View Feature Data
Step3:  Train Bernoulli Naive Bayes Classifier
<ASSISTANT_TASK:>
Python Code:
# Load libraries
import numpy as np
from sklearn.naive_bayes import BernoulliNB
Explanation: Title: Bernoulli Naive Bayes Classifier  
Slug: bernoulli_naive_bayes_classifier 
Summary: How to train a Bernoulli naive bayes classifer in Scikit-Learn 
Date: 2017-09-22 12:00
Category: Machine Learning
Tags: Naive Bayes   
Authors: Chris Albon  
The Bernoulli naive Bayes classifier assumes that all our features are binary such that they take only two values (e.g. a nominal categorical feature that has been one-hot encoded).
Preliminaries
End of explanation
# Create three binary features
X = np.random.randint(2, size=(100, 3))
# Create a binary target vector
y = np.random.randint(2, size=(100, 1)).ravel()
Explanation: Create Binary Feature And Target Data
End of explanation
# View first ten observations
X[0:10]
Explanation: View Feature Data
End of explanation
# Create Bernoulli Naive Bayes object with prior probabilities of each class
clf = BernoulliNB(class_prior=[0.25, 0.5])
# Train model
model = clf.fit(X, y)
Explanation: Train Bernoulli Naive Bayes Classifier
End of explanation
<END_TASK>