-
Notifications
You must be signed in to change notification settings - Fork 10
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
Weight parameter on network_p2p()
does not affect output
#181
Comments
This fix is now live on CRAN in |
I have updated my wpa package to v1.6.1 and I am still unable to see a change in my plots when using the weight parameter. Below is the code for the network plot where different values for the weight parameter are used. Even when using a column name that isn't present in my data produces a plot and does not error. When using 'leiden' as the display variable, no change in the communities formed were seen p2p_2020_2h %>% # my p2p network file name
network_p2p(hrvar = 'Group_DL', # my organisation variable name
display = "hrvar", # used 'hrvar' and 'leiden' as display variables
path = NULL,
return = "plot",
legend_pos = 'right',
algorithm = 'mds',
seed = 1,
res = 1,
weight = NULL) # changing this to 'StrongTieScore' or 'DiverseTieScore' yields not change in my plot |
Unfortunately you are correct @AaronArk - the |
Okay thanks @martinctc for the update. Do you know when this is likely to be rolled out? |
Hi @AaronArk - I can have a go and push a version to CRAN before Monday. Would you mind to give this version a test on your data? You can install with: devtools::install_git(url = "https://github.com/microsoft/wpa.git",
branch = "fix/weights-in-network_p2p") If you run the following, you should notice that the edges will be different: # Simulate data with different Strong and Diverse Tie Scores as weights
p2p_data <- p2p_data_sim() %>%
mutate(StrongTieScore = abs(rnorm(n = nrow(.)))) %>%
mutate(DiverseTieScore = abs(rnorm(n = nrow(.))))
g1 <-
p2p_data %>%
network_p2p(
display = "louvain",
weight = "StrongTieScore",
return = "network"
)
g2 <-
p2p_data %>%
network_p2p(
display = "louvain",
weight = "DiverseTieScore",
return = "network"
)
g1$weight
g2$weight However, it would be good to confirm that this also applies on the network visualization, and covers your use case. |
network_p2p()
does not affect output
Hi @martinctc. Yeah will try it today and let you know how it goes |
Describe the bug
When using network_p2p() to create a network plot and setting different values for the weight parameter, eg 'StrongTieScore' and 'DiverseTieScore', the plots produced are exactly the same. When using different community detection algorithms I expect different graphs to be produced has different weights should be used
To Reproduce
Steps to reproduce the behavior:
create a plot using network_p2p() and set weight = 'StrongTieScore' and 'DiverseTieScore' with display = 'leiden
Expected behavior
different plots should be produced with different clusters
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: