Graphics Reference
In-Depth Information
Use the products list to add a copy of all incoming edges. The vertex check
in the addLink function you defined earlier ensures that only edges with
both ends in the graph will be added. The populated subgraph will have a
little more than 1,000 nodes and 2,000 links. Write it out somewhere as a
GraphML file.
gremlin> products._().inE.sideEffect{addLink(it,sg)}
==>...
gremlin> GraphMLWriter.outputGraph(sg, new
FileOutputStream
('tufte.graphml'))
Analyzing Neighborhoods
Import the tufte.graphml file into Gephi for visualization and analysis.
As a first step, plot the graph and highlight different types of products to get
a sense of what the data looks like. Apply the ForceAtlas2 layout and use the
Partition tab to color the nodes. Recall that this example has only two types
of nodes—products and customers—and that nodes of different types have
different properties. Products have a group property.The group value will
be null for customers, so assign the color black to null to distinguish the
relatively few customers from types of products, and view the result in the
Preview tab. Map link color to the target of the link.
As shown in Figure 14-3 , displaying the result reveals distinct clusters of
associated products, often surrounding a single customer. Looking more
closely, you can see many products within those clusters are linked to each
other, indicating that products reviewed by the same people are also often
purchased together. This seems to confirm that reviews are an effective
complement to purchasing in reflecting customer interest.
 
Search WWH ::




Custom Search