Data update
This commit is contained in:
parent
4bb20c9b71
commit
cbaf4c4b64
12390 changed files with 318560 additions and 27248 deletions
|
|
@ -0,0 +1,28 @@
|
|||
include "NSLog.incl"
|
||||
|
||||
double local fn Square( d as double )
|
||||
end fn = d * d
|
||||
|
||||
double local fn AverageSquareDiff( d as double, predictions as CFArrayRef )
|
||||
double sum = 0.0
|
||||
for CFNumberRef num in predictions
|
||||
sum += fn Square( fn NumberDoubleValue( num ) - d )
|
||||
next
|
||||
return sum / fn ArrayCount( predictions )
|
||||
end fn = 0.0
|
||||
|
||||
CFStringRef local fn DiversityTheorem( truth as double, predictions as CFArrayRef )
|
||||
double average = fn NumberDoubleValue( fn ObjectValueForKeyPath( predictions, @"@avg.self" ) )
|
||||
CFStringRef avgErr = fn StringWithFormat( @"%4.5f", fn AverageSquareDiff( truth, predictions ) )
|
||||
CFStringRef crowdErr = fn StringWithFormat( @"%6.5f", fn Square( truth - average ) )
|
||||
CFStringRef diversity = fn StringWithFormat( @"%6.5f", fn AverageSquareDiff( average, predictions ) )
|
||||
return fn StringWithFormat( @"Average error : %@\nCrowd error : %@\nDiversity : %@\n", avgErr, crowdErr, diversity )
|
||||
end fn = NULL
|
||||
|
||||
NSLog( @"Diversity prediction with crowd estimates of 48, 47 and 51:" )
|
||||
NSLog( @"%@\n", fn DiversityTheorem( 49.0, @[@48.0, @47.0, @51.0] ) )
|
||||
|
||||
NSLog( @"Diversity prediction with crowd estimates of 48, 47, 51 and 42:" )
|
||||
NSLog( @"%@\n", fn DiversityTheorem( 49.0, @[@48.0, @47.0, @51.0, @42.0] ) )
|
||||
|
||||
HandleEvents
|
||||
Loading…
Add table
Add a link
Reference in a new issue