BaşlayınÜcretsiz Başlayın

Second order link-based features

In this exercise, you will compute the number and ratio of churn and non-churn neighbors in the second order neighborhood. The procedure is the same as in the previous exercise, except now you use the second order adjacency matrix.

Bu egzersiz

Predictive Analytics using Networked Data in R

kursunun bir parçasıdır
Kursu Görüntüle

Egzersiz talimatları

  • Compute the number of churn neighbors in the second order neighborhood using SecondOrderMatrix and the Churn attribute. Convert the result with as.vector() and add it as ChurnNeighbors2 to network.
  • Also compute NonChurnNeighbors2, the number of non-churn neighbors in the second order neighborhood.
  • Calculate RelationalNeighbor2, the ratio of churners in the second order neighborhood, by dividing ChurnNeighbors2 with the sum of ChurnNeighbors2 and NonChurnNeighbors2.

Uygulamalı interaktif egzersiz

Bu örnek kodu tamamlayarak bu egzersizi bitirin.

# Compute the number of churners in the second order neighborhood
V(network)$ChurnNeighbors2 <- as.vector(___ %*% V(network)$___)

# Compute the number of non-churners in the second order neighborhood
V(network)$___ <- as.vector(___ %*% (1 - V(network)$___))

# Compute the relational neighbor probability in the second order neighborhood
V(network)$___ <- as.vector(V(network)$___ / 
    (V(network)$___ + V(network)$___))
Kodu Düzenle ve Çalıştır