From fd519b0e45c857b266814994ba8c1421f508e522 Mon Sep 17 00:00:00 2001 From: redpony Date: Tue, 27 Jul 2010 16:13:19 +0000 Subject: preso git-svn-id: https://ws10smt.googlecode.com/svn/trunk@435 ec762483-ff6d-05da-a07a-a48fb63a330f --- report/pyp_clustering/acl09-short/code/crppred.m | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 report/pyp_clustering/acl09-short/code/crppred.m (limited to 'report/pyp_clustering/acl09-short/code/crppred.m') diff --git a/report/pyp_clustering/acl09-short/code/crppred.m b/report/pyp_clustering/acl09-short/code/crppred.m new file mode 100644 index 00000000..17f22652 --- /dev/null +++ b/report/pyp_clustering/acl09-short/code/crppred.m @@ -0,0 +1,12 @@ +function output = crppred(input,b) + +uniqin = unique(input); +prediction = zeros(max(input),1); + +p0=1/30114; +for i = 1:length(uniqin) + prediction(uniqin(i)) = b*p0*sum(1./((1:uniqin(i))+b*p0-1)); +end + +output = prediction(input); + -- cgit v1.2.3