1
0

update to VE commit analysis

This commit is contained in:
Matthew Gaughan 2025-02-15 16:53:17 -08:00
parent df7be39071
commit f08f21a67e
9 changed files with 39 additions and 10 deletions

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 67 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

View File

@ -3,7 +3,7 @@ library(dplyr)
library(lubridate) library(lubridate)
library(tidyr) library(tidyr)
ve_commit_fp <- "/mmfs1/gscratch/comdata/users/mjilg/mw-repo-lifecycles/case1/visualeditor_commits.csv" ve_commit_fp <- "/mmfs1/gscratch/comdata/users/mjilg/mw-repo-lifecycles/case1/mediawiki_core_commits.csv"
transform_commit_data <- function(filepath){ transform_commit_data <- function(filepath){
#basic, loading in the file #basic, loading in the file
@ -131,8 +131,7 @@ transform_commit_data <- function(filepath){
test <- read.csv(ve_commit_fp, header = TRUE) test <- read.csv(ve_commit_fp, header = TRUE)
transformed <- transform_commit_data(ve_commit_fp) transformed <- transform_commit_data(ve_commit_fp)
output_filepath <-"/mmfs1/gscratch/comdata/users/mjilg/mw-repo-lifecycles/case1/announcement_0215_ve_weekly_commit_count_data.csv" output_filepath <-"/mmfs1/gscratch/comdata/users/mjilg/mw-repo-lifecycles/case1/announcement_0215_core_weekly_commit_count_data.csv"
project_id <- "test"
write.csv(transformed, output_filepath, row.names = FALSE) write.csv(transformed, output_filepath, row.names = FALSE)

View File

@ -4,18 +4,24 @@ input_df <- read.csv(count_data_fp, header = TRUE)
input_df$nonbot_commit_count <- input_df$commit_count - input_df$bot_commit_count input_df$nonbot_commit_count <- input_df$commit_count - input_df$bot_commit_count
window_num <- 19
input_df <- input_df |>
filter(relative_week >= (- window_num) & relative_week <= (window_num))
library(scales) library(scales)
library(ggplot2) library(ggplot2)
time_plot <- input_df |> time_plot <- input_df |>
ggplot(aes(x=relative_week, y=jenkins_commit_count)) + ggplot(aes(x=relative_week, y=wikimedia_commit_count)) +
labs(x="Weekly Offset", y="Gerrit/Jenkins Commit Count") + labs(x="Weekly Offset", y="Wikimedia Commit Count") +
geom_smooth() + geom_smooth() +
geom_vline(xintercept = 0)+ geom_vline(xintercept = 0)+
theme_bw() + theme_bw() +
theme(legend.position = "top") theme(legend.position = "top")
time_plot time_plot
library(dplyr)
share_df <- input_df |> share_df <- input_df |>
mutate(wikimedia_share = wikimedia_commit_count / nonbot_commit_count) |> mutate(wikimedia_share = wikimedia_commit_count / nonbot_commit_count) |>
mutate(wikia_share = wikia_commit_count / nonbot_commit_count) |> mutate(wikia_share = wikia_commit_count / nonbot_commit_count) |>
@ -25,7 +31,7 @@ share_df <- input_df |>
drop_na() drop_na()
share_long <- share_df |> share_long <- share_df |>
select(relative_week, wikimedia_share, wikia_share, gerrit_share, mw_dev_share, other_share) |> dplyr::select(relative_week, wikimedia_share, wikia_share, gerrit_share, mw_dev_share, other_share) |>
pivot_longer(cols = c(wikimedia_share, wikia_share, gerrit_share, mw_dev_share, other_share), names_to = "category", values_to = "share") pivot_longer(cols = c(wikimedia_share, wikia_share, gerrit_share, mw_dev_share, other_share), names_to = "category", values_to = "share")
share_plot <- share_long |> share_plot <- share_long |>
@ -33,7 +39,7 @@ share_plot <- share_long |>
geom_smooth() + geom_smooth() +
geom_vline(xintercept = 0)+ geom_vline(xintercept = 0)+
labs(x = "Relative Week", y = "Share of Nonbot Commit Count", color = "Affiliation") + labs(x = "Relative Week", y = "Share of Nonbot Commit Count", color = "Affiliation") +
ggtitle("Weekly Share of Nonbot Commit Count by Category") + ggtitle("Weekly Share of Nonbot Commit Count by Affiliation") +
theme_bw() + theme_bw() +
theme(legend.position = "top") theme(legend.position = "top")
share_plot share_plot

View File

@ -1,5 +1,5 @@
library(tidyverse) library(tidyverse)
count_data_fp <-"/mmfs1/gscratch/comdata/users/mjilg/mw-repo-lifecycles/case1/event_0215_ve_weekly_commit_count_data.csv" count_data_fp <-"/mmfs1/gscratch/comdata/users/mjilg/mw-repo-lifecycles/case1/event_0215_core_weekly_commit_count_data.csv"
input_df <- read.csv(count_data_fp, header = TRUE) input_df <- read.csv(count_data_fp, header = TRUE)
library(rdd) library(rdd)
@ -18,23 +18,29 @@ get_optimal_bandwidth <- function(df){
optimal_bandwidth <- get_optimal_bandwidth(input_df) optimal_bandwidth <- get_optimal_bandwidth(input_df)
window_num <- 19 window_num <- 13
input_df <- input_df |> input_df <- input_df |>
filter(relative_week >= (- window_num) & relative_week <= (window_num)) |> filter(relative_week >= (- window_num) & relative_week <= (window_num)) |>
mutate(other_commit_count = commit_count - bot_commit_count - mediawiki_dev_commit_count - wikia_commit_count - wikimedia_commit_count - jenkins_commit_count) mutate(other_commit_count = commit_count - bot_commit_count - mediawiki_dev_commit_count - wikia_commit_count - wikimedia_commit_count - jenkins_commit_count)
library(MASS)
simple_model <- glm.nb(commit_count~before_after*relative_week, data=input_df) simple_model <- glm.nb(commit_count~before_after*relative_week, data=input_df)
summary(simple_model) summary(simple_model)
library(lme4) library(lme4)
library(dplyr) library(dplyr)
#get into mlm format #get into mlm format
long_df <- input_df |> long_df <- input_df |>
pivot_longer(cols = c(other_commit_count, wikimedia_commit_count, jenkins_commit_count, wikia_commit_count, mediawiki_dev_commit_count), pivot_longer(cols = c(other_commit_count, wikimedia_commit_count, jenkins_commit_count, wikia_commit_count, mediawiki_dev_commit_count),
names_to = "commit_type", names_to = "commit_type",
values_to = "lengthened_commit_count") values_to = "lengthened_commit_count")
long_df <- long_df |>
mutate(commit_share = lengthened_commit_count / (commit_count - bot_commit_count)) |>
mutate(log_commits = log1p(lengthened_commit_count))
mlm <- glmer.nb(lengthened_commit_count ~ before_after*relative_week + (before_after*relative_week|commit_type), mlm <- glmer.nb(lengthened_commit_count ~ before_after*relative_week + (before_after*relative_week|commit_type),
control=glmerControl(optimizer="bobyqa", control=glmerControl(optimizer="bobyqa",
optCtrl=list(maxfun=2e5)), nAGQ=0, optCtrl=list(maxfun=2e5)), nAGQ=0,
@ -42,4 +48,4 @@ mlm <- glmer.nb(lengthened_commit_count ~ before_after*relative_week + (before_a
summary(mlm) summary(mlm)
ranefs <- ranef(mlm) ranefs <- ranef(mlm)
print(ranefs) print(ranefs)
saveRDS(mlm, "021525_ve_event_mlm.rda") saveRDS(mlm, "021525_core-ve_event_mlm.rda")

View File

@ -0,0 +1,18 @@
1. SSH tunnel from your workstation using the following command:
ssh -N -L 8787:n3439:56403 mjilg@klone.hyak.uw.edu
and point your web browser to http://localhost:8787
2. log in to RStudio Server using the following credentials:
user: mjilg
password: 8aREIl1dg0jceqBTNl9a
When done using RStudio Server, terminate the job by:
1. Exit the RStudio Session ("power" button in the top right corner of the RStudio window)
2. Issue the following command on the login node:
scancel -f 24263466
slurmstepd: error: *** JOB 24263466 ON n3439 CANCELLED AT 2025-02-15T16:52:54 ***