concept feature in category graphs

This is an excerpt from Manning's book Graph Powered Machine Learning.
Irrelevant features. The algorithms will learn in the right way if the data contains a good set of relevant features and not too many irrelevant features. While it is often a useful strategy to select more features, with the goal of increasing the accuracy of the model, more is not always better. Using more features will enable the learner to find a more detailed mapping from feature to the target and this increases the risk that the model computed overfits the data. Feature selection and feature extraction represent two important tasks during the preparation of the data.
In the content-based approach to recommendation, an item can be represented by a set of features, also called properties or attributes. Features are important or relevant characteristics of that item. In simple cases, such characteristics are easy to discover, extract, or gather. For instance, in the movie recommendation example, each movie can be described using:
It’s worth noting that when the system models relationships between users and items, regardless of whether information on users’ interests is collected implicitly or explicitly, it is possible to infer the users’ interests in specific item features using different approaches. Starting from the graph as depicted in figures 4.9 and 4.10, the following Cypher query computes new relationships between users and features and then materializes (i.e. stores as new relationships to improve access performance) them by creating new edges in the graph.
Query 4.6 Query for computing relationships between users and item features
MATCH (user:User)-[:WATCHED|RATES]->(movie:Movie)-[:ACTS_IN|WRITES|DIRECTED|PRODUCES|HAS_GENRE]-(feature) #A WITH user, feature, count(feature) as occurrences #B WHERE occurrences > 2 #C MERGE (user)-[:INTERESTED_IN]->(feature) #DThis query searches for all the graph patterns ((u:User)-[:WATCHED|RATES]->(m:Movie)) that represent all the movies watched or rated by the user. It identifies the features with (movie:Movie)-[:ACTS_IN|WRITES|DIRECTED|PRODUCES|HAS_GENRE]-(feature). For each user–feature couple, the output of WITH also indicates how often a user watched a movie with that specific feature (which could be an actor, a director, a genre, and so on). The WHERE clause filters out all the features that appear less than three times, to keep only the most relevant and not fill the graph with useless relationships. Finally, the MERGE clause creates the relationships, avoiding storing multiple relationships between the same pairs of nodes (which would happen if you used CREATE instead).
Figure 7.12 Graph model for the contextualized user preferences
![]()

This is an excerpt from Manning's book Graph Databases in Action.
Pattern matching based on how entities are related is a prime example of how to leverage the power of graph databases. Typical use cases for this sort of query involve things like recommendation engines, fraud detection, or intrusion detection. Pattern matching use cases are so commonly done in graph that graph query languages have specific, built in features to handle precisely these sorts of queries.