In [1]:
library(data.table)

In [2]:
## Using a table of article assessments and views, build tables
## (matrices) that shows the number of dissonant articles per
## assessment category based on sorting by popularity.
##
## The underlying assumption is that in an ideal system with a limited
## and fixed amount of resources (in other words, popularity and high quality
## artefacts does not increase the amount of resources in the system),
## popularity ranking and assessment class follow a 1-to-1 relationship.
## We can therefore sort by popularity and group articles that way
## because work will be prioritised by popularity.

## DATA ASSUMPTION: views_with_redirects from resolve-redirects.R
## is loaded into memory.

## 3: build a 2x2 matrix of assessment classes and popularity classes
## 

## Assessment classes in ascending order of quality.

In [3]:
assessment_classes = c('E', 'D', 'C', 'B', 'A');

In [4]:
quality_prediction_and_page_views <- read.table("../../results/sql_queries/entity_views_and_aggregated_revisions/entity_views_and_aggregated_revisions_and_quality_scoring_20170501.tsv", header=FALSE, sep="\t")

In [5]:
quality_prediction_and_page_views <- data.table(quality_prediction_and_page_views)

In [6]:
colnames(quality_prediction_and_page_views) <- c('entity_id','number_of_revisions', 'page_views', 'prediction')

In [7]:
summary(quality_prediction_and_page_views)


    entity_id        number_of_revisions   page_views        prediction  
 Q1      :       1   Min.   :    1.0     Min.   :0.000e+00   A:    3415  
 Q100    :       1   1st Qu.:    6.0     1st Qu.:1.300e+01   B:  481282  
 Q1000   :       1   Median :   13.0     Median :1.370e+02   C: 5305996  
 Q10000  :       1   Mean   :   17.9     Mean   :2.461e+04   D: 4372736  
 Q100000 :       1   3rd Qu.:   23.0     3rd Qu.:1.000e+03   E:11986341  
 Q1000000:       1   Max.   :21863.0     Max.   :1.253e+10               
 (Other) :22149764                                                       

In [8]:
## 0: calculate number of articles in each assessment class
n_per_class = quality_prediction_and_page_views[, list(narticles=sum(.N)), by='prediction']

In [9]:
setkey(n_per_class, prediction);
## NOTE: setkey allows us to do n_per_class['GA']$narticles to get counts

In [10]:
## 1: order articles by popularity
articles_by_pop = quality_prediction_and_page_views[order(quality_prediction_and_page_views$page_views)][,list(entity_id, prediction, page_views)];

In [11]:
## 2: assign popularity assessment class based on rank
##   (buckets based on number of articles in each class)
articles_by_pop[, pop_class := ''];
articles_by_pop[, seqNum := seq_len(nrow(articles_by_pop))];


entity_idpredictionpage_viewspop_class
Q10040378E 0
Q10069140C 0
Q10081695C 0
Q10092002E 0
Q10111267E 0
Q10149726E 0
Q10180230E 0
Q10185035E 0
Q10205202E 0
Q10252966E 0
Q10444494C 0
Q10624171C 0
Q10704108C 0
Q10750354C 0
Q10766855D 0
Q10827611E 0
Q11093044E 0
Q11934537E 0
Q12133466E 0
Q12264503E 0
Q12267516E 0
Q12304084E 0
Q12443525D 0
Q12543904E 0
Q12890205E 0
Q12891524E 0
Q12918202E 0
Q13005653E 0
Q13073896E 0
Q13163823E 0
Q1048694 C 2048095025
Q31165 B 2048330818
Q40629 C 2049755644
Q105584 C 2049926923
Q4584301 C 2052339927
Q565 C 2052996261
Q1868372 C 2056080224
Q209330 C 2060928966
Q14005 D 2063120071
Q918 A 2063217449
Q150248 C 2068796814
Q866 A 2079749157
Q477675 C 2080785713
Q1967876 C 2084215818
Q750403 B 2084693498
Q355 C 2093900731
Q623578 C 2097991400
Q17299517 D 2105487660
Q33999 C 2108672678
Q2494649 C 2114531894
Q2597810 C 2128920607
Q193563 C 2130725560
Q423048 C 2136131564
Q37312 C 2142913121
Q54919 C 2148531382
Q36578 B 2229315598
Q30 A 2277746226
Q6581097 D 3273952711
Q5 C 5668008721
Q5296 C 12530369761
entity_idpredictionpage_viewspop_classseqNum
Q10040378E 0 1
Q10069140C 0 2
Q10081695C 0 3
Q10092002E 0 4
Q10111267E 0 5
Q10149726E 0 6
Q10180230E 0 7
Q10185035E 0 8
Q10205202E 0 9
Q10252966E 0 10
Q10444494C 0 11
Q10624171C 0 12
Q10704108C 0 13
Q10750354C 0 14
Q10766855D 0 15
Q10827611E 0 16
Q11093044E 0 17
Q11934537E 0 18
Q12133466E 0 19
Q12264503E 0 20
Q12267516E 0 21
Q12304084E 0 22
Q12443525D 0 23
Q12543904E 0 24
Q12890205E 0 25
Q12891524E 0 26
Q12918202E 0 27
Q13005653E 0 28
Q13073896E 0 29
Q13163823E 0 30
Q1048694 C 2048095025 22149741
Q31165 B 2048330818 22149742
Q40629 C 2049755644 22149743
Q105584 C 2049926923 22149744
Q4584301 C 2052339927 22149745
Q565 C 2052996261 22149746
Q1868372 C 2056080224 22149747
Q209330 C 2060928966 22149748
Q14005 D 2063120071 22149749
Q918 A 2063217449 22149750
Q150248 C 2068796814 22149751
Q866 A 2079749157 22149752
Q477675 C 2080785713 22149753
Q1967876 C 2084215818 22149754
Q750403 B 2084693498 22149755
Q355 C 2093900731 22149756
Q623578 C 2097991400 22149757
Q17299517 D 2105487660 22149758
Q33999 C 2108672678 22149759
Q2494649 C 2114531894 22149760
Q2597810 C 2128920607 22149761
Q193563 C 2130725560 22149762
Q423048 C 2136131564 22149763
Q37312 C 2142913121 22149764
Q54919 C 2148531382 22149765
Q36578 B 2229315598 22149766
Q30 A 2277746226 22149767
Q6581097 D 3273952711 22149768
Q5 C 5668008721 22149769
Q5296 C 12530369761 22149770

In [12]:
assign_pop_class = function(dataset, classes, class_n) {
  ## Based on the per-class number of articles in class_n
  ## assign popularity based on classes to dataset.
  prev_idx = 0;
  for(rating in classes) {
    start_idx = prev_idx + 1;
    end_idx = start_idx + class_n[prediction == rating]$narticles;
    print(paste('start_idx =', start_idx, ', end_idx = ', end_idx));
    dataset[seqNum >= start_idx & seqNum <= end_idx, pop_class := rating];
    prev_idx = end_idx -1;
  }
  dataset;
}

In [13]:
articles_by_pop = assign_pop_class(articles_by_pop,
  assessment_classes, n_per_class);


[1] "start_idx = 1 , end_idx =  11986342"
[1] "start_idx = 11986342 , end_idx =  16359078"
[1] "start_idx = 16359078 , end_idx =  21665074"
[1] "start_idx = 21665074 , end_idx =  22146356"
[1] "start_idx = 22146356 , end_idx =  22149771"

In [14]:
create_dissonance_matrix = function(articledata, classes) {
  d_mtrx = matrix(0, nrow=length(classes), ncol=length(classes));
  rownames(d_mtrx) = classes;
  colnames(d_mtrx) = classes;

  for(real_rating in classes) {
    for(pop_rating in classes) {
      d_mtrx[real_rating, pop_rating] = length(articledata[prediction == real_rating & pop_class == pop_rating]$entity_id);
    }
  }
  d_mtrx;
}

In [15]:
## Based on direct hits to articles:
create_dissonance_matrix(articles_by_pop, assessment_classes)


EDCBA
E716177522717952454527 98179 65
D2355762 945230 986518 84893 333
C230553110821371677701238797 1830
B 163273 73574 187091 56657 687
A 0 0 159 2756 500

In [16]:
dissonance_matrix = create_dissonance_matrix(articles_by_pop,
  assessment_classes);

In [17]:
# Total misaligned entities
(dissonance_matrix[1,1]+dissonance_matrix[2,2]+dissonance_matrix[3,3]+dissonance_matrix[4,4]+dissonance_matrix[5,5])/sum(dissonance_matrix[,])


0.444332514513695

In [18]:
# A class quality and A class views over A class quality
dissonance_matrix[5,5]/sum(dissonance_matrix[5,])


0.146412884333821

In [19]:
# A class quality and E and D class views over A class quality
(dissonance_matrix[5,1]+dissonance_matrix[5,2])/sum(dissonance_matrix[5,])


0

In [20]:
# A class quality and < A class views
(dissonance_matrix[5,1]+dissonance_matrix[5,2]+dissonance_matrix[5,3]+dissonance_matrix[5,4])/sum(dissonance_matrix[5,])


0.853587115666179

In [21]:
# < A class quality and A class views
(dissonance_matrix[1,5]+dissonance_matrix[2,5]+dissonance_matrix[3,5]+dissonance_matrix[4,5])/sum(dissonance_matrix[,5])


0.853587115666179

In [22]:
prediction_e_pop_class_a <- merge(articles_by_pop[prediction == 'E' & pop_class == 'A'],quality_prediction_and_page_views, by='entity_id')[, c("entity_id","page_views.x", "number_of_revisions")]

In [23]:
head(prediction_e_pop_class_a)


entity_idpage_views.xnumber_of_revisions
Q1137381 11774181 10
Q1190342410603518 102
Q1329615 36240870 25
Q1450568 17053817 41
Q1470579511526245 12
Q1595864224686117 54

In [24]:
## Q: why do I get _two_ pageid columns?  Solution is to do the selection
## on the joined table, not as a select _in_ the join.

## Dissonance matrix proportions by row (..., 1) and column (..., 2)
## rounded to 1 decimal places.

