In [1]:
using StatsBase

s = [874, 1293, 1070] ./ 3237
p = [224, 242, 236] ./ 702

s = WeightVec(s)
p = WeightVec(p)


INFO: Recompiling stale cache file /home/cano/.julia/lib/v0.5/StatsBase.ji for module StatsBase.
Out[1]:
StatsBase.WeightVec{Float64,Array{Float64,1}}([0.319088,0.344729,0.336182],1.0)

In [2]:
model = "only language"

rs_1 = [0.6155606407322655, 0.6352395672333848, 0.6056074766355141];
rp_1 = [0.21052631578947367, 0.13709677419354838, 0.19469026548672566];

rs_2 = [0.6590389016018307, 0.6749226006191951, 0.6130841121495327];
rp_2 = [0.26126126126126126, 0.20168067226890757, 0.15447154471544716];

rs_3 = [0.5903890160183066, 0.6321483771251932, 0.611214953271028];
rp_3 = [0.21929824561403508, 0.1532258064516129, 0.17699115044247787];

rs_4 = [0.6544622425629291, 0.6377708978328174, 0.6056074766355141];
rp_4 = [0.3153153153153153, 0.18487394957983194, 0.16260162601626016];

rs_5 = [0.5903890160183066, 0.615146831530139, 0.6186915887850467];
rp_5 = [0.20175438596491227, 0.16129032258064516, 0.22123893805309736];

rs_6 = [0.6636155606407322, 0.6037383177570094, 0.6037383177570094];
rp_6 = [0.32432432432432434, 0.17886178861788618, 0.17886178861788618];

rs_ens_1 = [0.6178489702517163, 0.6306027820710973, 0.6186915887850467];
rp_ens_1 = [0.23684210526315788, 0.16129032258064516, 0.23008849557522124];

rs_ens_2 = [0.6750572082379863, 0.6671826625386997, 0.6261682242990654];
rp_ens_2 = [0.32432432432432434, 0.20168067226890757, 0.17073170731707318];

rs_m = (rs_1 + rs_2 + rs_3 + rs_4 + rs_5 + rs_6) / 6
rp_m = (rp_1 + rp_2 + rp_3 + rp_4 + rp_5 + rp_6) / 6

rs_ens_m = (rs_ens_1 + rs_ens_2) / 2
rp_ens_m = (rp_ens_1 + rp_ens_2) / 2

println("Single: $(rs_m)")
println("Paragraph: $(rp_m)")
println("Weighted Single: $(mean_and_std(rs_m, s))")
println("Weighted Paragraph: $(mean_and_std(rp_m, p))")
println("Ensemble Weighted Single: $(mean_and_std(rs_ens_m, s))")
println("Ensemble Weighted Paragraph: $(mean_and_std(rp_ens_m, p))")


Single: [0.628909,0.633161,0.609657]
Paragraph: [0.255413,0.169505,0.181476]
Weighted Single: (0.624243837070455,0.010390873268014349)
Weighted Paragraph: (0.20094169845019555,0.03761458718705883)
Ensemble Weighted Single: (0.6394866512018021,0.01202550120802698)
Ensemble Weighted Paragraph: (0.21946853907675873,0.04255878873432755)

In [3]:
rs_ens10_1 = [];
rp_ens10_1 = [];

rs_ens10_2 = [];
rp_ens10_2 = [];

rs_ens_m = (rs_ens10_1 + rs_ens10_2) / 2
rp_ens_m = (rp_ens10_1 + rp_ens10_2) / 2

println("Ensemble10 Weighted Single: $(mean_and_std(rs_ens_m, s))")
println("Ensemble10 Weighted Paragraph: $(mean_and_std(rp_ens_m, p))")


MethodError: no method matching mean_and_std(::Array{Any,1}, ::StatsBase.WeightVec{Float64,Array{Float64,1}})
Closest candidates are:
  mean_and_std(::AbstractArray{T<:Real,N}, ::StatsBase.WeightVec{W,Vec<:AbstractArray{T<:Real,1}}) at /home/cano/.julia/v0.5/StatsBase/src/moments.jl:124
  mean_and_std(::AbstractArray{T<:Real,N}, ::StatsBase.WeightVec{W,Vec<:AbstractArray{T<:Real,1}}, ::Int64) at /home/cano/.julia/v0.5/StatsBase/src/moments.jl:130

In [ ]: