Skip to content
C

Problem 2: Predict Class Probabilities

Easypython

Problem Description

Write a Python program that trains a Naive Bayes classifier and prints the predicted probability for each class for a new data point.

Input

Training data and one new data point.

Output

The probability of each class for the new data point.

Constraints

  • None specific.

Example Input

text
X=[[1,60],[2,65],[8,95],[9,98]], y=[0,0,1,1], new=[[5,80]]

Example Output

text
Probabilities [Fail, Pass]: [0.35 0.65]

Concepts Covered

.predict_proba().

Input (stdin)

Output

Run your code to see output here...