In [25]:
round(100*prop.table(dissonance_matrix, 1), 1);


EDCBA
E59.719.020.5 0.8 0.0
D53.921.622.6 1.9 0.0
C43.520.431.6 4.5 0.0
B33.915.338.911.8 0.1
A 0.0 0.0 4.780.714.6

In [26]:
round(100*prop.table(dissonance_matrix, 2), 1);


EDCBA
E59.752.046.320.4 1.9
D19.721.618.617.6 9.8
C19.224.731.649.653.6
B 1.4 1.7 3.511.820.1
A 0.0 0.0 0.0 0.614.6

In [27]:
## Let's write the stubs out to a file
write.table(merge(articles_by_pop[(prediction == 'E' | prediction == 'D' | prediction == 'C' | prediction == 'B') & pop_class == 'A'], quality_prediction_and_page_views, by='entity_id')[, c("entity_id","pop_class", "prediction.x")],
           '../../results/entity_categorization/201705_a_class_views_less_than_a_quality.tsv', row.names=FALSE, col.names=FALSE, quote=FALSE, sep='\t');
merge(articles_by_pop[(prediction == 'E' | prediction == 'D' | prediction == 'C' | prediction == 'B') & pop_class == 'A'], quality_prediction_and_page_views, by='entity_id')[, c("entity_id","pop_class", "prediction.x")]


entity_idpop_classprediction.x
Q100 A C
Q10000 A C
Q1001 A B
Q1001378A D
Q1002972A C
Q1005887A D
Q100995 A C
Q1011547A C
Q101609 A C
Q101797 A B
Q102124 A B
Q1022 A B
Q102427 A C
Q102642 A B
Q1028181A C
Q10285 A C
Q103157 A B
Q103204 A C
Q10329 A C
Q10333 A C
Q103360 A D
Q103495 A C
Q103569 A B
Q103578 A B
Q103618 A C
Q10379 A C
Q103824 A C
Q103916 A C
Q103939 A B
Q103946 A B
Q9585 A C
Q9592 A C
Q959790 A C
Q9616 A C
Q9617 A C
Q9640 A B
Q9648008A D
Q9649 A C
Q9671 A B
Q968159 A C
Q9684 A C
Q9685 A B
Q9687 A C
Q9696 A B
Q97 A C
Q970153 A C
Q9730 A C
Q9734 A C
Q974144 A C
Q9759 A C
Q976022 A C
Q9779 A C
Q9794 A C
Q981846 A C
Q9846779A C
Q987 A C
Q987080 A D
Q994 A C
Q9960 A B
Q999897 A E

In [28]:
write.table(merge(articles_by_pop[prediction == 'A' & (pop_class == 'B' | pop_class == 'C' | pop_class == 'D' | pop_class == 'E')], quality_prediction_and_page_views, by='entity_id')[, c("entity_id","pop_class", "prediction.x")],
           '../../results/entity_categorization/201705_a_class_quality_less_than_a_views.tsv', row.names=FALSE, col.names=FALSE, quote=FALSE, sep='\t');

In [29]:
write.table(merge(articles_by_pop[(prediction == 'A' & pop_class == 'A') | (prediction == 'B' & pop_class == 'B') | (prediction == 'C' & pop_class == 'C') | (prediction == 'D' & pop_class == 'D') | (prediction == 'E' & pop_class == 'E')], quality_prediction_and_page_views, by='entity_id')[, c("entity_id","pop_class", "prediction.x")],
           '../../results/entity_categorization/201705_aligned.tsv', row.names=FALSE, col.names=FALSE, quote=FALSE, sep='\t');

In [30]:
write.table(merge(articles_by_pop[(prediction == 'A' & pop_class != 'A') | (prediction == 'B' & pop_class != 'B') | (prediction == 'C' & pop_class != 'C') | (prediction == 'D' & pop_class != 'D') | (prediction == 'E' & pop_class != 'E')], quality_prediction_and_page_views, by='entity_id')[, c("entity_id","pop_class", "prediction.x")],
           '../../results/entity_categorization/201705_misaligned.tsv', row.names=FALSE, col.names=FALSE, quote=FALSE, sep='\t');

Dissonance Measures (was seperate file)


In [29]:
## Various ways of measuring dissonance.

## DATA ASSUMPTION: articles_by_pop from build-dissonance-table.R
## is loaded into memory.

## None/Moderate/High measure of dissonance

In [30]:
articles_by_pop[, pop_class := ordered(pop_class, assessment_classes)];


entity_idpredictionpage_viewspop_classseqNum
Q10040378E 0 E 1
Q10069140C 0 E 2
Q10081695C 0 E 3
Q10092002E 0 E 4
Q10111267E 0 E 5
Q10149726E 0 E 6
Q10180230E 0 E 7
Q10185035E 0 E 8
Q10205202E 0 E 9
Q10252966E 0 E 10
Q10444494C 0 E 11
Q10624171C 0 E 12
Q10704108C 0 E 13
Q10750354C 0 E 14
Q10766855D 0 E 15
Q10827611E 0 E 16
Q11093044E 0 E 17
Q11934537E 0 E 18
Q12133466E 0 E 19
Q12264503E 0 E 20
Q12267516E 0 E 21
Q12304084E 0 E 22
Q12443525D 0 E 23
Q12543904E 0 E 24
Q12890205E 0 E 25
Q12891524E 0 E 26
Q12918202E 0 E 27
Q13005653E 0 E 28
Q13073896E 0 E 29
Q13163823E 0 E 30
Q1048694 C 2048095025A 22149741
Q31165 B 2048330818A 22149742
Q40629 C 2049755644A 22149743
Q105584 C 2049926923A 22149744
Q4584301 C 2052339927A 22149745
Q565 C 2052996261A 22149746
Q1868372 C 2056080224A 22149747
Q209330 C 2060928966A 22149748
Q14005 D 2063120071A 22149749
Q918 A 2063217449A 22149750
Q150248 C 2068796814A 22149751
Q866 A 2079749157A 22149752
Q477675 C 2080785713A 22149753
Q1967876 C 2084215818A 22149754
Q750403 B 2084693498A 22149755
Q355 C 2093900731A 22149756
Q623578 C 2097991400A 22149757
Q17299517 D 2105487660A 22149758
Q33999 C 2108672678A 22149759
Q2494649 C 2114531894A 22149760
Q2597810 C 2128920607A 22149761
Q193563 C 2130725560A 22149762
Q423048 C 2136131564A 22149763
Q37312 C 2142913121A 22149764
Q54919 C 2148531382A 22149765
Q36578 B 2229315598A 22149766
Q30 A 2277746226A 22149767
Q6581097 D 3273952711A 22149768
Q5 C 5668008721A 22149769
Q5296 C 12530369761A 22149770

In [31]:
dissonance_metric = c('High negative', 'Moderate negative',
  'None', 'Moderate positive', 'High positive');

In [32]:
articles_by_pop[, dissonance := factor(NA, dissonance_metric)];


entity_idpredictionpage_viewspop_classseqNumdissonance
Q10040378E 0 E 1 NA
Q10069140C 0 E 2 NA
Q10081695C 0 E 3 NA
Q10092002E 0 E 4 NA
Q10111267E 0 E 5 NA
Q10149726E 0 E 6 NA
Q10180230E 0 E 7 NA
Q10185035E 0 E 8 NA
Q10205202E 0 E 9 NA
Q10252966E 0 E 10 NA
Q10444494C 0 E 11 NA
Q10624171C 0 E 12 NA
Q10704108C 0 E 13 NA
Q10750354C 0 E 14 NA
Q10766855D 0 E 15 NA
Q10827611E 0 E 16 NA
Q11093044E 0 E 17 NA
Q11934537E 0 E 18 NA
Q12133466E 0 E 19 NA
Q12264503E 0 E 20 NA
Q12267516E 0 E 21 NA
Q12304084E 0 E 22 NA
Q12443525D 0 E 23 NA
Q12543904E 0 E 24 NA
Q12890205E 0 E 25 NA
Q12891524E 0 E 26 NA
Q12918202E 0 E 27 NA
Q13005653E 0 E 28 NA
Q13073896E 0 E 29 NA
Q13163823E 0 E 30 NA
Q1048694 C 2048095025A 22149741 NA
Q31165 B 2048330818A 22149742 NA
Q40629 C 2049755644A 22149743 NA
Q105584 C 2049926923A 22149744 NA
Q4584301 C 2052339927A 22149745 NA
Q565 C 2052996261A 22149746 NA
Q1868372 C 2056080224A 22149747 NA
Q209330 C 2060928966A 22149748 NA
Q14005 D 2063120071A 22149749 NA
Q918 A 2063217449A 22149750 NA
Q150248 C 2068796814A 22149751 NA
Q866 A 2079749157A 22149752 NA
Q477675 C 2080785713A 22149753 NA
Q1967876 C 2084215818A 22149754 NA
Q750403 B 2084693498A 22149755 NA
Q355 C 2093900731A 22149756 NA
Q623578 C 2097991400A 22149757 NA
Q17299517 D 2105487660A 22149758 NA
Q33999 C 2108672678A 22149759 NA
Q2494649 C 2114531894A 22149760 NA
Q2597810 C 2128920607A 22149761 NA
Q193563 C 2130725560A 22149762 NA
Q423048 C 2136131564A 22149763 NA
Q37312 C 2142913121A 22149764 NA
Q54919 C 2148531382A 22149765 NA
Q36578 B 2229315598A 22149766 NA
Q30 A 2277746226A 22149767 NA
Q6581097 D 3273952711A 22149768 NA
Q5 C 5668008721A 22149769 NA
Q5296 C 12530369761A 22149770 NA

In [33]:
## NOTE: because pop_class is of class ordered, we can use
##       expressions like "pop_class < 'C'" as expected

In [34]:
## A: None if A, Moderate if A, High elsewhere
articles_by_pop[prediction == 'A' & pop_class <= 'C',
                dissonance := 'High negative'];
articles_by_pop[prediction == 'A' & pop_class == 'B',
                dissonance := 'Moderate negative'];
articles_by_pop[prediction == 'A' & pop_class == 'A',
                dissonance := 'None'];


entity_idpredictionpage_viewspop_classseqNumdissonance
Q10040378E 0 E 1 NA
Q10069140C 0 E 2 NA
Q10081695C 0 E 3 NA
Q10092002E 0 E 4 NA
Q10111267E 0 E 5 NA
Q10149726E 0 E 6 NA
Q10180230E 0 E 7 NA
Q10185035E 0 E 8 NA
Q10205202E 0 E 9 NA
Q10252966E 0 E 10 NA
Q10444494C 0 E 11 NA
Q10624171C 0 E 12 NA
Q10704108C 0 E 13 NA
Q10750354C 0 E 14 NA
Q10766855D 0 E 15 NA
Q10827611E 0 E 16 NA
Q11093044E 0 E 17 NA
Q11934537E 0 E 18 NA
Q12133466E 0 E 19 NA
Q12264503E 0 E 20 NA
Q12267516E 0 E 21 NA
Q12304084E 0 E 22 NA
Q12443525D 0 E 23 NA
Q12543904E 0 E 24 NA
Q12890205E 0 E 25 NA
Q12891524E 0 E 26 NA
Q12918202E 0 E 27 NA
Q13005653E 0 E 28 NA
Q13073896E 0 E 29 NA
Q13163823E 0 E 30 NA
Q1048694 C 2048095025A 22149741 NA
Q31165 B 2048330818A 22149742 NA
Q40629 C 2049755644A 22149743 NA
Q105584 C 2049926923A 22149744 NA
Q4584301 C 2052339927A 22149745 NA
Q565 C 2052996261A 22149746 NA
Q1868372 C 2056080224A 22149747 NA
Q209330 C 2060928966A 22149748 NA
Q14005 D 2063120071A 22149749 NA
Q918 A 2063217449A 22149750 NA
Q150248 C 2068796814A 22149751 NA
Q866 A 2079749157A 22149752 NA
Q477675 C 2080785713A 22149753 NA
Q1967876 C 2084215818A 22149754 NA
Q750403 B 2084693498A 22149755 NA
Q355 C 2093900731A 22149756 NA
Q623578 C 2097991400A 22149757 NA
Q17299517 D 2105487660A 22149758 NA
Q33999 C 2108672678A 22149759 NA
Q2494649 C 2114531894A 22149760 NA
Q2597810 C 2128920607A 22149761 NA
Q193563 C 2130725560A 22149762 NA
Q423048 C 2136131564A 22149763 NA
Q37312 C 2142913121A 22149764 NA
Q54919 C 2148531382A 22149765 NA
Q36578 B 2229315598A 22149766 NA
Q30 A 2277746226A 22149767 NA
Q6581097 D 3273952711A 22149768 NA
Q5 C 5668008721A 22149769 NA
Q5296 C 12530369761A 22149770 NA
entity_idpredictionpage_viewspop_classseqNumdissonance
Q10040378E 0 E 1 NA
Q10069140C 0 E 2 NA
Q10081695C 0 E 3 NA
Q10092002E 0 E 4 NA
Q10111267E 0 E 5 NA
Q10149726E 0 E 6 NA
Q10180230E 0 E 7 NA
Q10185035E 0 E 8 NA
Q10205202E 0 E 9 NA
Q10252966E 0 E 10 NA
Q10444494C 0 E 11 NA
Q10624171C 0 E 12 NA
Q10704108C 0 E 13 NA
Q10750354C 0 E 14 NA
Q10766855D 0 E 15 NA
Q10827611E 0 E 16 NA
Q11093044E 0 E 17 NA
Q11934537E 0 E 18 NA
Q12133466E 0 E 19 NA
Q12264503E 0 E 20 NA
Q12267516E 0 E 21 NA
Q12304084E 0 E 22 NA
Q12443525D 0 E 23 NA
Q12543904E 0 E 24 NA
Q12890205E 0 E 25 NA
Q12891524E 0 E 26 NA
Q12918202E 0 E 27 NA
Q13005653E 0 E 28 NA
Q13073896E 0 E 29 NA
Q13163823E 0 E 30 NA
Q1048694 C 2048095025A 22149741 NA
Q31165 B 2048330818A 22149742 NA
Q40629 C 2049755644A 22149743 NA
Q105584 C 2049926923A 22149744 NA
Q4584301 C 2052339927A 22149745 NA
Q565 C 2052996261A 22149746 NA
Q1868372 C 2056080224A 22149747 NA
Q209330 C 2060928966A 22149748 NA
Q14005 D 2063120071A 22149749 NA
Q918 A 2063217449A 22149750 NA
Q150248 C 2068796814A 22149751 NA
Q866 A 2079749157A 22149752 NA
Q477675 C 2080785713A 22149753 NA
Q1967876 C 2084215818A 22149754 NA
Q750403 B 2084693498A 22149755 NA
Q355 C 2093900731A 22149756 NA
Q623578 C 2097991400A 22149757 NA
Q17299517 D 2105487660A 22149758 NA
Q33999 C 2108672678A 22149759 NA
Q2494649 C 2114531894A 22149760 NA
Q2597810 C 2128920607A 22149761 NA
Q193563 C 2130725560A 22149762 NA
Q423048 C 2136131564A 22149763 NA
Q37312 C 2142913121A 22149764 NA
Q54919 C 2148531382A 22149765 NA
Q36578 B 2229315598A 22149766 NA
Q30 A 2277746226A 22149767 NA
Q6581097 D 3273952711A 22149768 NA
Q5 C 5668008721A 22149769 NA
Q5296 C 12530369761A 22149770 NA
entity_idpredictionpage_viewspop_classseqNumdissonance
Q10040378E 0 E 1 NA
Q10069140C 0 E 2 NA
Q10081695C 0 E 3 NA
Q10092002E 0 E 4 NA
Q10111267E 0 E 5 NA
Q10149726E 0 E 6 NA
Q10180230E 0 E 7 NA
Q10185035E 0 E 8 NA
Q10205202E 0 E 9 NA
Q10252966E 0 E 10 NA
Q10444494C 0 E 11 NA
Q10624171C 0 E 12 NA
Q10704108C 0 E 13 NA
Q10750354C 0 E 14 NA
Q10766855D 0 E 15 NA
Q10827611E 0 E 16 NA
Q11093044E 0 E 17 NA
Q11934537E 0 E 18 NA
Q12133466E 0 E 19 NA
Q12264503E 0 E 20 NA
Q12267516E 0 E 21 NA
Q12304084E 0 E 22 NA
Q12443525D 0 E 23 NA
Q12543904E 0 E 24 NA
Q12890205E 0 E 25 NA
Q12891524E 0 E 26 NA
Q12918202E 0 E 27 NA
Q13005653E 0 E 28 NA
Q13073896E 0 E 29 NA
Q13163823E 0 E 30 NA
Q1048694 C 2048095025A 22149741 NA
Q31165 B 2048330818A 22149742 NA
Q40629 C 2049755644A 22149743 NA
Q105584 C 2049926923A 22149744 NA
Q4584301 C 2052339927A 22149745 NA
Q565 C 2052996261A 22149746 NA
Q1868372 C 2056080224A 22149747 NA
Q209330 C 2060928966A 22149748 NA
Q14005 D 2063120071A 22149749 NA
Q918 A 2063217449A 22149750 None
Q150248 C 2068796814A 22149751 NA
Q866 A 2079749157A 22149752 None
Q477675 C 2080785713A 22149753 NA
Q1967876 C 2084215818A 22149754 NA
Q750403 B 2084693498A 22149755 NA
Q355 C 2093900731A 22149756 NA
Q623578 C 2097991400A 22149757 NA
Q17299517 D 2105487660A 22149758 NA
Q33999 C 2108672678A 22149759 NA
Q2494649 C 2114531894A 22149760 NA
Q2597810 C 2128920607A 22149761 NA
Q193563 C 2130725560A 22149762 NA
Q423048 C 2136131564A 22149763 NA
Q37312 C 2142913121A 22149764 NA
Q54919 C 2148531382A 22149765 NA
Q36578 B 2229315598A 22149766 NA
Q30 A 2277746226A 22149767 None
Q6581097 D 3273952711A 22149768 NA
Q5 C 5668008721A 22149769 NA
Q5296 C 12530369761A 22149770 NA

In [35]:
## B: 
articles_by_pop[prediction == 'B' & pop_class <= 'D',
                dissonance := 'High negative'];
articles_by_pop[prediction == 'B' & pop_class == 'C',
                dissonance := 'Moderate negative'];
articles_by_pop[prediction == 'B' & pop_class == 'B',
                dissonance := 'None'];
articles_by_pop[prediction == 'B' & pop_class == 'A',
                dissonance := 'Moderate positive'];


entity_idpredictionpage_viewspop_classseqNumdissonance
Q10040378E 0 E 1 NA
Q10069140C 0 E 2 NA
Q10081695C 0 E 3 NA
Q10092002E 0 E 4 NA
Q10111267E 0 E 5 NA
Q10149726E 0 E 6 NA
Q10180230E 0 E 7 NA
Q10185035E 0 E 8 NA
Q10205202E 0 E 9 NA
Q10252966E 0 E 10 NA
Q10444494C 0 E 11 NA
Q10624171C 0 E 12 NA
Q10704108C 0 E 13 NA
Q10750354C 0 E 14 NA
Q10766855D 0 E 15 NA
Q10827611E 0 E 16 NA
Q11093044E 0 E 17 NA
Q11934537E 0 E 18 NA
Q12133466E 0 E 19 NA
Q12264503E 0 E 20 NA
Q12267516E 0 E 21 NA
Q12304084E 0 E 22 NA
Q12443525D 0 E 23 NA
Q12543904E 0 E 24 NA
Q12890205E 0 E 25 NA
Q12891524E 0 E 26 NA
Q12918202E 0 E 27 NA
Q13005653E 0 E 28 NA
Q13073896E 0 E 29 NA
Q13163823E 0 E 30 NA
Q1048694 C 2048095025A 22149741 NA
Q31165 B 2048330818A 22149742 NA
Q40629 C 2049755644A 22149743 NA
Q105584 C 2049926923A 22149744 NA
Q4584301 C 2052339927A 22149745 NA
Q565 C 2052996261A 22149746 NA
Q1868372 C 2056080224A 22149747 NA
Q209330 C 2060928966A 22149748 NA
Q14005 D 2063120071A 22149749 NA
Q918 A 2063217449A 22149750 None
Q150248 C 2068796814A 22149751 NA
Q866 A 2079749157A 22149752 None
Q477675 C 2080785713A 22149753 NA
Q1967876 C 2084215818A 22149754 NA
Q750403 B 2084693498A 22149755 NA
Q355 C 2093900731A 22149756 NA
Q623578 C 2097991400A 22149757 NA
Q17299517 D 2105487660A 22149758 NA
Q33999 C 2108672678A 22149759 NA
Q2494649 C 2114531894A 22149760 NA
Q2597810 C 2128920607A 22149761 NA
Q193563 C 2130725560A 22149762 NA
Q423048 C 2136131564A 22149763 NA
Q37312 C 2142913121A 22149764 NA
Q54919 C 2148531382A 22149765 NA
Q36578 B 2229315598A 22149766 NA
Q30 A 2277746226A 22149767 None
Q6581097 D 3273952711A 22149768 NA
Q5 C 5668008721A 22149769 NA
Q5296 C 12530369761A 22149770 NA
entity_idpredictionpage_viewspop_classseqNumdissonance
Q10040378E 0 E 1 NA
Q10069140C 0 E 2 NA
Q10081695C 0 E 3 NA
Q10092002E 0 E 4 NA
Q10111267E 0 E 5 NA
Q10149726E 0 E 6 NA
Q10180230E 0 E 7 NA
Q10185035E 0 E 8 NA
Q10205202E 0 E 9 NA
Q10252966E 0 E 10 NA
Q10444494C 0 E 11 NA
Q10624171C 0 E 12 NA
Q10704108C 0 E 13 NA
Q10750354C 0 E 14 NA
Q10766855D 0 E 15 NA
Q10827611E 0 E 16 NA
Q11093044E 0 E 17 NA
Q11934537E 0 E 18 NA
Q12133466E 0 E 19 NA
Q12264503E 0 E 20 NA
Q12267516E 0 E 21 NA
Q12304084E 0 E 22 NA
Q12443525D 0 E 23 NA
Q12543904E 0 E 24 NA
Q12890205E 0 E 25 NA
Q12891524E 0 E 26 NA
Q12918202E 0 E 27 NA
Q13005653E 0 E 28 NA
Q13073896E 0 E 29 NA
Q13163823E 0 E 30 NA
Q1048694 C 2048095025A 22149741 NA
Q31165 B 2048330818A 22149742 NA
Q40629 C 2049755644A 22149743 NA
Q105584 C 2049926923A 22149744 NA
Q4584301 C 2052339927A 22149745 NA
Q565 C 2052996261A 22149746 NA
Q1868372 C 2056080224A 22149747 NA
Q209330 C 2060928966A 22149748 NA
Q14005 D 2063120071A 22149749 NA
Q918 A 2063217449A 22149750 None
Q150248 C 2068796814A 22149751 NA
Q866 A 2079749157A 22149752 None
Q477675 C 2080785713A 22149753 NA
Q1967876 C 2084215818A 22149754 NA
Q750403 B 2084693498A 22149755 NA
Q355 C 2093900731A 22149756 NA
Q623578 C 2097991400A 22149757 NA
Q17299517 D 2105487660A 22149758 NA
Q33999 C 2108672678A 22149759 NA
Q2494649 C 2114531894A 22149760 NA
Q2597810 C 2128920607A 22149761 NA
Q193563 C 2130725560A 22149762 NA
Q423048 C 2136131564A 22149763 NA
Q37312 C 2142913121A 22149764 NA
Q54919 C 2148531382A 22149765 NA
Q36578 B 2229315598A 22149766 NA
Q30 A 2277746226A 22149767 None
Q6581097 D 3273952711A 22149768 NA
Q5 C 5668008721A 22149769 NA
Q5296 C 12530369761A 22149770 NA
entity_idpredictionpage_viewspop_classseqNumdissonance
Q10040378E 0 E 1 NA
Q10069140C 0 E 2 NA
Q10081695C 0 E 3 NA
Q10092002E 0 E 4 NA
Q10111267E 0 E 5 NA
Q10149726E 0 E 6 NA
Q10180230E 0 E 7 NA
Q10185035E 0 E 8 NA
Q10205202E 0 E 9 NA
Q10252966E 0 E 10 NA
Q10444494C 0 E 11 NA
Q10624171C 0 E 12 NA
Q10704108C 0 E 13 NA
Q10750354C 0 E 14 NA
Q10766855D 0 E 15 NA
Q10827611E 0 E 16 NA
Q11093044E 0 E 17 NA
Q11934537E 0 E 18 NA
Q12133466E 0 E 19 NA
Q12264503E 0 E 20 NA
Q12267516E 0 E 21 NA
Q12304084E 0 E 22 NA
Q12443525D 0 E 23 NA
Q12543904E 0 E 24 NA
Q12890205E 0 E 25 NA
Q12891524E 0 E 26 NA
Q12918202E 0 E 27 NA
Q13005653E 0 E 28 NA
Q13073896E 0 E 29 NA
Q13163823E 0 E 30 NA
Q1048694 C 2048095025A 22149741 NA
Q31165 B 2048330818A 22149742 NA
Q40629 C 2049755644A 22149743 NA
Q105584 C 2049926923A 22149744 NA
Q4584301 C 2052339927A 22149745 NA
Q565 C 2052996261A 22149746 NA
Q1868372 C 2056080224A 22149747 NA
Q209330 C 2060928966A 22149748 NA
Q14005 D 2063120071A 22149749 NA
Q918 A 2063217449A 22149750 None
Q150248 C 2068796814A 22149751 NA
Q866 A 2079749157A 22149752 None
Q477675 C 2080785713A 22149753 NA
Q1967876 C 2084215818A 22149754 NA
Q750403 B 2084693498A 22149755 NA
Q355 C 2093900731A 22149756 NA
Q623578 C 2097991400A 22149757 NA
Q17299517 D 2105487660A 22149758 NA
Q33999 C 2108672678A 22149759 NA
Q2494649 C 2114531894A 22149760 NA
Q2597810 C 2128920607A 22149761 NA
Q193563 C 2130725560A 22149762 NA
Q423048 C 2136131564A 22149763 NA
Q37312 C 2142913121A 22149764 NA
Q54919 C 2148531382A 22149765 NA
Q36578 B 2229315598A 22149766 NA
Q30 A 2277746226A 22149767 None
Q6581097 D 3273952711A 22149768 NA
Q5 C 5668008721A 22149769 NA
Q5296 C 12530369761A 22149770 NA
entity_idpredictionpage_viewspop_classseqNumdissonance
Q10040378E 0 E 1 NA
Q10069140C 0 E 2 NA
Q10081695C 0 E 3 NA
Q10092002E 0 E 4 NA
Q10111267E 0 E 5 NA
Q10149726E 0 E 6 NA
Q10180230E 0 E 7 NA
Q10185035E 0 E 8 NA
Q10205202E 0 E 9 NA
Q10252966E 0 E 10 NA
Q10444494C 0 E 11 NA
Q10624171C 0 E 12 NA
Q10704108C 0 E 13 NA
Q10750354C 0 E 14 NA
Q10766855D 0 E 15 NA
Q10827611E 0 E 16 NA
Q11093044E 0 E 17 NA
Q11934537E 0 E 18 NA
Q12133466E 0 E 19 NA
Q12264503E 0 E 20 NA
Q12267516E 0 E 21 NA
Q12304084E 0 E 22 NA
Q12443525D 0 E 23 NA
Q12543904E 0 E 24 NA
Q12890205E 0 E 25 NA
Q12891524E 0 E 26 NA
Q12918202E 0 E 27 NA
Q13005653E 0 E 28 NA
Q13073896E 0 E 29 NA
Q13163823E 0 E 30 NA
Q1048694 C 2048095025 A 22149741 NA
Q31165 B 2048330818 A 22149742 Moderate positive
Q40629 C 2049755644 A 22149743 NA
Q105584 C 2049926923 A 22149744 NA
Q4584301 C 2052339927 A 22149745 NA
Q565 C 2052996261 A 22149746 NA
Q1868372 C 2056080224 A 22149747 NA
Q209330 C 2060928966 A 22149748 NA
Q14005 D 2063120071 A 22149749 NA
Q918 A 2063217449 A 22149750 None
Q150248 C 2068796814 A 22149751 NA
Q866 A 2079749157 A 22149752 None
Q477675 C 2080785713 A 22149753 NA
Q1967876 C 2084215818 A 22149754 NA
Q750403 B 2084693498 A 22149755 Moderate positive
Q355 C 2093900731 A 22149756 NA
Q623578 C 2097991400 A 22149757 NA
Q17299517 D 2105487660 A 22149758 NA
Q33999 C 2108672678 A 22149759 NA
Q2494649 C 2114531894 A 22149760 NA
Q2597810 C 2128920607 A 22149761 NA
Q193563 C 2130725560 A 22149762 NA
Q423048 C 2136131564 A 22149763 NA
Q37312 C 2142913121 A 22149764 NA
Q54919 C 2148531382 A 22149765 NA
Q36578 B 2229315598 A 22149766 Moderate positive
Q30 A 2277746226 A 22149767 None
Q6581097 D 3273952711 A 22149768 NA
Q5 C 5668008721 A 22149769 NA
Q5296 C 12530369761 A 22149770 NA

In [36]:
## C: 
articles_by_pop[prediction == 'C' & pop_class == 'E',
                dissonance := 'High negative'];
articles_by_pop[prediction == 'C' & pop_class == 'D',
                dissonance := 'Moderate negative'];
articles_by_pop[prediction == 'C' & pop_class == 'C',
                dissonance := 'None'];
articles_by_pop[prediction == 'C' & pop_class == 'B',
                dissonance := 'Moderate positive'];
articles_by_pop[prediction == 'C' & pop_class == 'A',
                dissonance := 'High positive'];


entity_idpredictionpage_viewspop_classseqNumdissonance
Q10040378 E 0 E 1 NA
Q10069140 C 0 E 2 High negative
Q10081695 C 0 E 3 High negative
Q10092002 E 0 E 4 NA
Q10111267 E 0 E 5 NA
Q10149726 E 0 E 6 NA
Q10180230 E 0 E 7 NA
Q10185035 E 0 E 8 NA
Q10205202 E 0 E 9 NA
Q10252966 E 0 E 10 NA
Q10444494 C 0 E 11 High negative
Q10624171 C 0 E 12 High negative
Q10704108 C 0 E 13 High negative
Q10750354 C 0 E 14 High negative
Q10766855 D 0 E 15 NA
Q10827611 E 0 E 16 NA
Q11093044 E 0 E 17 NA
Q11934537 E 0 E 18 NA
Q12133466 E 0 E 19 NA
Q12264503 E 0 E 20 NA
Q12267516 E 0 E 21 NA
Q12304084 E 0 E 22 NA
Q12443525 D 0 E 23 NA
Q12543904 E 0 E 24 NA
Q12890205 E 0 E 25 NA
Q12891524 E 0 E 26 NA
Q12918202 E 0 E 27 NA
Q13005653 E 0 E 28 NA
Q13073896 E 0 E 29 NA
Q13163823 E 0 E 30 NA
Q1048694 C 2048095025 A 22149741 NA
Q31165 B 2048330818 A 22149742 Moderate positive
Q40629 C 2049755644 A 22149743 NA
Q105584 C 2049926923 A 22149744 NA
Q4584301 C 2052339927 A 22149745 NA
Q565 C 2052996261 A 22149746 NA
Q1868372 C 2056080224 A 22149747 NA
Q209330 C 2060928966 A 22149748 NA
Q14005 D 2063120071 A 22149749 NA
Q918 A 2063217449 A 22149750 None
Q150248 C 2068796814 A 22149751 NA
Q866 A 2079749157 A 22149752 None
Q477675 C 2080785713 A 22149753 NA
Q1967876 C 2084215818 A 22149754 NA
Q750403 B 2084693498 A 22149755 Moderate positive
Q355 C 2093900731 A 22149756 NA
Q623578 C 2097991400 A 22149757 NA
Q17299517 D 2105487660 A 22149758 NA
Q33999 C 2108672678 A 22149759 NA
Q2494649 C 2114531894 A 22149760 NA
Q2597810 C 2128920607 A 22149761 NA
Q193563 C 2130725560 A 22149762 NA
Q423048 C 2136131564 A 22149763 NA
Q37312 C 2142913121 A 22149764 NA
Q54919 C 2148531382 A 22149765 NA
Q36578 B 2229315598 A 22149766 Moderate positive
Q30 A 2277746226 A 22149767 None
Q6581097 D 3273952711 A 22149768 NA
Q5 C 5668008721 A 22149769 NA
Q5296 C 12530369761 A 22149770 NA
entity_idpredictionpage_viewspop_classseqNumdissonance
Q10040378 E 0 E 1 NA
Q10069140 C 0 E 2 High negative
Q10081695 C 0 E 3 High negative
Q10092002 E 0 E 4 NA
Q10111267 E 0 E 5 NA
Q10149726 E 0 E 6 NA
Q10180230 E 0 E 7 NA
Q10185035 E 0 E 8 NA
Q10205202 E 0 E 9 NA
Q10252966 E 0 E 10 NA
Q10444494 C 0 E 11 High negative
Q10624171 C 0 E 12 High negative
Q10704108 C 0 E 13 High negative
Q10750354 C 0 E 14 High negative
Q10766855 D 0 E 15 NA
Q10827611 E 0 E 16 NA
Q11093044 E 0 E 17 NA
Q11934537 E 0 E 18 NA
Q12133466 E 0 E 19 NA
Q12264503 E 0 E 20 NA
Q12267516 E 0 E 21 NA
Q12304084 E 0 E 22 NA
Q12443525 D 0 E 23 NA
Q12543904 E 0 E 24 NA
Q12890205 E 0 E 25 NA
Q12891524 E 0 E 26 NA
Q12918202 E 0 E 27 NA
Q13005653 E 0 E 28 NA
Q13073896 E 0 E 29 NA
Q13163823 E 0 E 30 NA
Q1048694 C 2048095025 A 22149741 NA
Q31165 B 2048330818 A 22149742 Moderate positive
Q40629 C 2049755644 A 22149743 NA
Q105584 C 2049926923 A 22149744 NA
Q4584301 C 2052339927 A 22149745 NA
Q565 C 2052996261 A 22149746 NA
Q1868372 C 2056080224 A 22149747 NA
Q209330 C 2060928966 A 22149748 NA
Q14005 D 2063120071 A 22149749 NA
Q918 A 2063217449 A 22149750 None
Q150248 C 2068796814 A 22149751 NA
Q866 A 2079749157 A 22149752 None
Q477675 C 2080785713 A 22149753 NA
Q1967876 C 2084215818 A 22149754 NA
Q750403 B 2084693498 A 22149755 Moderate positive
Q355 C 2093900731 A 22149756 NA
Q623578 C 2097991400 A 22149757 NA
Q17299517 D 2105487660 A 22149758 NA
Q33999 C 2108672678 A 22149759 NA
Q2494649 C 2114531894 A 22149760 NA
Q2597810 C 2128920607 A 22149761 NA
Q193563 C 2130725560 A 22149762 NA
Q423048 C 2136131564 A 22149763 NA
Q37312 C 2142913121 A 22149764 NA
Q54919 C 2148531382 A 22149765 NA
Q36578 B 2229315598 A 22149766 Moderate positive
Q30 A 2277746226 A 22149767 None
Q6581097 D 3273952711 A 22149768 NA
Q5 C 5668008721 A 22149769 NA
Q5296 C 12530369761 A 22149770 NA
entity_idpredictionpage_viewspop_classseqNumdissonance
Q10040378 E 0 E 1 NA
Q10069140 C 0 E 2 High negative
Q10081695 C 0 E 3 High negative
Q10092002 E 0 E 4 NA
Q10111267 E 0 E 5 NA
Q10149726 E 0 E 6 NA
Q10180230 E 0 E 7 NA
Q10185035 E 0 E 8 NA
Q10205202 E 0 E 9 NA
Q10252966 E 0 E 10 NA
Q10444494 C 0 E 11 High negative
Q10624171 C 0 E 12 High negative
Q10704108 C 0 E 13 High negative
Q10750354 C 0 E 14 High negative
Q10766855 D 0 E 15 NA
Q10827611 E 0 E 16 NA
Q11093044 E 0 E 17 NA
Q11934537 E 0 E 18 NA
Q12133466 E 0 E 19 NA
Q12264503 E 0 E 20 NA
Q12267516 E 0 E 21 NA
Q12304084 E 0 E 22 NA
Q12443525 D 0 E 23 NA
Q12543904 E 0 E 24 NA
Q12890205 E 0 E 25 NA
Q12891524 E 0 E 26 NA
Q12918202 E 0 E 27 NA
Q13005653 E 0 E 28 NA
Q13073896 E 0 E 29 NA
Q13163823 E 0 E 30 NA
Q1048694 C 2048095025 A 22149741 NA
Q31165 B 2048330818 A 22149742 Moderate positive
Q40629 C 2049755644 A 22149743 NA
Q105584 C 2049926923 A 22149744 NA
Q4584301 C 2052339927 A 22149745 NA
Q565 C 2052996261 A 22149746 NA
Q1868372 C 2056080224 A 22149747 NA
Q209330 C 2060928966 A 22149748 NA
Q14005 D 2063120071 A 22149749 NA
Q918 A 2063217449 A 22149750 None
Q150248 C 2068796814 A 22149751 NA
Q866 A 2079749157 A 22149752 None
Q477675 C 2080785713 A 22149753 NA
Q1967876 C 2084215818 A 22149754 NA
Q750403 B 2084693498 A 22149755 Moderate positive
Q355 C 2093900731 A 22149756 NA
Q623578 C 2097991400 A 22149757 NA
Q17299517 D 2105487660 A 22149758 NA
Q33999 C 2108672678 A 22149759 NA
Q2494649 C 2114531894 A 22149760 NA
Q2597810 C 2128920607 A 22149761 NA
Q193563 C 2130725560 A 22149762 NA
Q423048 C 2136131564 A 22149763 NA
Q37312 C 2142913121 A 22149764 NA
Q54919 C 2148531382 A 22149765 NA
Q36578 B 2229315598 A 22149766 Moderate positive
Q30 A 2277746226 A 22149767 None
Q6581097 D 3273952711 A 22149768 NA
Q5 C 5668008721 A 22149769 NA
Q5296 C 12530369761 A 22149770 NA
entity_idpredictionpage_viewspop_classseqNumdissonance
Q10040378 E 0 E 1 NA
Q10069140 C 0 E 2 High negative
Q10081695 C 0 E 3 High negative
Q10092002 E 0 E 4 NA
Q10111267 E 0 E 5 NA
Q10149726 E 0 E 6 NA
Q10180230 E 0 E 7 NA
Q10185035 E 0 E 8 NA
Q10205202 E 0 E 9 NA
Q10252966 E 0 E 10 NA
Q10444494 C 0 E 11 High negative
Q10624171 C 0 E 12 High negative
Q10704108 C 0 E 13 High negative
Q10750354 C 0 E 14 High negative
Q10766855 D 0 E 15 NA
Q10827611 E 0 E 16 NA
Q11093044 E 0 E 17 NA
Q11934537 E 0 E 18 NA
Q12133466 E 0 E 19 NA
Q12264503 E 0 E 20 NA
Q12267516 E 0 E 21 NA
Q12304084 E 0 E 22 NA
Q12443525 D 0 E 23 NA
Q12543904 E 0 E 24 NA
Q12890205 E 0 E 25 NA
Q12891524 E 0 E 26 NA
Q12918202 E 0 E 27 NA
Q13005653 E 0 E 28 NA
Q13073896 E 0 E 29 NA
Q13163823 E 0 E 30 NA
Q1048694 C 2048095025 A 22149741 NA
Q31165 B 2048330818 A 22149742 Moderate positive
Q40629 C 2049755644 A 22149743 NA
Q105584 C 2049926923 A 22149744 NA
Q4584301 C 2052339927 A 22149745 NA
Q565 C 2052996261 A 22149746 NA
Q1868372 C 2056080224 A 22149747 NA
Q209330 C 2060928966 A 22149748 NA
Q14005 D 2063120071 A 22149749 NA
Q918 A 2063217449 A 22149750 None
Q150248 C 2068796814 A 22149751 NA
Q866 A 2079749157 A 22149752 None
Q477675 C 2080785713 A 22149753 NA
Q1967876 C 2084215818 A 22149754 NA
Q750403 B 2084693498 A 22149755 Moderate positive
Q355 C 2093900731 A 22149756 NA
Q623578 C 2097991400 A 22149757 NA
Q17299517 D 2105487660 A 22149758 NA
Q33999 C 2108672678 A 22149759 NA
Q2494649 C 2114531894 A 22149760 NA
Q2597810 C 2128920607 A 22149761 NA
Q193563 C 2130725560 A 22149762 NA
Q423048 C 2136131564 A 22149763 NA
Q37312 C 2142913121 A 22149764 NA
Q54919 C 2148531382 A 22149765 NA
Q36578 B 2229315598 A 22149766 Moderate positive
Q30 A 2277746226 A 22149767 None
Q6581097 D 3273952711 A 22149768 NA
Q5 C 5668008721 A 22149769 NA
Q5296 C 12530369761 A 22149770 NA
entity_idpredictionpage_viewspop_classseqNumdissonance
Q10040378 E 0 E 1 NA
Q10069140 C 0 E 2 High negative
Q10081695 C 0 E 3 High negative
Q10092002 E 0 E 4 NA
Q10111267 E 0 E 5 NA
Q10149726 E 0 E 6 NA
Q10180230 E 0 E 7 NA
Q10185035 E 0 E 8 NA
Q10205202 E 0 E 9 NA
Q10252966 E 0 E 10 NA
Q10444494 C 0 E 11 High negative
Q10624171 C 0 E 12 High negative
Q10704108 C 0 E 13 High negative
Q10750354 C 0 E 14 High negative
Q10766855 D 0 E 15 NA
Q10827611 E 0 E 16 NA
Q11093044 E 0 E 17 NA
Q11934537 E 0 E 18 NA
Q12133466 E 0 E 19 NA
Q12264503 E 0 E 20 NA
Q12267516 E 0 E 21 NA
Q12304084 E 0 E 22 NA
Q12443525 D 0 E 23 NA
Q12543904 E 0 E 24 NA
Q12890205 E 0 E 25 NA
Q12891524 E 0 E 26 NA
Q12918202 E 0 E 27 NA
Q13005653 E 0 E 28 NA
Q13073896 E 0 E 29 NA
Q13163823 E 0 E 30 NA
Q1048694 C 2048095025 A 22149741 High positive
Q31165 B 2048330818 A 22149742 Moderate positive
Q40629 C 2049755644 A 22149743 High positive
Q105584 C 2049926923 A 22149744 High positive
Q4584301 C 2052339927 A 22149745 High positive
Q565 C 2052996261 A 22149746 High positive
Q1868372 C 2056080224 A 22149747 High positive
Q209330 C 2060928966 A 22149748 High positive
Q14005 D 2063120071 A 22149749 NA
Q918 A 2063217449 A 22149750 None
Q150248 C 2068796814 A 22149751 High positive
Q866 A 2079749157 A 22149752 None
Q477675 C 2080785713 A 22149753 High positive
Q1967876 C 2084215818 A 22149754 High positive
Q750403 B 2084693498 A 22149755 Moderate positive
Q355 C 2093900731 A 22149756 High positive
Q623578 C 2097991400 A 22149757 High positive
Q17299517 D 2105487660 A 22149758 NA
Q33999 C 2108672678 A 22149759 High positive
Q2494649 C 2114531894 A 22149760 High positive
Q2597810 C 2128920607 A 22149761 High positive
Q193563 C 2130725560 A 22149762 High positive
Q423048 C 2136131564 A 22149763 High positive
Q37312 C 2142913121 A 22149764 High positive
Q54919 C 2148531382 A 22149765 High positive
Q36578 B 2229315598 A 22149766 Moderate positive
Q30 A 2277746226 A 22149767 None
Q6581097 D 3273952711 A 22149768 NA
Q5 C 5668008721 A 22149769 High positive
Q5296 C 12530369761 A 22149770 High positive

In [37]:
## D
articles_by_pop[prediction == 'D' & pop_class == 'E',
                dissonance := 'Moderate negative'];
articles_by_pop[prediction == 'D' & pop_class == 'D',
                dissonance := 'None'];
articles_by_pop[prediction == 'D' & pop_class == 'C',
                dissonance := 'Moderate positive'];
articles_by_pop[prediction == 'D' & pop_class >= 'B',
                dissonance := 'High positive'];


entity_idpredictionpage_viewspop_classseqNumdissonance
Q10040378 E 0 E 1 NA
Q10069140 C 0 E 2 High negative
Q10081695 C 0 E 3 High negative
Q10092002 E 0 E 4 NA
Q10111267 E 0 E 5 NA
Q10149726 E 0 E 6 NA
Q10180230 E 0 E 7 NA
Q10185035 E 0 E 8 NA
Q10205202 E 0 E 9 NA
Q10252966 E 0 E 10 NA
Q10444494 C 0 E 11 High negative
Q10624171 C 0 E 12 High negative
Q10704108 C 0 E 13 High negative
Q10750354 C 0 E 14 High negative
Q10766855 D 0 E 15 Moderate negative
Q10827611 E 0 E 16 NA
Q11093044 E 0 E 17 NA
Q11934537 E 0 E 18 NA
Q12133466 E 0 E 19 NA
Q12264503 E 0 E 20 NA
Q12267516 E 0 E 21 NA
Q12304084 E 0 E 22 NA
Q12443525 D 0 E 23 Moderate negative
Q12543904 E 0 E 24 NA
Q12890205 E 0 E 25 NA
Q12891524 E 0 E 26 NA
Q12918202 E 0 E 27 NA
Q13005653 E 0 E 28 NA
Q13073896 E 0 E 29 NA
Q13163823 E 0 E 30 NA
Q1048694 C 2048095025 A 22149741 High positive
Q31165 B 2048330818 A 22149742 Moderate positive
Q40629 C 2049755644 A 22149743 High positive
Q105584 C 2049926923 A 22149744 High positive
Q4584301 C 2052339927 A 22149745 High positive
Q565 C 2052996261 A 22149746 High positive
Q1868372 C 2056080224 A 22149747 High positive
Q209330 C 2060928966 A 22149748 High positive
Q14005 D 2063120071 A 22149749 NA
Q918 A 2063217449 A 22149750 None
Q150248 C 2068796814 A 22149751 High positive
Q866 A 2079749157 A 22149752 None
Q477675 C 2080785713 A 22149753 High positive
Q1967876 C 2084215818 A 22149754 High positive
Q750403 B 2084693498 A 22149755 Moderate positive
Q355 C 2093900731 A 22149756 High positive
Q623578 C 2097991400 A 22149757 High positive
Q17299517 D 2105487660 A 22149758 NA
Q33999 C 2108672678 A 22149759 High positive
Q2494649 C 2114531894 A 22149760 High positive
Q2597810 C 2128920607 A 22149761 High positive
Q193563 C 2130725560 A 22149762 High positive
Q423048 C 2136131564 A 22149763 High positive
Q37312 C 2142913121 A 22149764 High positive
Q54919 C 2148531382 A 22149765 High positive
Q36578 B 2229315598 A 22149766 Moderate positive
Q30 A 2277746226 A 22149767 None
Q6581097 D 3273952711 A 22149768 NA
Q5 C 5668008721 A 22149769 High positive
Q5296 C 12530369761 A 22149770 High positive
entity_idpredictionpage_viewspop_classseqNumdissonance
Q10040378 E 0 E 1 NA
Q10069140 C 0 E 2 High negative
Q10081695 C 0 E 3 High negative
Q10092002 E 0 E 4 NA
Q10111267 E 0 E 5 NA
Q10149726 E 0 E 6 NA
Q10180230 E 0 E 7 NA
Q10185035 E 0 E 8 NA
Q10205202 E 0 E 9 NA
Q10252966 E 0 E 10 NA
Q10444494 C 0 E 11 High negative
Q10624171 C 0 E 12 High negative
Q10704108 C 0 E 13 High negative
Q10750354 C 0 E 14 High negative
Q10766855 D 0 E 15 Moderate negative
Q10827611 E 0 E 16 NA
Q11093044 E 0 E 17 NA
Q11934537 E 0 E 18 NA
Q12133466 E 0 E 19 NA
Q12264503 E 0 E 20 NA
Q12267516 E 0 E 21 NA
Q12304084 E 0 E 22 NA
Q12443525 D 0 E 23 Moderate negative
Q12543904 E 0 E 24 NA
Q12890205 E 0 E 25 NA
Q12891524 E 0 E 26 NA
Q12918202 E 0 E 27 NA
Q13005653 E 0 E 28 NA
Q13073896 E 0 E 29 NA
Q13163823 E 0 E 30 NA
Q1048694 C 2048095025 A 22149741 High positive
Q31165 B 2048330818 A 22149742 Moderate positive
Q40629 C 2049755644 A 22149743 High positive
Q105584 C 2049926923 A 22149744 High positive
Q4584301 C 2052339927 A 22149745 High positive
Q565 C 2052996261 A 22149746 High positive
Q1868372 C 2056080224 A 22149747 High positive
Q209330 C 2060928966 A 22149748 High positive
Q14005 D 2063120071 A 22149749 NA
Q918 A 2063217449 A 22149750 None
Q150248 C 2068796814 A 22149751 High positive
Q866 A 2079749157 A 22149752 None
Q477675 C 2080785713 A 22149753 High positive
Q1967876 C 2084215818 A 22149754 High positive
Q750403 B 2084693498 A 22149755 Moderate positive
Q355 C 2093900731 A 22149756 High positive
Q623578 C 2097991400 A 22149757 High positive
Q17299517 D 2105487660 A 22149758 NA
Q33999 C 2108672678 A 22149759 High positive
Q2494649 C 2114531894 A 22149760 High positive
Q2597810 C 2128920607 A 22149761 High positive
Q193563 C 2130725560 A 22149762 High positive
Q423048 C 2136131564 A 22149763 High positive
Q37312 C 2142913121 A 22149764 High positive
Q54919 C 2148531382 A 22149765 High positive
Q36578 B 2229315598 A 22149766 Moderate positive
Q30 A 2277746226 A 22149767 None
Q6581097 D 3273952711 A 22149768 NA
Q5 C 5668008721 A 22149769 High positive
Q5296 C 12530369761 A 22149770 High positive
entity_idpredictionpage_viewspop_classseqNumdissonance
Q10040378 E 0 E 1 NA
Q10069140 C 0 E 2 High negative
Q10081695 C 0 E 3 High negative
Q10092002 E 0 E 4 NA
Q10111267 E 0 E 5 NA
Q10149726 E 0 E 6 NA
Q10180230 E 0 E 7 NA
Q10185035 E 0 E 8 NA
Q10205202 E 0 E 9 NA
Q10252966 E 0 E 10 NA
Q10444494 C 0 E 11 High negative
Q10624171 C 0 E 12 High negative
Q10704108 C 0 E 13 High negative
Q10750354 C 0 E 14 High negative
Q10766855 D 0 E 15 Moderate negative
Q10827611 E 0 E 16 NA
Q11093044 E 0 E 17 NA
Q11934537 E 0 E 18 NA
Q12133466 E 0 E 19 NA
Q12264503 E 0 E 20 NA
Q12267516 E 0 E 21 NA
Q12304084 E 0 E 22 NA
Q12443525 D 0 E 23 Moderate negative
Q12543904 E 0 E 24 NA
Q12890205 E 0 E 25 NA
Q12891524 E 0 E 26 NA
Q12918202 E 0 E 27 NA
Q13005653 E 0 E 28 NA
Q13073896 E 0 E 29 NA
Q13163823 E 0 E 30 NA
Q1048694 C 2048095025 A 22149741 High positive
Q31165 B 2048330818 A 22149742 Moderate positive
Q40629 C 2049755644 A 22149743 High positive
Q105584 C 2049926923 A 22149744 High positive
Q4584301 C 2052339927 A 22149745 High positive
Q565 C 2052996261 A 22149746 High positive
Q1868372 C 2056080224 A 22149747 High positive
Q209330 C 2060928966 A 22149748 High positive
Q14005 D 2063120071 A 22149749 NA
Q918 A 2063217449 A 22149750 None
Q150248 C 2068796814 A 22149751 High positive
Q866 A 2079749157 A 22149752 None
Q477675 C 2080785713 A 22149753 High positive
Q1967876 C 2084215818 A 22149754 High positive
Q750403 B 2084693498 A 22149755 Moderate positive
Q355 C 2093900731 A 22149756 High positive
Q623578 C 2097991400 A 22149757 High positive
Q17299517 D 2105487660 A 22149758 NA
Q33999 C 2108672678 A 22149759 High positive
Q2494649 C 2114531894 A 22149760 High positive
Q2597810 C 2128920607 A 22149761 High positive
Q193563 C 2130725560 A 22149762 High positive
Q423048 C 2136131564 A 22149763 High positive
Q37312 C 2142913121 A 22149764 High positive
Q54919 C 2148531382 A 22149765 High positive
Q36578 B 2229315598 A 22149766 Moderate positive
Q30 A 2277746226 A 22149767 None
Q6581097 D 3273952711 A 22149768 NA
Q5 C 5668008721 A 22149769 High positive
Q5296 C 12530369761 A 22149770 High positive
entity_idpredictionpage_viewspop_classseqNumdissonance
Q10040378 E 0 E 1 NA
Q10069140 C 0 E 2 High negative
Q10081695 C 0 E 3 High negative
Q10092002 E 0 E 4 NA
Q10111267 E 0 E 5 NA
Q10149726 E 0 E 6 NA
Q10180230 E 0 E 7 NA
Q10185035 E 0 E 8 NA
Q10205202 E 0 E 9 NA
Q10252966 E 0 E 10 NA
Q10444494 C 0 E 11 High negative
Q10624171 C 0 E 12 High negative
Q10704108 C 0 E 13 High negative
Q10750354 C 0 E 14 High negative
Q10766855 D 0 E 15 Moderate negative
Q10827611 E 0 E 16 NA
Q11093044 E 0 E 17 NA
Q11934537 E 0 E 18 NA
Q12133466 E 0 E 19 NA
Q12264503 E 0 E 20 NA
Q12267516 E 0 E 21 NA
Q12304084 E 0 E 22 NA
Q12443525 D 0 E 23 Moderate negative
Q12543904 E 0 E 24 NA
Q12890205 E 0 E 25 NA
Q12891524 E 0 E 26 NA
Q12918202 E 0 E 27 NA
Q13005653 E 0 E 28 NA
Q13073896 E 0 E 29 NA
Q13163823 E 0 E 30 NA
Q1048694 C 2048095025 A 22149741 High positive
Q31165 B 2048330818 A 22149742 Moderate positive
Q40629 C 2049755644 A 22149743 High positive
Q105584 C 2049926923 A 22149744 High positive
Q4584301 C 2052339927 A 22149745 High positive
Q565 C 2052996261 A 22149746 High positive
Q1868372 C 2056080224 A 22149747 High positive
Q209330 C 2060928966 A 22149748 High positive
Q14005 D 2063120071 A 22149749 High positive
Q918 A 2063217449 A 22149750 None
Q150248 C 2068796814 A 22149751 High positive
Q866 A 2079749157 A 22149752 None
Q477675 C 2080785713 A 22149753 High positive
Q1967876 C 2084215818 A 22149754 High positive
Q750403 B 2084693498 A 22149755 Moderate positive
Q355 C 2093900731 A 22149756 High positive
Q623578 C 2097991400 A 22149757 High positive
Q17299517 D 2105487660 A 22149758 High positive
Q33999 C 2108672678 A 22149759 High positive
Q2494649 C 2114531894 A 22149760 High positive
Q2597810 C 2128920607 A 22149761 High positive
Q193563 C 2130725560 A 22149762 High positive
Q423048 C 2136131564 A 22149763 High positive
Q37312 C 2142913121 A 22149764 High positive
Q54919 C 2148531382 A 22149765 High positive
Q36578 B 2229315598 A 22149766 Moderate positive
Q30 A 2277746226 A 22149767 None
Q6581097 D 3273952711 A 22149768 High positive
Q5 C 5668008721 A 22149769 High positive
Q5296 C 12530369761 A 22149770 High positive

