Does projecting all the nodes and relationships of a graph also project their properties?
Is it not possible to use type properties as one of the features while training a graph algorithm?
I have a KG from an ecommerce website. I have user node, session node, orders node and their relationships etc. I am trying to use link prediction algorithm to predict the link between an order node and a recipient node. Is there any useful resource that I could refer?
I am a beginner in neo4j GDS. Any help is appreciated. Thanks in advance!
Thanks @Cobra for the reply,
3. I went through the example actually and was able to understand quite a bit. The issue I am not able to relate it to my use case which is link pred. Main problem is how to split the graph for training and testing. i.e., I have a particular relationship and this relationship is missing between few nodes. I need my train set to have a graph with the relation and test set to be without the relation. So that the model is able to predict missing relations of the test graph. There are only a few uses which are very simple.
1. This makes sense. But here it is used only for a pair of similar nodes. My use case is to predict relation between nodes but of different type. Let me define my problem statement first.
I have a graph something like this.
(:session)-[:contains]->(:order), (:customer)-[:has]->(:session),(:order)-[:has]->(:product), (:order)-[:to]->(:relation)
There are many customers who have placed orders. Some of the orders specify to whom the order was intended to (relation) i.e., mother/father etc. and some orders do not. For these orders my intention is to predict to whom the order was likely intended to. Any suggestions?
I guess you can start without a machine learning pipeline, last time I worked with a recommendation engine I used Adamic Adar to recommend sessions of formation. Here are some articles if you need more explanation:
You can compute the score between orders which will give you a score then create the relation between the order and the relation with the score in it. The issue with this method is that you will have the same score for everyone. For heterogeneous graph, I think you will have to use machine learning pipeline.
I want to the train set to have only positive samples i.e., graph containing the relation between order & relation. Test set to have only negative samples. i.e., graph not containing the relation between order & relation.
The way we do in classic ML and DL. It should be able to learn from the train and predict them in test. But here I see both train and test will have negative samples.
I do not want the model to predict missing links between every other node rather it should be able to predict between only order node and relation node
How do I achieve this?
Okay.. Is it not possible to make the model predict only for specified nodes before hand?
Also,
Below is an example of exhaustive search prediction given in the doc. Here relationshipType means that the graph is filtered on KNOWS relation. There would be no disconnected nodes for prediction in such case am I right? Please correct me if I am wrong.
CALL gds.beta.pipeline.linkPrediction.predict.mutate('myGraph',
{ modelName: 'lp-pipeline-model',
relationshipTypes: ['KNOWS'],
mutateRelationshipType: 'KNOWS_EXHAUSTIVE_PREDICTED',
topN: 5, threshold: 0.45 })YIELD relationshipsWritten, samplingStats
So, I was able to train the model and the model is now ready for predictions.
There are 2 ways of prediction: Exhaustive search, Approximate search. The first one predicts for all unconnected nodes and the second one applies KNN to predict. I do not want both; rather I want the model to predict the link only between 2 specific nodes 'order' node and 'relation' node.. Is there any way to achieve this?
Hi again,
How do I query the relationships from a projected graph? i.e., I have a few relationships predicted from my LP model and I want to see between how many nodes is this new relation created.