r110038 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r110037‎ | r110038 | r110039 >
Date:23:19, 25 January 2012
Author:rfaulk
Status:deferred
Tags:
Comment:
added cleanup and comments
Modified paths:
  • /trunk/tools/wsor/message_templates/R/huggle3_analysis.R (modified) (history)

Diff [purge]

Index: trunk/tools/wsor/message_templates/R/huggle3_analysis.R
@@ -6,14 +6,14 @@
77
88 # Read aggregated results for z64
99
10 -metrics_ec_z64 = read.table("/home/rfaulk/WSOR/message_templates/output/metrics_1018_1119_z64_editcounts.tsv", na.strings="\\N", sep="\t", comment.char="", quote="", header=T)
11 -metrics_blocks_z64 = read.table("/home/rfaulk/WSOR/message_templates/output/metrics_1018_1119_z64_blocks.tsv", na.strings="\\N", sep="\t", comment.char="", quote="", header=T)
 10+metrics_ec_z64 = read.table("/home/rfaulk/WSOR/message_templates/output/metrics_1018_1119_z70_editcounts.tsv", na.strings="\\N", sep="\t", comment.char="", quote="", header=T)
 11+metrics_blocks_z64 = read.table("/home/rfaulk/WSOR/message_templates/output/metrics_1018_1119_z70_blocks.tsv", na.strings="\\N", sep="\t", comment.char="", quote="", header=T)
1212
1313
1414 # Read aggregated results for z65
1515
16 -metrics_ec_z65 = read.table("/home/rfaulk/WSOR/message_templates/output/metrics_1018_1119_z65_editcounts.tsv", na.strings="\\N", sep="\t", comment.char="", quote="", header=T)
17 -metrics_blocks_z65 = read.table("/home/rfaulk/WSOR/message_templates/output/metrics_1018_1119_z65_blocks.tsv", na.strings="\\N", sep="\t", comment.char="", quote="", header=T)
 16+metrics_ec_z65 = read.table("/home/rfaulk/WSOR/message_templates/output/metrics_1018_1119_z71_editcounts.tsv", na.strings="\\N", sep="\t", comment.char="", quote="", header=T)
 17+metrics_blocks_z65 = read.table("/home/rfaulk/WSOR/message_templates/output/metrics_1018_1119_z71_blocks.tsv", na.strings="\\N", sep="\t", comment.char="", quote="", header=T)
1818
1919
2020 # Compute max edit counts
@@ -24,21 +24,18 @@
2525 max_ec_z65_ns_3 = max(append(metrics_ec_z65['ns_3_revisions_before'][[1]], metrics_ec_z65['ns_3_revisions_after'][[1]]))
2626
2727
28 -# Compute edit count vectors -- normalize values by the maximum, these are effectively representations of relative increase or decrease
29 -# of edit activity after the template has been placed
 28+# Compute the increase
3029
31 -z64_ns0 = (metrics_ec_z64['ns_0_revisions_before'][[1]] - metrics_ec_z64['ns_0_revisions_after'][[1]]) / metrics_ec_z64['ns_0_revisions_before'][[1]]
32 -z65_ns0 = (metrics_ec_z65['ns_0_revisions_before'][[1]] - metrics_ec_z65['ns_0_revisions_after'][[1]]) / metrics_ec_z65['ns_0_revisions_before'][[1]]
33 -# z64_ns3 = (metrics_ec_z64['ns_3_revisions_before'][[1]] - metrics_ec_z64['ns_3_revisions_after'][[1]]) / metrics_ec_z64['ns_3_revisions_before'][[1]]
34 -# z65_ns3 = (metrics_ec_z65['ns_3_revisions_before'][[1]] - metrics_ec_z65['ns_3_revisions_after'][[1]]) / metrics_ec_z65['ns_3_revisions_before'][[1]]
 30+z64_ns0 = (metrics_ec_z64$ns_0_revisions_after - metrics_ec_z64$ns_0_revisions_before) / metrics_ec_z64$ns_0_revisions_before
 31+z65_ns0 = (metrics_ec_z65$ns_0_revisions_after - metrics_ec_z65$ns_0_revisions_before / metrics_ec_z65$ns_0_revisions_before
3532
36 -# z64_ns0 <- c()
37 -# z65_ns0 <- c()
38 -z64_ns3 <- c()
39 -z65_ns3 <- c()
4033
 34+# User Talk namespace does not necessarily have edits before - in this case omit the result (it could be the case that templates stimulate user talk edits but that should be tested separately)
4135 # Only append non-zero results - do this for just namespace 3 since it has zero entries for 'ns_3_revisions_before'
4236
 37+z64_ns3 <- c()
 38+z65_ns3 <- c()
 39+
4340 for (i in 1:length(metrics_ec_z64['ns_3_revisions_before'][[1]]))
4441 if (metrics_ec_z64['ns_3_revisions_before'][[1]][i] != 0)
4542 z64_ns3 <- c(z64_ns3,

Status & tagging log