Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible bug in the prediction method #28

Open
mostafiz67 opened this issue Mar 20, 2021 · 2 comments
Open

Possible bug in the prediction method #28

mostafiz67 opened this issue Mar 20, 2021 · 2 comments

Comments

@mostafiz67
Copy link

mostafiz67 commented Mar 20, 2021

I am not sure, I am wrong or what wrong with the package. But something is wrong. For example, when I am trying to calculate the link prediction score for common neighbor it is showing score 1 for node 1 and 8 but the dataset does not have any common neighbor between these 2 nodes. Again, it is not showing any score for node 1 and 6 but we have 1 common neighbor between these 2 nodes.

Code:

df_graph <- read.csv("~/Assignment_3.csv", header = TRUE)
graph <- graph_from_data_frame(df_graph, directed = FALSE)
plot(graph, vertex.label = V(graph)$name)
Common_neighbor <- linkprediction::proxfun(graph, method= "cn", value = "edgelist")

Output

   from to value
1     2  1     2
2     3  1     1
3     4  1     1
4     8  1     1
5     1  2     2
6     3  2     1
7     6  2     1
8     8  2     2
9     1  3     1
10    2  3     1
11    4  3     1
12    7  3     1
13    8  3     1
14    1  4     1
15    3  4     1
16    5  4     2
17    6  4     1
18    7  4     2
19    4  5     2
20    6  5     1
21    7  5     1
22    8  5     1
23    2  6     1
24    4  6     1
25    5  6     1
26    8  6     1
27    3  7     1
28    4  7     2
29    5  7     1
30    1  8     1
31    2  8     2
32    3  8     1
33    5  8     1
34    6  8     1

Reproducible Data:

structure(list(To = c(1L, 1L, 1L, 2L, 2L, 2L, 3L, 4L, 5L, 8L, 
8L), From = c(7L, 3L, 4L, 7L, 4L, 5L, 4L, 6L, 6L, 5L, 6L)), class = "data.frame", row.names = c(NA, 
-11L))
@mbojan
Copy link
Member

mbojan commented Mar 20, 2021

Thanks @mostafiz67 . Are you using CRAN or the GitHub version of the package?

@mostafiz67
Copy link
Author

mostafiz67 commented Mar 20, 2021

I am not sure. How can I check?

Most probably CRAN.

linkprediction * 1.0-0 2018-10-19 [1] CRAN (R 3.6.3)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants