1. Learn
  2. /
  3. Courses
  4. /
  5. Predictive Analytics using Networked Data in R

Exercise

Simple network features

In this exercise, you will extract simple network features from the churn network and add them to the network object as node attributes. The igraph object called network with the node attribute Churn, indicating customers who have already churned, has been pre-loaded. The igraph library has also been loaded for you.

Instructions 1/3

undefined XP
  • 1
    • Extract the normalized degree of each node in the network using the degree() function and name it degree.
  • 2
    • Use neighborhood.size() to extract the size of the second order neighborhood and call it degree2.
    • Normalize degree2.
  • 3
    • Extract the number of triangles with count_triangles() and add to network as a node attribute called triangles.