Skip to content

Instantly share code, notes, and snippets.

@cj2001
Created November 2, 2021 20:38
Show Gist options
  • Save cj2001/0e7405f5aafee4d3b4cfd2d0fed85fc3 to your computer and use it in GitHub Desktop.
Save cj2001/0e7405f5aafee4d3b4cfd2d0fed85fc3 to your computer and use it in GitHub Desktop.
CORA create objective function
def objectiveSKLearn():
def objective(params):
dim = params['embeddingDimension']
thirdWeight = params['thirdWeight']
fourthWeight = params['fourthWeight']
normalizationStrength = params['normalizationStrength']
# Create embeddings
query = """CALL gds.fastRP.write(
'cora',
{
embeddingDimension: %d,
iterationWeights: [0.0, 0.0, %f, %f],
normalizationStrength: %f,
randomSeed: 42,
writeProperty: 'fastrp_embedding'
}
)
""" % (dim, thirdWeight, fourthWeight, normalizationStrength)
conn.query(query)
return modeler(params)
return objective
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment