Changeset 10984:935cd5530cde in orange


Ignore:
Timestamp:
09/11/12 14:01:56 (19 months ago)
Author:
Miran Levar <mlevar@…>
Branch:
default
Message:

Removed lingering multitarget files, made some fixes to scoring.

Location:
Orange
Files:
2 deleted
2 edited

Legend:

Unmodified
Added
Removed
  • Orange/classification/neural.py

    r10971 r10984  
    33 
    44*************************************** 
    5 Neural Network Learner 
     5Neural Network Learner  (``neural``) 
    66*************************************** 
    77 
  • Orange/evaluation/scoring.py

    r10967 r10984  
    26372637            if actual: 
    26382638                recalls[i] += intersection / actual 
    2639  
    26402639    return [x / example_num for x in recalls] 
    26412640 
     
    26762675    precision = mlc_precision(res) 
    26772676    recall = mlc_recall(res) 
    2678     return [2 * p * r / (p + r) for p,r in zip(precision, recall)] 
     2677    return [0.0 if p == 0 and r == 0 else 2 * p * r / (p + r) for p,r in zip(precision, recall)] 
    26792678 
    26802679 
     
    26892688 
    26902689    for l in xrange(res.number_of_learners):  
    2691         true_positive = [0.0] * n_classes 
    2692         sum_fptp = [0.0] * n_classes 
    2693         sum_fntp = [0.0] * n_classes 
     2690        true_positive = [0.0000001] * n_classes 
     2691        sum_fptp = [0.0000001] * n_classes 
     2692        sum_fntp = [0.0000001] * n_classes 
    26942693        for r in res.results: 
    26952694            aclass = r.actual_class 
     2695 
    26962696            for i, cls_val in enumerate(r.classes[l]): 
    2697                 if aclass[i] and cls_val: 
     2697                if aclass[i]==1 and int(cls_val)==1: 
    26982698                    true_positive[i] += 1 
    2699                 if cls_val: 
     2699                if int(cls_val)==1: 
    27002700                    sum_fptp[i] += 1 
    2701                 if aclass[i]: 
     2701                if aclass[i]==1: 
    27022702                    sum_fntp[i] += 1 
    27032703 
Note: See TracChangeset for help on using the changeset viewer.