link-prediction | Predict links in a citation network | Machine Learning library
kandi X-RAY | link-prediction Summary
kandi X-RAY | link-prediction Summary
Predict links in a citation network
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Plot a grid plot
- Returns a list of ticker labels
- Generate a list of ticks for a double ticker
- Optimized objective function
- Compute f1 score
- Calculates the cosine distance between two IDs
- Return tfidf encoding
- Load training data
- Plot the importances of a forest
- Compute the score between two terms
link-prediction Key Features
link-prediction Examples and Code Snippets
Community Discussions
Trending Discussions on link-prediction
QUESTION
I am trying to run a link prediction using HinSAGE in the stellargraph python package.
I have a network of people and products, with edges from person to person (KNOWs) and person to products (BOUGHT). Both people and products got a property vector attached, albeit a different one from each type (Persons vector is 1024 products is 200). I am trying to create a link prediction algorithm from person to product based on all the information in the network. The reason for me for using HinSAGE is the option for inductive learning.
I have the code below, and I thought I was doing it similar to the examples
https://stellargraph.readthedocs.io/en/stable/demos/link-prediction/hinsage-link-prediction.html https://stellargraph.readthedocs.io/en/stable/demos/link-prediction/graphsage-link-prediction.html
but I keep getting "nan" as my output predictions, anyone got a suggestion to what I can try?
...ANSWER
Answered 2021-Nov-04 at 14:43So I found the problem, might be useful for others. If there is any node containing missing data, the thing will just produce NAs. Especially dangerous if you create your graph by joining pandas dataframes, I had a typo in one file that was integrated and led to the problem.
QUESTION
I'm trying to do a link prediction with stellargraph, following the documention tutorial.
When I reach this part :
ANSWER
Answered 2021-Oct-06 at 13:55I finally found the solution. It was quite unclear (at least to me) from the documentation but your nodes' labels must be string and not integer.
So a simple .astype(str)
in my dataframe fixed it.
I hope this will help others in the future !
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install link-prediction
You can use link-prediction like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page