#### starting som prediction fine-tuned class-performance visualisation

git-svn-id: https://svn.discofish.de/MATLAB/spmtoolbox/SVMCrossVal@112 83ab2cfd-5345-466c-8aeb-2b2739fb922d Christoph Budziszewski authored on21/01/2009 16:34:25
Showing1 changed files
 1 1 `new file mode 100644` ... ... `@@ -0,0 +1,63 @@` 1 `+function sig = som_drsignif(sigmea,Cm)` 2 `+` 3 `+% SOM_DRSIGNIF Significance measure from confusion matrix between two clusters and a rule.` 4 `+%` 5 `+% sig = som_drsignif(sigmea,Cm)` 6 `+% ` 7 `+% sigmea (string) significance measure: 'accuracy', ` 8 `+% 'mutuconf' (default), or 'accuracyI'.` 9 `+% (See definitions below).` 10 `+% Cn Vectorized confusion matrix, or a matrix of such vectors.` 11 `+% (vector) [a, c, b, d] (see below)` 12 `+% (matrix) [[a1,c1,b1,d1], ..., [an,cn,bn,dn]]` 13 `+%` 14 `+% sig (vector) length=n, significance values ` 15 `+%` 16 `+% The confusion matrix Cm below between group (G) and contrast group (not G)` 17 `+% and rule (true - false) is used to determine the significance values:` 18 `+%` 19 `+% G not G ` 20 `+% --------------- accuracy = (a+d) / (a+b+c+d)` 21 `+% true | a | b | ` 22 `+% |-------------- mutuconf = a*a / ((a+b)(a+c)) ` 23 `+% false | c | d | ` 24 `+% --------------- accuracyI = a / (a+b+c)` 25 `+%` 26 `+% See also SOM_DREVAL, SOM_DRMAKE.` 27 `+` 28 `+% Contributed to SOM Toolbox 2.0, March 4th, 2002 by Juha Vesanto` 29 `+% Copyright (c) by Juha Vesanto` 30 `+% http://www.cis.hut.fi/projects/somtoolbox/` 31 `+` 32 `+% Version 2.0beta juuso 040302` 33 `+` 34 `+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%` 35 `+%% input arguments` 36 `+` 37 `+true_x = Cm(:,1); % x = in group` 38 `+false_x = Cm(:,2); % false = rule is false` 39 `+true_y = Cm(:,3); % true = rule is true` 40 `+false_y = Cm(:,4); % y = not in group` 41 `+` 42 `+true_items = true_x + true_y; ` 43 `+x_items = true_x + false_x; ` 44 `+all_items = true_x + false_x + true_y + false_y; ` 45 `+true_or_x = x_items + true_items - true_x; ` 46 `+` 47 `+switch sigmea, ` 48 `+case 'mutuconf',` 49 `+ % mutual confidence, or relevance (as defined in WSOM2001 paper)` 50 `+ sig = zeros(size(true_x)); ` 51 `+ i = find(true_items>0 & x_items>0); ` 52 `+ sig(i) = (true_x(i).^2) ./ (true_items(i).*x_items(i)); ` 53 `+case 'accuracy', ` 54 `+ % accuracy ` 55 `+ sig = (true_x + false_y) ./ all_items;` 56 `+case 'accuracyI', ` 57 `+ % accuracy such that false_y is left out of consideration` 58 `+ sig = true_x./true_or_x;` 59 `+otherwise, ` 60 `+ error(['Unrecognized significance measures: ' sigmea]);` 61 `+end ` 62 `+` 63 `+return;`
{"ft_lang_label":"__label__en","ft_lang_prob":0.50256777,"math_prob":0.9918382,"size":2553,"snap":"2021-31-2021-39","text_gpt3_token_len":898,"char_repetition_ratio":0.1537858,"word_repetition_ratio":0.0,"special_character_ratio":0.51116335,"punctuation_ratio":0.19406393,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9898053,"pos_list":[0,1,2],"im_url_duplicate_count":[null,null,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2021-08-01T17:30:05Z\",\"WARC-Record-ID\":\"<urn:uuid:d95a7883-3884-44a2-99a5-69ebd1cac1ff>\",\"Content-Length\":\"53470\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:a5a4a3ec-38f3-49c7-802a-8fe068a14d55>\",\"WARC-Concurrent-To\":\"<urn:uuid:f26959d5-2f00-4726-8dee-04ddc6f671fd>\",\"WARC-IP-Address\":\"178.63.68.96\",\"WARC-Target-URI\":\"https://git.schokokeks.org/SVMCrossVal.git/logpatch/f10dec017a935aabc20372e71ab80a51dd0e449d/somtoolbox2/som_drsignif.m\",\"WARC-Payload-Digest\":\"sha1:CRQUQJTP5NFXUCB4LNKABHT4Z5Q3MJCL\",\"WARC-Block-Digest\":\"sha1:32HV2OWMQZI7KNKMY75SFICPOQUEEQNV\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2021/CC-MAIN-2021-31/CC-MAIN-2021-31_segments_1627046154214.63_warc_CC-MAIN-20210801154943-20210801184943-00055.warc.gz\"}"}