Changeset 3603:93b2ec88dce7 in orange


Ignore:
Timestamp:
04/27/07 15:44:00 (7 years ago)
Author:
spetrovic <spetrovic@…>
Branch:
default
Convert:
2d0568f75c62564ca2977198b94edfe8d601a881
Message:

minor changes on GUI

Location:
orange/OrangeWidgets/Visualize
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • orange/OrangeWidgets/Visualize/OWCorrAnalysis.py

    r3602 r3603  
    442442     
    443443    #owb = OWBagofWords.OWBagofWords() 
    444     t = orngText.loadFromXML(r'c:\test\r.xml') 
     444    t = orngText.loadFromXML(r'c:\test\rtl.xml') 
    445445    #owb.data = t 
    446446    #owb.show() 
     447    stop = orngText.loadWordSet(r'C:\tmtorange\common\en_stopwords.txt') 
    447448    print 'Done with loading' 
    448     t1 = orngText.extractLetterNGram(t, 3) 
    449 ##    print len(t1[0].domain.getmetas()) 
    450 ##    print len(t1.domain.getmetas()) 
     449    #t1 = orngText.extractLetterNGram(t, 3) 
     450    t1 = orngText.extractWordNGram(t, stopwords = stop) 
     451    print len(t1.domain.getmetas()) 
    451452    print 'Done with extracting' 
    452     t2 = orngText.FSS(t1, 'TF', 'MIN', 0.90) 
    453 ##    print len(t2[0].domain.getmetas()) 
    454     print len(t2.domain.getmetas()) 
     453    t2 = orngText.FSS(t1, 'TF', 'MIN', 0.95) 
    455454    print 'Done with feature selection' 
    456455    appl.setMainWidget(ow) 
    457     #t3 = orngText.DSS(t2, 'WF', 'MIN', 1) 
    458     print 'Done with document selection' 
    459     ow.dataset(t2) 
     456    t3 = orngText.DSS(t2, 'WF', 'MIN', 1) 
     457    #print 'Done with document selection' 
     458    ow.dataset(t3) 
    460459    print 'Done' 
    461460    ow.show() 
  • orange/OrangeWidgets/Visualize/OWCorrAnalysisGraph.py

    r3602 r3603  
    135135            yFloat = self.invTransform(QwtPlot.yLeft, e.y()) 
    136136            all = [(self.tips.texts[i]) for (i,(x,y, cx, cy)) in enumerate(self.tips.positions) if abs(xFloat - x)  <= self.radius and abs(yFloat - y) <= self.radius] 
    137             self.docs = [tip[:-1] for tip in all if tip[-1] == 'R'] 
    138             self.features = [tip[:-1] for tip in all if tip[-1] == 'C'] 
     137            self.docs = [tip[:-1] for tip in all if tip and tip[-1] == 'R'] 
     138            self.features = [tip[:-1] for tip in all if tip and tip[-1] == 'C'] 
    139139            self.event(e) 
    140140        elif self.state == BROWSE_CIRCLE: 
     141            xFloat = self.invTransform(QwtPlot.xBottom, e.x()) 
     142            yFloat = self.invTransform(QwtPlot.yLeft, e.y()) 
     143            all = [(x, y, self.tips.texts[i]) for (i,(x,y, cx, cy)) in enumerate(self.tips.positions) if ((xFloat - x)*(xFloat - x) + (yFloat - y)*(yFloat - y) <= self.radius * self.radius)] 
     144            self.docs = [tip[:-1] for tip in all if tip and tip[-1] == 'R'] 
     145            self.features = [tip[:-1] for tip in all if tip and tip[-1] == 'C'] 
    141146            self.event(e) 
    142147        else: 
     
    218223#                points[i-1] = t             
    219224#            i = i + 1                 
    220  
     225        points = [(i, (x, y, text)) for (i, (x, y, text)) in points if text] 
    221226        points = [(i, (x, y, t[:-1])) for (i, (x, y, t)) in points[:self.maxPoints]] 
    222227         
Note: See TracChangeset for help on using the changeset viewer.