Probabilistic Relational Neighbor Classifier
In this exercise, you will apply the probabilistic relational neighbor classifier to infer churn probabilities based on the prior churn probability of the other nodes.
Instead of knowing the nodes' labels, suppose you know each node's probability of churn, as in the image below. In the image, C stands for churn and NC for non-churn.
Then, as before, you can update the churn probability of the nodes by finding the average of the neighboring nodes' churn probabilities.
Cet exercice fait partie du cours
Predictive Analytics using Networked Data in R
Instructions
- Find the churn probability of the 44th customer in the vector
churnProb
. - Update the churn probability by multiplying
AdjacencyMatrix
bychurnProb
and dividing with the vectorneighbors
which contains the neighborhoods' sizes. We have addedas.vector()
around the matrix operations. Assign the result tochurnProb_updated
. - Find the updated churn probability of the 44th customer in the vector
churnProb_updated
. - What happened to the churn probability of the 44th customer?.
Exercice interactif pratique
Essayez cet exercice en complétant cet exemple de code.
# Find churn probability of the 44th customer
churnProb[___]
# Update the churn probabilties and the non-churn probabilities
churnProb_updated <- as.vector((AdjacencyMatrix %*% ___) / ___)
# Find updated churn probability of the 44th customer
churnProb_updated[___]