jinhongjung / pyrwr Goto Github PK
View Code? Open in Web Editor NEWPython Implementation for Random Walk with Restart (RWR)
License: MIT License
Python Implementation for Random Walk with Restart (RWR)
License: MIT License
As noted in abhishekmaha23/RoleSim-Python#2 there are other Link predictions out there, and this repo seemed to have some of the best algorithms. Is it possible to include them in this repo?
I have tried to RWR without weight. However, in "utils/reader.py", "weighted" is directly defined as True and so even if my edges are unweighted, "A = csr_matrix((np.ones(len(K), (I, J), shape=A.shape)))" gives error due to lack of weight. I solved the problem by giving them all same weight as default 1. In fact, it may be solved directly "utils/reader.py". weights argumant may be added as weights default True.
How to print out the random walk steps while doing pagerank ?
Does the input file of the undirected graph need to have reverse edges?
like,
0-1
1-0
Hi,
I see that you hardcoded the package versions for requirements.txt. Have you tested on newer versions? I cannot downgrade to the package versions you suggest in my environment. It would be good to have compatibility with the latest versions of numpy and scipy.
Hi
Is there any guides regarding How to implement this algorithim to anomaly detection
I was trying to execute train_WGCN.py from this repository this error appeared. I execute the code through Anaconda environment.
My setup:
Operating System: Windows 10
Conda version: 4.10.3
Python version: 3.6.13
Using backend: pytorch
Traceback (most recent call last):
File "train_WGCN.py", line 79, in <module>
structural_info = compute_structural_infot(args.dataset, args.directed, args.dijkstra_k, args.in_out_ratio,args.restart_rate,args.in_out_peak)
File "D:\Git\WGCN_Graph-Convolutional-Networks-with-Weighted-Structural-Features\utils_structural.py", line 50, in compute_structural_infot
rwr.read_graph(input_graph, graph_type)
File "E:\anaconda3\envs\wgcn\lib\site-packages\pyrwr-1.0.0-py3.6.egg\pyrwr\pyrwr.py", line 25, in read_graph
self.A, self.base = reader.read_graph(input_path, graph_type)
File "E:\anaconda3\envs\wgcn\lib\site-packages\pyrwr-1.0.0-py3.6.egg\utils\reader.py", line 77, in read_graph
X = np.loadtxt(path, dtype=float, comments='#')
File "E:\anaconda3\envs\wgcn\lib\site-packages\numpy\lib\npyio.py", line 968, in loadtxt
fh = np.lib._datasource.open(fname, 'rt', encoding=encoding)
File "E:\anaconda3\envs\wgcn\lib\site-packages\numpy\lib\_datasource.py", line 269, in open
return ds.open(path, mode, encoding=encoding, newline=newline)
File "E:\anaconda3\envs\wgcn\lib\site-packages\numpy\lib\_datasource.py", line 623, in open
raise IOError("%s not found." % path)
OSError: data\cora_ml\out1_graph_edges_rwr.txt not found.
The error shows that rwr.read_graph(input_graph, graph_type)
function is not successfully executed.
What might be the problem? Thanks in advance
In your code or function : "row_normalize()" as well as other functions, the shape of the function's input matrix should be the same in rows and columns. If the number of rows doesn't match up with that of its columns, we will get error from the function "np.dot()".
If the assumption is that "the matrix.shape[0] == matrix.shape[1]", then why bother to set:
m, n = self.A.shape ? It's really redundant and misleading.
I think that the code can be simplified.
Thank you for this great resource. Are there plans to integrate a python version of the "BePI" algorithm , which allows for fast and memory efficient RWR? RE: https://datalab.snu.ac.kr/bepi/resources/bepiSIGMOD2017.pdf
Thank you!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.