Changeset 9464:2b1c1c496273 in orange


Ignore:
Timestamp:
07/28/11 10:48:53 (3 years ago)
Author:
wencanluo <wencanluo@…>
Branch:
default
Convert:
24f0e92d0cb351bc14b9005a3b25d8eb1b1d633f
Message:

Initial version of MMP method for multi-label classification

Location:
orange
Files:
2 added
1 deleted
7 edited

Legend:

Unmodified
Added
Removed
  • orange/Orange/__init__.py

    r9461 r9464  
    6666_import("multilabel.lp") 
    6767_import("multilabel.mlknn") 
     68_import("multilabel.mmp") 
    6869 
    6970_import("associate") 
  • orange/Orange/multilabel/__init__.py

    r9461 r9464  
    1010from mlknn import MLkNNLearner 
    1111from mlknn import MLkNNClassifier 
     12 
     13from mmp import MMPLearner 
     14from mmp import MMPClassifier 
  • orange/Orange/multilabel/br.py

    r9460 r9464  
    8080            return self 
    8181         
    82     def __init__(self, **argkw): 
    83         self.multi_flag = 1 
    84         self.__dict__.update(argkw) 
    85          
    8682    def __call__(self, instances, base_learner = None, **kwds): 
    8783        for k in kwds.keys(): 
  • orange/Orange/multilabel/mlknn.py

    r9463 r9464  
    2424   :show-inheritance: 
    2525  
    26    .. method:: __new__(instances, base_learner, **argkw)  
     26   .. method:: __new__(instances, **argkw)  
    2727   MLkNNLearner Constructor 
    2828    
    2929   :param instances: a table of instances, covered by the rule. 
    3030   :type instances: :class:`Orange.data.Table` 
    31        
    32    :param base_learner: the binary learner, the default learner is BayesLearner 
    33    :type base_learner: :class:`Orange.classification.Learner` 
    3431 
    3532.. index:: MLkNN Classifier 
     
    204201        #Computing the posterior probabilities P(E_j^l|H_b^l) 
    205202        self.compute_cond() 
    206          
    207         #Computing y_t and r_t 
    208203         
    209204        return MLkNNClassifier(instances = instances, label_indices = label_indices,  
     
    275270            raise ValueError, "has no label attribute: 'the multilabel data should have at last one label attribute' " 
    276271         
     272        #Computing y_t and r_t 
    277273        neighbors = self.knn.findNearest(example, self.k) 
    278274        for i in range(num_labels): 
  • orange/doc/Orange/hiearchy.txt

    r9461 r9464  
    3737      tuning 
    3838   multilabel 
    39       br; lp; mlknn 
     39      br; lp; mlknn; mmp; 
  • orange/doc/Orange/rst/Orange.multilabel.rst

    r9461 r9464  
    1111   Orange.multilabel.lp 
    1212   Orange.multilabel.mlknn 
     13   Orange.multilabel.mmp 
  • orange/doc/Orange/rst/code/mlc-classify.py

    r9462 r9464  
    2626    c,p = mlknn_cliassifer(e,Orange.classification.Classifier.GetBoth) 
    2727    print c,p 
     28     
     29mmp_cliassifer = Orange.multilabel.MMPLearner(data,k=1) 
     30for e in data: 
     31    c,p = mmp_cliassifer(e,Orange.classification.Classifier.GetBoth) 
     32    print c,p 
Note: See TracChangeset for help on using the changeset viewer.