In [38]:
## E
articles_by_pop[prediction == 'E' & pop_class == 'E',
                dissonance := 'None'];
articles_by_pop[prediction == 'E' & pop_class == 'D',
                dissonance := 'Moderate positive'];
articles_by_pop[prediction == 'E' & pop_class >= 'C',
                dissonance := 'High positive'];


entity_idpredictionpage_viewspop_classseqNumdissonance
Q10040378 E 0 E 1 None
Q10069140 C 0 E 2 High negative
Q10081695 C 0 E 3 High negative
Q10092002 E 0 E 4 None
Q10111267 E 0 E 5 None
Q10149726 E 0 E 6 None
Q10180230 E 0 E 7 None
Q10185035 E 0 E 8 None
Q10205202 E 0 E 9 None
Q10252966 E 0 E 10 None
Q10444494 C 0 E 11 High negative
Q10624171 C 0 E 12 High negative
Q10704108 C 0 E 13 High negative
Q10750354 C 0 E 14 High negative
Q10766855 D 0 E 15 Moderate negative
Q10827611 E 0 E 16 None
Q11093044 E 0 E 17 None
Q11934537 E 0 E 18 None
Q12133466 E 0 E 19 None
Q12264503 E 0 E 20 None
Q12267516 E 0 E 21 None
Q12304084 E 0 E 22 None
Q12443525 D 0 E 23 Moderate negative
Q12543904 E 0 E 24 None
Q12890205 E 0 E 25 None
Q12891524 E 0 E 26 None
Q12918202 E 0 E 27 None
Q13005653 E 0 E 28 None
Q13073896 E 0 E 29 None
Q13163823 E 0 E 30 None
Q1048694 C 2048095025 A 22149741 High positive
Q31165 B 2048330818 A 22149742 Moderate positive
Q40629 C 2049755644 A 22149743 High positive
Q105584 C 2049926923 A 22149744 High positive
Q4584301 C 2052339927 A 22149745 High positive
Q565 C 2052996261 A 22149746 High positive
Q1868372 C 2056080224 A 22149747 High positive
Q209330 C 2060928966 A 22149748 High positive
Q14005 D 2063120071 A 22149749 High positive
Q918 A 2063217449 A 22149750 None
Q150248 C 2068796814 A 22149751 High positive
Q866 A 2079749157 A 22149752 None
Q477675 C 2080785713 A 22149753 High positive
Q1967876 C 2084215818 A 22149754 High positive
Q750403 B 2084693498 A 22149755 Moderate positive
Q355 C 2093900731 A 22149756 High positive
Q623578 C 2097991400 A 22149757 High positive
Q17299517 D 2105487660 A 22149758 High positive
Q33999 C 2108672678 A 22149759 High positive
Q2494649 C 2114531894 A 22149760 High positive
Q2597810 C 2128920607 A 22149761 High positive
Q193563 C 2130725560 A 22149762 High positive
Q423048 C 2136131564 A 22149763 High positive
Q37312 C 2142913121 A 22149764 High positive
Q54919 C 2148531382 A 22149765 High positive
Q36578 B 2229315598 A 22149766 Moderate positive
Q30 A 2277746226 A 22149767 None
Q6581097 D 3273952711 A 22149768 High positive
Q5 C 5668008721 A 22149769 High positive
Q5296 C 12530369761 A 22149770 High positive
entity_idpredictionpage_viewspop_classseqNumdissonance
Q10040378 E 0 E 1 None
Q10069140 C 0 E 2 High negative
Q10081695 C 0 E 3 High negative
Q10092002 E 0 E 4 None
Q10111267 E 0 E 5 None
Q10149726 E 0 E 6 None
Q10180230 E 0 E 7 None
Q10185035 E 0 E 8 None
Q10205202 E 0 E 9 None
Q10252966 E 0 E 10 None
Q10444494 C 0 E 11 High negative
Q10624171 C 0 E 12 High negative
Q10704108 C 0 E 13 High negative
Q10750354 C 0 E 14 High negative
Q10766855 D 0 E 15 Moderate negative
Q10827611 E 0 E 16 None
Q11093044 E 0 E 17 None
Q11934537 E 0 E 18 None
Q12133466 E 0 E 19 None
Q12264503 E 0 E 20 None
Q12267516 E 0 E 21 None
Q12304084 E 0 E 22 None
Q12443525 D 0 E 23 Moderate negative
Q12543904 E 0 E 24 None
Q12890205 E 0 E 25 None
Q12891524 E 0 E 26 None
Q12918202 E 0 E 27 None
Q13005653 E 0 E 28 None
Q13073896 E 0 E 29 None
Q13163823 E 0 E 30 None
Q1048694 C 2048095025 A 22149741 High positive
Q31165 B 2048330818 A 22149742 Moderate positive
Q40629 C 2049755644 A 22149743 High positive
Q105584 C 2049926923 A 22149744 High positive
Q4584301 C 2052339927 A 22149745 High positive
Q565 C 2052996261 A 22149746 High positive
Q1868372 C 2056080224 A 22149747 High positive
Q209330 C 2060928966 A 22149748 High positive
Q14005 D 2063120071 A 22149749 High positive
Q918 A 2063217449 A 22149750 None
Q150248 C 2068796814 A 22149751 High positive
Q866 A 2079749157 A 22149752 None
Q477675 C 2080785713 A 22149753 High positive
Q1967876 C 2084215818 A 22149754 High positive
Q750403 B 2084693498 A 22149755 Moderate positive
Q355 C 2093900731 A 22149756 High positive
Q623578 C 2097991400 A 22149757 High positive
Q17299517 D 2105487660 A 22149758 High positive
Q33999 C 2108672678 A 22149759 High positive
Q2494649 C 2114531894 A 22149760 High positive
Q2597810 C 2128920607 A 22149761 High positive
Q193563 C 2130725560 A 22149762 High positive
Q423048 C 2136131564 A 22149763 High positive
Q37312 C 2142913121 A 22149764 High positive
Q54919 C 2148531382 A 22149765 High positive
Q36578 B 2229315598 A 22149766 Moderate positive
Q30 A 2277746226 A 22149767 None
Q6581097 D 3273952711 A 22149768 High positive
Q5 C 5668008721 A 22149769 High positive
Q5296 C 12530369761 A 22149770 High positive
entity_idpredictionpage_viewspop_classseqNumdissonance
Q10040378 E 0 E 1 None
Q10069140 C 0 E 2 High negative
Q10081695 C 0 E 3 High negative
Q10092002 E 0 E 4 None
Q10111267 E 0 E 5 None
Q10149726 E 0 E 6 None
Q10180230 E 0 E 7 None
Q10185035 E 0 E 8 None
Q10205202 E 0 E 9 None
Q10252966 E 0 E 10 None
Q10444494 C 0 E 11 High negative
Q10624171 C 0 E 12 High negative
Q10704108 C 0 E 13 High negative
Q10750354 C 0 E 14 High negative
Q10766855 D 0 E 15 Moderate negative
Q10827611 E 0 E 16 None
Q11093044 E 0 E 17 None
Q11934537 E 0 E 18 None
Q12133466 E 0 E 19 None
Q12264503 E 0 E 20 None
Q12267516 E 0 E 21 None
Q12304084 E 0 E 22 None
Q12443525 D 0 E 23 Moderate negative
Q12543904 E 0 E 24 None
Q12890205 E 0 E 25 None
Q12891524 E 0 E 26 None
Q12918202 E 0 E 27 None
Q13005653 E 0 E 28 None
Q13073896 E 0 E 29 None
Q13163823 E 0 E 30 None
Q1048694 C 2048095025 A 22149741 High positive
Q31165 B 2048330818 A 22149742 Moderate positive
Q40629 C 2049755644 A 22149743 High positive
Q105584 C 2049926923 A 22149744 High positive
Q4584301 C 2052339927 A 22149745 High positive
Q565 C 2052996261 A 22149746 High positive
Q1868372 C 2056080224 A 22149747 High positive
Q209330 C 2060928966 A 22149748 High positive
Q14005 D 2063120071 A 22149749 High positive
Q918 A 2063217449 A 22149750 None
Q150248 C 2068796814 A 22149751 High positive
Q866 A 2079749157 A 22149752 None
Q477675 C 2080785713 A 22149753 High positive
Q1967876 C 2084215818 A 22149754 High positive
Q750403 B 2084693498 A 22149755 Moderate positive
Q355 C 2093900731 A 22149756 High positive
Q623578 C 2097991400 A 22149757 High positive
Q17299517 D 2105487660 A 22149758 High positive
Q33999 C 2108672678 A 22149759 High positive
Q2494649 C 2114531894 A 22149760 High positive
Q2597810 C 2128920607 A 22149761 High positive
Q193563 C 2130725560 A 22149762 High positive
Q423048 C 2136131564 A 22149763 High positive
Q37312 C 2142913121 A 22149764 High positive
Q54919 C 2148531382 A 22149765 High positive
Q36578 B 2229315598 A 22149766 Moderate positive
Q30 A 2277746226 A 22149767 None
Q6581097 D 3273952711 A 22149768 High positive
Q5 C 5668008721 A 22149769 High positive
Q5296 C 12530369761 A 22149770 High positive

In [39]:
## Build a matrix where columns are the metric and rows are classes
create_alt_diss_matrix = function(articledata, metric, classes) {
  d_mtrx = matrix(0, nrow=length(classes), ncol=length(metric));
  rownames(d_mtrx) = classes;
  colnames(d_mtrx) = metric;

  ## NOTE: R matrix values are [row,col] dimensions
  for(real_rating in classes) {
    for(diss_rating in metric) {
      d_mtrx[real_rating, diss_rating] = length(articledata[prediction == real_rating & dissonance == diss_rating]$entity_id);
    }
  }
  d_mtrx;
}

alternative_dissonance_matrix.1 = create_alt_diss_matrix(articles_by_pop,
  dissonance_metric, assessment_classes);

In [40]:
## Normalise by row
round(100*prop.table(alternative_dissonance_matrix.1, 1), 1);


High negativeModerate negativeNoneModerate positiveHigh positive
E 0.0 0.059.719.021.3
D 0.053.921.622.6 1.9
C43.520.431.6 4.5 0.0
B49.238.911.8 0.1 0.0
A 4.780.714.6 0.0 0.0

In [41]:
## Number of dissonant views per assessment class and amount of dissonance
articles_by_pop[, list(dissonant_views=sum(page_views)), by=list(prediction, dissonance)];


predictiondissonancedissonant_views
E None 292824074
C High negative 86201935
D Moderate negative 88319631
B High negative 41064026
D None 426935005
C Moderate negative 503720560
E Moderate positive 1028957042
C None 14263634348
E High positive 48187833298
D Moderate positive 7039880632
B Moderate negative 2042950733
A High negative 4427575
B None 28806936790
C Moderate positive 88436212230
D High positive 88347617255
A Moderate negative 3896338202
C High positive 218723197478
B Moderate positive 21000072914
A None 21965984702

In [42]:
## Calculations of total number of dissonant views per dissonance
articles_by_pop[, list(dissonant_views=sum(page_views)), by=list(dissonance)];


dissonancedissonant_views
None 65756314919
High negative 131693536
Moderate negative 6531329126
Moderate positive117505122818
High positive 355258648031

In [43]:
articles_by_pop[,sum(as.numeric(page_views))];


545183108430

In [44]:
## Proportions
100*65938379920/545180810059;
100*125047198/545180810059;
100*6713682043/545180810059;
100*120523625541/545180810059;
100*351880075357/545180810059;


12.0947727255594
0.0229368304409811
1.23145971375505
22.107092420945
64.5437383092995

In [45]:
# 87% of views are high positive

In [46]:
100*(articles_by_pop[, list(dissonant_views=sum(page_views)), by=list(dissonance)][1][,c('dissonant_views')]/articles_by_pop[,sum(as.numeric(page_views))])


dissonant_views
12.06133

In [47]:
100*(articles_by_pop[, list(dissonant_views=sum(page_views)), by=list(dissonance)][2][,c('dissonant_views')]/articles_by_pop[,sum(as.numeric(page_views))])


dissonant_views
0.02415584

In [48]:
100*(articles_by_pop[, list(dissonant_views=sum(page_views)), by=list(dissonance)][3][,c('dissonant_views')]/articles_by_pop[,sum(as.numeric(page_views))])


dissonant_views
1.198007

In [49]:
100*(articles_by_pop[, list(dissonant_views=sum(page_views)), by=list(dissonance)][4][,c('dissonant_views')]/articles_by_pop[,sum(as.numeric(page_views))])


dissonant_views
21.55333

In [50]:
100*(articles_by_pop[, list(dissonant_views=sum(page_views)), by=list(dissonance)][5][,c('dissonant_views')]/articles_by_pop[,sum(as.numeric(page_views))])


dissonant_views
65.16318