Thanks for replying to my message, Alicia. Here's my original query from gds.beta.knn:
// K-Nearest Neighbors based on Volume
:param limit => ( 42);
:param config => ({nodeProjection: 'Price', relationshipProjection: {relType: {type: 'PRICE_PERIOD', orientation: 'NATURAL', properties: {} } }, nodeWeightProperty: 'volume', topK: 10, randomJoins: 10, sampleRate: 0.5, deltaThreshold: 0.001, nodeProperties: ['volume'], writeProperty: 'volumeSimilarityScore', writeRelationshipType: 'SIMILAR_KNN_VOLUME'});
:param communityNodeLimit => ( 10);
CALL gds.beta.knn.write($config);
Previously, I just set everything up in Neuler (Graph Data Science Playground) and had it write to the existing base database not a named graph.
Now, I'm trying to do this, but it's asking me to pass in the named graph, which I don't want to do. I just it to write the property and relationships to my base neo4j database and not an in memory graph.. Here's my current attempt using the new version:
// K-Nearest Neighbors based on Volume
:param limit => ( 42);
:param graphConfig => ({
nodeProjection: 'Price',
relationshipProjection: {
relType: {
type: 'PRICE_PERIOD',
orientation: 'NATURAL',
properties: {}
}
},
nodeProperties: [
'volume'
]
});
:param config => ({
topK: 10,
randomJoins: 10,
sampleRate: 0.5,
deltaThreshold: 0.001,
nodeProperties: {
volume: 'PEARSON'
},
writeProperty: 'score',
writeRelationshipType: 'SIMILAR_KNN_VOLUME'
});
:param communityNodeLimit => ( 10);
CALL gds.knn.write($config);
gds.knn.write() seems to need the name of a graph like this: CALL gds.knn.write($generatedName, $config); But in my case I'm not projecting to a named graph, I writing directly to the database.
Well at least I was in the beta.knn version anyway, So I'm just not sure how to do this in the new knn production verion, or if it's possible.
Hopefully that makes sense. Let me know if you need more details or background on what I'm doing.
This is one step I use in my core demo data on the stock market series using Neo4j for Insight Driven Analytics and visualization with Power BI. I'm looking at correlations and studies on volume similarity between the same stock and different stocks on different days.