rem stringlengths 0 322k | add stringlengths 0 2.05M | context stringlengths 8 228k |
|---|---|---|
def executeUpdate(self): self.addText("Starting updating new files") self.addText("Reading file status from server") self.updateGroups = []; self.dontUpdateGroups = []; self.newGroups = [] self.downstuff = {} upstuff, upUpdateGroups, upDontUpdateGroups = self.readVersionFile(self.download("/orangeUpdate/whatsup.txt"... | def updatefile(self, fname, version, md): dname = os.path.dirname(fname) if dname and not os.path.exists(dname): os.makedirs(dname) | |
def getStress(self,stressf=SgnRelStress): | def getStress(self,stressf=default_stress): | def getStress(self,stressf=SgnRelStress): self.getDistance() self.stress = resize(array([0.0]),(self.n,self.n)) self.arr = [] total = 0.0 for i in xrange(1,self.n): for j in xrange(i): r = stressf(self.O[i][j],self.dist[i][j]) self.stress[i][j] = r self.stress[j][i] = r self.arr.append((r,(i,j))) total += abs(r) self.a... |
def getStress(self,stressf=SgnRelStress): | def getStress(self,stressf=default_stress): | def getStress(self,stressf=SgnRelStress): self.getDistance() self.stress = resize(array([0.0]),(self.n,self.n)) self.arr = [] total = 0.0 for i in xrange(1,self.n): for j in xrange(i): r = stressf(self.O[i][j],self.dist[i][j],self.W[i][j]) self.stress[i][j] = r self.stress[j][i] = r self.arr.append((r,(i,j))) total += ... |
bgTreat = OWGUI.radioButtonsInBox(self.controlArea, self, "defaultMethod", ["Avg./Most frequent", "Model-based imputer", "Random values"], "Default imputation method", callback=self.sendIf) | bgTreat = OWGUI.radioButtonsInBox(self.controlArea, self, "defaultMethod", ["Average/Most frequent", "Model-based imputer", "Random values"], "Default imputation method", callback=self.sendIf) | def __init__(self,parent=None, signalManager = None, name = "Impute"): OWWidget.__init__(self, parent, signalManager, name) self.inputs = [("Classified Examples", ExampleTableWithClass, self.cdata, Default), ("Learner for Imputation", orange.Learner, self.setModel)] self.outputs = [("Classified Examples", ExampleTable... |
indibox.setFixedHeight(300) | def __init__(self,parent=None, signalManager = None, name = "Impute"): OWWidget.__init__(self, parent, signalManager, name) self.inputs = [("Classified Examples", ExampleTableWithClass, self.cdata, Default), ("Learner for Imputation", orange.Learner, self.setModel)] self.outputs = [("Classified Examples", ExampleTable... | |
self.indiType, value = self.methods.get(attr.name, False) or (-1, "") if self.indiType >= 0: if attr.varType == orange.VarTypes.Discrete: self.indiValueCtrl.setCurrentItem(value) else: self.indiValueCtrl.setText(value) | specific = self.methods.get(attr.name, False) if specific: self.indiType = specific[0] if self.indiType == 5: if attr.varType == orange.VarTypes.Discrete: self.indiValueCtrl.setCurrentItem(specific[1]) else: self.indiValueCtrl.setText(specific[1]) else: self.indiType = 0 | def setIndiType(self): if self.data: attr = self.data.domain[self.selectedAttr] self.indiType, value = self.methods.get(attr.name, False) or (-1, "") if self.indiType >= 0: if attr.varType == orange.VarTypes.Discrete: self.indiValueCtrl.setCurrentItem(value) else: self.indiValueCtrl.setText(value) |
if self.model and self.defaultMethod == 1: self.imputer = orange.ImputerConstructor_model(model = self.model, imputeClass = self.imputeClass) | if self.defaultMethod == 1: model = self.model or orange.kNNLearner() self.imputer = orange.ImputerConstructor_model(learnerDiscrete = model, learnerContinuous = model, imputeClass = self.imputeClass) | def constructImputer(self, *a): self.error("") if not self.methods: if self.model and self.defaultMethod == 1: self.imputer = orange.ImputerConstructor_model(model = self.model, imputeClass = self.imputeClass) elif self.defaultMethod == 2: self.imputer = orange.ImputerConstructor_random(imputeClass = self.imputeClass)... |
newdata = orange.ExampleTable(orange.Domain([attr for attr in examples.domain if attr != self.attr] + [self.attr]), examples) | newdata = orange.ExampleTable(orange.Domain([attr for attr in examples.domain.attributes if attr != self.attr] + [self.attr]), examples) newdata = orange.Filter_hasClassValue(newdata) | def __call__(self, examples, weight): newdata = orange.ExampleTable(orange.Domain([attr for attr in examples.domain if attr != self.attr] + [self.attr]), examples) return self.model(newdata, weight) |
missingModels = [] | def __call__(self, examples, weight): newdata = orange.ExampleTable(orange.Domain([attr for attr in examples.domain if attr != self.attr] + [self.attr]), examples) return self.model(newdata, weight) | |
if self.model: imputerModels.append(AttrModelLearner(attr, self.model)) else: missingModels.append("'"+attr.name+"'") imputerModels.append(AttrMajorityLearner(attr)) | if not usedModel: usedModel = self.model or orange.kNNLearner() imputerModels.append(AttrModelLearner(attr, usedModel)) | def __call__(self, examples, weight): newdata = orange.ExampleTable(orange.Domain([attr for attr in examples.domain if attr != self.attr] + [self.attr]), examples) return self.model(newdata, weight) |
if missingModels: if len(missingModels) <= 3: msg = "The model, needed for imputation of some attributes (%s) is not given." % ", ".join(missingModels) else: msg = "The model, needed for imputation of some attributes (%s, ...) is not given." % ", ".join(missingModels[:3]) if missingValues: msg += "\n" else: msg = "" | def __call__(self, examples, weight): newdata = orange.ExampleTable(orange.Domain([attr for attr in examples.domain if attr != self.attr] + [self.attr]), examples) return self.model(newdata, weight) | |
msg += "The imputed values for some attributes (%s) are not specified." % ", ".join(missingValues) | msg = "The imputed values for some attributes (%s) are not specified." % ", ".join(missingValues) | def __call__(self, examples, weight): newdata = orange.ExampleTable(orange.Domain([attr for attr in examples.domain if attr != self.attr] + [self.attr]), examples) return self.model(newdata, weight) |
msg += "The imputed values for some attributes (%s, ...) are not specified." % ", ".join(missingValues[:3]) if msg: | msg = "The imputed values for some attributes (%s, ...) are not specified." % ", ".join(missingValues[:3]) | def __call__(self, examples, weight): newdata = orange.ExampleTable(orange.Domain([attr for attr in examples.domain if attr != self.attr] + [self.attr]), examples) return self.model(newdata, weight) |
if sum > 10000: | if sum > MAX_EXP: | def __call__(self,example): # logistic regression sum = self.beta[0] for i in range(len(self.beta)-1): sum = sum + example[i]*self.beta[i+1] # print sum, example if sum > 10000: return (1,1.0) elif sum < -10000: return (0,1.0) else: sum = math.exp(sum) p = sum/(1.0+sum) # probability that the class is 1 if p < 0.5: ret... |
elif sum < -10000: | elif sum < -MAX_EXP: | def __call__(self,example): # logistic regression sum = self.beta[0] for i in range(len(self.beta)-1): sum = sum + example[i]*self.beta[i+1] # print sum, example if sum > 10000: return (1,1.0) elif sum < -10000: return (0,1.0) else: sum = math.exp(sum) p = sum/(1.0+sum) # probability that the class is 1 if p < 0.5: ret... |
if sum > 10000: | if sum > MAX_EXP: | def __call__(self, example, format = orange.GetValue): sum = -self.getmargin(example) |
elif sum < -10000: | elif sum < -MAX_EXP: | def __call__(self, example, format = orange.GetValue): sum = -self.getmargin(example) |
if str == None: return | if str == None or str == "": return | def loadSettingsStr(self, str): if str == None: return if hasattr(self, "settingsList"): settings = cPickle.loads(str) self.setSettings(settings) |
newColor.setHsv(self.scaleExampleValue(self.subsetData[i], classNameIndex), 255, 255) | newColor.setHsv(dataVals[-1], 255, 255) | def updateData(self, labels, **args): self.removeDrawingCurves() # my function, that doesn't delete selection curves #self.removeCurves() self.removeMarkers() |
classList = Numeric.compress(validData, (self.noJitteringScaledData[classIndex]*2*len(self.rawdata.domain.classVar.values)- 1 )/2.0) | classList = Numeric.transpose(self.rawdata.toNumeric("c")[0])[0] classList = Numeric.compress(validData, classList) | def getOptimalSeparation(self, attributes, minLength, maxLength, addResultFunct): dataSize = len(self.rawdata) lastTime = time.time() |
classList = Numeric.compress(validData, (self.noJitteringScaledData[classIndex]*2*len(self.rawdata.domain.classVar.values)- 1 )/2.0) | classList = Numeric.transpose(self.rawdata.toNumeric("c")[0])[0] classList = Numeric.compress(validData, classList) | def optimizeGivenProjection(self, projection, accuracy, attributes, addResultFunct): dataSize = len(self.rawdata) classIndex = self.attributeNames.index(self.rawdata.domain.classVar.name) |
item.move(item.x()-minx, item.y()-miny) | item.moveBy(-minx, -miny) | def fillPainter(self, painter, rect): if isinstance(self.graph, QwtPlot): self.graph.printPlot(painter, rect) elif isinstance(self.graph, QCanvas): # draw background self.graph.drawBackground(painter, rect) minx,maxx,miny,maxy = self.getQCanvasBoundaries() |
item.move(item.x()+minx, item.y()+miny) | item.moveBy(minx, miny) | def fillPainter(self, painter, rect): if isinstance(self.graph, QwtPlot): self.graph.printPlot(painter, rect) elif isinstance(self.graph, QCanvas): # draw background self.graph.drawBackground(painter, rect) minx,maxx,miny,maxy = self.getQCanvasBoundaries() |
classname = os.path.basename(appName)[:-3] | classname = os.path.splitext(os.path.basename(appName))[0] | def saveDocumentAsApp(self, asTabs = 1): # get filename extension = sys.platform == "win32" and ".pyw" or ".py" appName = os.path.splitext(self.applicationname)[0] + extension qname = QFileDialog.getSaveFileName( os.path.join(self.applicationpath, appName) , "Orange Scripts (*%s)" % extension, self, "", "Save File as A... |
self.addCurve("hidecircle", QColor(0,0,0), QColor(0,0,0), 1, style = QwtCurve.Lines, pen = (QPen(QColor(128, 128, 128), 1, Qt.DashDotDotLine)), symbol = QwtSymbol.None, xData = xdata + [xdata[0]], yData = ydata + [ydata[0]]) | self.addCurve("hidecircle", QColor(0,0,0), QColor(0,0,0), 1, style = QwtCurve.Lines, symbol = QwtSymbol.None, xData = xdata + [xdata[0]], yData = ydata + [ydata[0]]) | def updateData(self, labels, setAnchors = 0, **args): self.removeDrawingCurves() # my function, that doesn't delete selection curves #self.removeCurves() self.removeMarkers() |
color=[(a.red()+(255-a.red())*c, a.green()+(255-a.green())*c, a.blue()+(255-a.blue())*c) for a in colorPalette] colorPalette=[QColor(a[0],a[1],a[2]) for a in color] | colorPalette=[colorPalette.getColor(i, 150) for i in range(len(self.selectionList))] | def addSelection(self, obj): new=SelectionPoly(self) vertList=[] ptr=obj while ptr: #construct upper part of the polygon rect=ptr.rect() ptr=ptr.left vertList.append(QPoint(rect.left()-polyOffset,rect.top()-polyOffset)) if ptr: vertList.append(QPoint(ptr.rect().left()-polyOffset, rect.top()-polyOffset)) else: vertL... |
self.output = orngOutput.OutputWindow(self, self.workspace) | self.output = orngOutput.OutputWindow(self, self.workspace, "", Qt.WDestructiveClose) | def __init__(self,*args): apply(QMainWindow.__init__,(self,) + args) self.ctrlPressed = 0 # we have to save keystate, so that orngView can access information about keystate self.debugMode = 1 # print extra output for debuging self.resize(900,800) self.setCaption("Qt Orange Canvas") self.windows = [] # list... |
win = orngDoc.SchemaDoc(self, self.workspace, "", Qt.WDestructiveClose + Qt.WType_TopLevel) | win = orngDoc.SchemaDoc(self, self.workspace, "", Qt.WDestructiveClose) | def menuItemNewSchema(self): win = orngDoc.SchemaDoc(self, self.workspace, "", Qt.WDestructiveClose + Qt.WType_TopLevel) self.workspace.setDefaultDocPosition(win) return win |
return (proj, projVal, 0) | return proj, projVal, 0 | def addBestToCurrentProj(proj, projVal, attrInfo): for (val, a1, a2) in attrInfo: if (a1 == proj[0] and a2 not in proj) or (a2 == proj[0] and a1 not in proj) or (a1 == proj[-1] and a2 not in proj) or (a2 == proj[-1] and a1 not in proj): if a1 == proj[0]: return ([a2] + proj, [val] + projVal, 1) elif a2 == proj[0]: retu... |
def optimizeAttributeOrder(attrInfo, numberOfAttributes, optimizationDlg, app = None): | def optimizeAttributeOrder(attrInfo, numberOfAttributes, optimizationDlg, app): | def optimizeAttributeOrder(attrInfo, numberOfAttributes, optimizationDlg, app = None): while (attrInfo != []): proj = [] projVal = [] canAddAttribute = 1 while canAddAttribute: if not optimizationDlg.canContinueOptimization(): return if app: app.processEvents() # allow processing of other events if len(proj) ==... |
if app: app.processEvents() | app.processEvents() | def optimizeAttributeOrder(attrInfo, numberOfAttributes, optimizationDlg, app = None): while (attrInfo != []): proj = [] projVal = [] canAddAttribute = 1 while canAddAttribute: if not optimizationDlg.canContinueOptimization(): return if app: app.processEvents() # allow processing of other events if len(proj) ==... |
for i in range(len(projVal)): | for i in range(len(proj)-1): | def optimizeAttributeOrder(attrInfo, numberOfAttributes, optimizationDlg, app = None): while (attrInfo != []): proj = [] projVal = [] canAddAttribute = 1 while canAddAttribute: if not optimizationDlg.canContinueOptimization(): return if app: app.processEvents() # allow processing of other events if len(proj) ==... |
rev = proj[i:j] | rev = proj[i+1:j+1] | def fixIntersectingPairs(proj, projVal, attrInfo): changed = 1 while changed: changed = 0 for i in range(len(projVal)-1): if changed: continue for j in range(i+2, len(projVal)-1): if changed: continue val1, exists1 = getAttributePairValue(proj[i], proj[j], attrInfo) val2, exists2 = getAttributePairValue(proj[i+1], proj... |
tempProj = proj[:i] + rev + proj[j:] | tempProj = proj[:i+1] + rev + proj[j+1:] | def fixIntersectingPairs(proj, projVal, attrInfo): changed = 1 while changed: changed = 0 for i in range(len(projVal)-1): if changed: continue for j in range(i+2, len(projVal)-1): if changed: continue val1, exists1 = getAttributePairValue(proj[i], proj[j], attrInfo) val2, exists2 = getAttributePairValue(proj[i+1], proj... |
deltas[d] = obrni * (xnz-xp[-1]) | deltas[d] = obrni * (xnz-xp[-1]) / dt | def D(self): if not self.deltas: self.deltas = [[None] * len(self.contAttributes) for x in xrange(len(self.data))] |
def starRegression(self): if not self.deltas: self.deltas = [[None] * len(self.contAttributes) for x in xrange(len(self.data))] dimensions = [d for d in self.dimensions if not self.deltas[0][d]] if not dimensions: return if not self.points: self.points = orange.ExampleTable(orange.Domain(self.contAttributes, self.dat... | def D(self): if not self.deltas: self.deltas = [[None] * len(self.contAttributes) for x in xrange(len(self.data))] | |
self.findNearest = orange.FindNearestConstructor_BruteForce(self.data, distanceConstructor=orange.ExamplesDistanceConstructor_Euclidean()) | self.findNearest = orange.FindNearestConstructor_BruteForce(self.data, distanceConstructor=orange.ExamplesDistanceConstructor_Euclidean(), includeSame=False) | def tubedRegression(self): if not self.deltas: self.deltas = [[None] * len(self.contAttributes) for x in xrange(len(self.data))] |
nPoints = 100.0/nExamples/self.dimension | nPoints = 100.0/nExamples/len(dimensions) | def tubedRegression(self): if not self.deltas: self.deltas = [[None] * len(self.contAttributes) for x in xrange(len(self.data))] |
span = (maxV - minV) /2 / math.log(.001) | def tubedRegression(self): if not self.deltas: self.deltas = [[None] * len(self.contAttributes) for x in xrange(len(self.data))] | |
for ex in self.findNearest(ref_example, 0, True): | nn = self.findNearest(ref_example, 30, True) mx = max([abs(ex[contIdx] - ref_x) for ex in nn if not ex[contIdx].isSpecial()]) if not mx: self.deltas[exi][d] = "?" continue kw = math.log(.001) / mx**2 for ex in nn: | def tubedRegression(self): if not self.deltas: self.deltas = [[None] * len(self.contAttributes) for x in xrange(len(self.data))] |
w = math.exp(-((ex_x-ref_x)/span)**2) | w = math.exp(kw*(ex_x-ref_x)**2) | def tubedRegression(self): if not self.deltas: self.deltas = [[None] * len(self.contAttributes) for x in xrange(len(self.data))] |
[self.D, None, self.tubedRegression][self.method]() | [self.D, self.starRegression, self.tubedRegression][self.method]() | def apply(self): import orngMisc data = self.data if not data: self.send("Examples", None) return |
signalManager.signalProcessingInProgress += 1 | manager = self.widget.signalManager if not manager: manager = signalManager manager.signalProcessingInProgress += 1 | def __call__(self, *k): signalManager.signalProcessingInProgress += 1 try: apply(self.method, k) finally: signalManager.signalProcessingInProgress -= 1 if not signalManager.signalProcessingInProgress: signalManager.processNewSignals(self.widget) |
signalManager.signalProcessingInProgress -= 1 if not signalManager.signalProcessingInProgress: signalManager.processNewSignals(self.widget) | manager.signalProcessingInProgress -= 1 if not manager.signalProcessingInProgress: manager.processNewSignals(self.widget) | def __call__(self, *k): signalManager.signalProcessingInProgress += 1 try: apply(self.method, k) finally: signalManager.signalProcessingInProgress -= 1 if not signalManager.signalProcessingInProgress: signalManager.processNewSignals(self.widget) |
self.curveSymbols = [QwtSymbol.Ellipse, QwtSymbol.XCross, QwtSymbol.Rect, QwtSymbol.Triangle, QwtSymbol.Diamond, QwtSymbol.DTriangle, QwtSymbol.UTriangle, QwtSymbol.LTriangle, QwtSymbol.RTriangle, QwtSymbol.Cross] | self.curveSymbols = [QwtSymbol.Ellipse, QwtSymbol.Rect, QwtSymbol.Triangle, QwtSymbol.Diamond, QwtSymbol.DTriangle, QwtSymbol.UTriangle, QwtSymbol.LTriangle, QwtSymbol.RTriangle, QwtSymbol.XCross, QwtSymbol.Cross] | def __init__(self, parent = None, name = None): "Constructs the graph" OWGraph.__init__(self, parent, name) |
if data != None: for attr in data.domain: self.attributeFlipInfo[attr.name] = 0 | def setData(self, data, keepMinMaxVals = 0): # clear all curves, markers, tips self.removeAllSelections(0) # clear all selections self.removeCurves() self.removeMarkers() self.tips.removeAll() self.attributeFlipInfo = {} if not keepMinMaxVals or self.globalValueScaling == 1: self.attrValues = {} self.rawdata = data | |
self.originalData = Numeric.zeros([len(data.domain), len(data)], Numeric.Float) self.scaledData = Numeric.zeros([len(data.domain), len(data)], Numeric.Float) self.noJitteringScaledData = Numeric.zeros([len(data.domain), len(data)], Numeric.Float) self.validDataArray = Numeric.ones([len(data.domain), len(data)]) | else: self.attributeFlipInfo = dict([(attr.name, 0) for attr in data.domain]) | def setData(self, data, keepMinMaxVals = 0): # clear all curves, markers, tips self.removeAllSelections(0) # clear all selections self.removeCurves() self.removeMarkers() self.tips.removeAll() self.attributeFlipInfo = {} if not keepMinMaxVals or self.globalValueScaling == 1: self.attrValues = {} self.rawdata = data |
arr = MA.transpose(arr) arr = MA.filled(arr, MA.average(arr, 1)) self.validDataArray = Numeric.ones(Numeric.shape(arr)) self.originalData = Numeric.array(arr) self.scaledData = Numeric.zeros(Numeric.shape(arr), Numeric.Float) | arr = transpose(arr) self.validDataArray = Numeric.array(1-arr.mask(), Numeric.Int) self.originalData = arr.filled(1e20) self.scaledData = Numeric.zeros([len(data.domain), len(data)], Numeric.Float) self.noJitteringScaledData = Numeric.zeros([len(data.domain), len(data)], Numeric.Float) | def setData(self, data, keepMinMaxVals = 0): # clear all curves, markers, tips self.removeAllSelections(0) # clear all selections self.removeCurves() self.removeMarkers() self.tips.removeAll() self.attributeFlipInfo = {} if not keepMinMaxVals or self.globalValueScaling == 1: self.attrValues = {} self.rawdata = data |
self.scaledData[index] = arr[index] + (self.jitterSize/(50.0*count))*(RandomArray.random(len(data)) - 0.5) | self.scaledData[index] = arr[index].filled(1e20) + (self.jitterSize/(50.0*count))*(RandomArray.random(len(data)) - 0.5) | def setData(self, data, keepMinMaxVals = 0): # clear all curves, markers, tips self.removeAllSelections(0) # clear all selections self.removeCurves() self.removeMarkers() self.tips.removeAll() self.attributeFlipInfo = {} if not keepMinMaxVals or self.globalValueScaling == 1: self.attrValues = {} self.rawdata = data |
line = arr[index].copy() + self.jitterSize/50.0 * (0.5 - RandomArray.random(len(data))) | line = arr[index] + self.jitterSize/50.0 * (0.5 - RandomArray.random(len(data))) | def setData(self, data, keepMinMaxVals = 0): # clear all curves, markers, tips self.removeAllSelections(0) # clear all selections self.removeCurves() self.removeMarkers() self.tips.removeAll() self.attributeFlipInfo = {} if not keepMinMaxVals or self.globalValueScaling == 1: self.attrValues = {} self.rawdata = data |
self.scaledData[index] = line | self.scaledData[index] = line.filled(1e20) | def setData(self, data, keepMinMaxVals = 0): # clear all curves, markers, tips self.removeAllSelections(0) # clear all selections self.removeCurves() self.removeMarkers() self.tips.removeAll() self.attributeFlipInfo = {} if not keepMinMaxVals or self.globalValueScaling == 1: self.attrValues = {} self.rawdata = data |
self.scaledData[index] = arr[index] self.noJitteringScaledData = arr | self.scaledData[index] = arr[index].filled(1e20) self.noJitteringScaledData = arr.filled(1e20) | def setData(self, data, keepMinMaxVals = 0): # clear all curves, markers, tips self.removeAllSelections(0) # clear all selections self.removeCurves() self.removeMarkers() self.tips.removeAll() self.attributeFlipInfo = {} if not keepMinMaxVals or self.globalValueScaling == 1: self.attrValues = {} self.rawdata = data |
for i in imputer(examples)(examples): print i | def __call__(self, examples, weight=0): imputer = getattr(self, "imputer", None) or None if getattr(self, "removeMissing", 0): examples = orange.Preprocessor_dropMissing(examples) | |
else: attributes = orngVisFuncts.evaluateAttributes(self.parent.data, contMeasures[self.attrCont][1], discMeasures[self.attrDisc][1]) | else: attributes = orngVisFuncts.evaluateAttributes(self.parent.data, contMeasures[self.parent.attrCont][1], discMeasures[self.parent.attrDisc][1]) | def updateGraph(self): black = QColor(0,0,0) white = QColor(255,255,255) self.graph.clear() self.graph.removeMarkers() if self.results == None or self.dialogType not in [VIZRANK, CLUSTER]: return |
self.showGraph = 0 | self.showPredictionsInProjection = 0 | def __init__(self,parent=None, signalManager = None, widget = None, graph = None): OWWidget.__init__(self, parent, signalManager, "Outlier Identification", wantGraph = 1, wantStatusBar = 1) |
b2 = OWGUI.widgetBox(self.controlArea, ' Show Predictions for All Examples ') | self.showGraphCheck = OWGUI.checkBox(self.controlArea, self, 'showPredictionsInProjection', 'Color the points using class predictions', box = "Show predictions in the projection", tooltip = "For all examples show the probabilities of correct class using color intensity of points in the projection", callback = self.togg... | def __init__(self,parent=None, signalManager = None, widget = None, graph = None): OWWidget.__init__(self, parent, signalManager, "Outlier Identification", wantGraph = 1, wantStatusBar = 1) |
self.showPredictionsButton = OWGUI.button(b2, self, "Show predictions in graph", self.toggleShowPredictions) | self.showPredictionsButton = OWGUI.button(b2, self, "Show Graph Of Predictions", self.showGraphUpdate) | def __init__(self,parent=None, signalManager = None, widget = None, graph = None): OWWidget.__init__(self, parent, signalManager, "Outlier Identification", wantGraph = 1, wantStatusBar = 1) |
b3 = OWGUI.widgetBox(self.controlArea, ' Show Predictions for Selected Example ') self.showGraphCheck = OWGUI.checkBox(b3, self, 'showGraph', 'Show graph of predicted probabilities', tooltip = "Show the graph of probabilities for the selected example over the selected set of top ranked projections", callback = self.sho... | def __init__(self,parent=None, signalManager = None, widget = None, graph = None): OWWidget.__init__(self, parent, signalManager, "Outlier Identification", wantGraph = 1, wantStatusBar = 1) | |
if self.showPredictionsButton.isOn(): | if self.showPredictionsInProjection: | def toggleShowPredictions(self): if not self.widget: return if self.showPredictionsButton.isOn(): self.evaluateProjections() self.statusBar.message("Computing averages...") |
if self.showGraph: | if self.showPredictionsButton.isOn(): | def showGraphUpdate(self): if self.showGraph: self.graph.show() self.evaluateProjections() self.resize(self.controlArea.size().width() + 400, self.size().height()) self.selectedExampleChanged() else: self.graph.hide() self.resize(self.controlArea.size().width(), self.size().height()) |
if self.showGraph and self.results: | if self.showPredictionsButton.isOn() and self.results: | def selectedExampleChanged(self): if self.showGraph and self.results: projCount = min(int(self.projectionCount), len(self.results)) classCount = len(self.data.domain.classVar.values) self.graphMatrix = Numeric.transpose(Numeric.reshape(self.matrixOfPredictions[:, self.selectedExampleIndex], (projCount, classCount))) se... |
nrOfClasses = len(self.data.domain.classVar.values) | def updateGraph(self): self.graph.clear() if not self.data or not self.graphMatrix: return classColors = ColorPaletteHSV(len(self.data.domain.classVar.values)) if self.graphMatrix == None: return | |
for j in range(nrOfClasses): | for j in classes: | def updateGraph(self): self.graph.clear() if not self.data or not self.graphMatrix: return classColors = ColorPaletteHSV(len(self.data.domain.classVar.values)) if self.graphMatrix == None: return |
xDiff = self.graphMatrix[j][i] | (prob, index) = indices[i] xDiff = self.graphMatrix[j][index] | def updateGraph(self): self.graph.clear() if not self.data or not self.graphMatrix: return classColors = ColorPaletteHSV(len(self.data.domain.classVar.values)) if self.graphMatrix == None: return |
count = 0 | list = [] | def addWidget(self, widget): newwidget = orngCanvasItems.CanvasWidget(self.canvas, widget, self.canvasDlg.defaultPic, self.canvasDlg) x = self.canvasView.contentsX() + 10 for w in self.widgets: x = max(w.x() + 90, x) x = x/10*10 y = 150 newwidget.move(x,y) |
count = count+1 if count > 0: newwidget.caption = newwidget.caption + " (" + str(count+1) + ")" | list.append(item.caption) i = 1; found = 0 while not found: if newwidget.caption + " (" + str(i) + ")" not in list: found = 1 newwidget.caption = newwidget.caption + " (" + str(i) + ")" else: i += 1 | def addWidget(self, widget): newwidget = orngCanvasItems.CanvasWidget(self.canvas, widget, self.canvasDlg.defaultPic, self.canvasDlg) x = self.canvasView.contentsX() + 10 for w in self.widgets: x = max(w.x() + 90, x) x = x/10*10 y = 150 newwidget.move(x,y) |
normalList("DTNode", "lib_learner.cpp") | normalList("TreeNode", "lib_learner.cpp") | def normalList(name, goesto): return tuple([x % name for x in ("%sList", "%s", "P%sList", "T%sList", "P%s")] + [goesto]) |
x = offsetx + lineskip*(j+1) | x = offsetx + lineskip*(j+1.5) | def Matrix(self,labels, diss, vlabels=[], margin = 10, hook = 10, block = None, line_size = 2.0, canvas = None): # prevent divide-by-zero... if len(labels) < 2: return canvas ## ADJUST DIMENSIONS ### if canvas == None: tcanvas = piddlePIL.PILCanvas() else: tcanvas = canvas normal = piddle.Font(face="Courier") if le... |
y = offsety + lineskip*(i+1) | y = offsety + lineskip*(i+1.5) | def Matrix(self,labels, diss, vlabels=[], margin = 10, hook = 10, block = None, line_size = 2.0, canvas = None): # prevent divide-by-zero... if len(labels) < 2: return canvas ## ADJUST DIMENSIONS ### if canvas == None: tcanvas = piddlePIL.PILCanvas() else: tcanvas = canvas normal = piddle.Font(face="Courier") if le... |
def SMACOFstepsimple(self): self.getDistance() R = resize(array([0.0]),(self.n,self.n)) sumv = array([0.0]*self.n) for i in xrange(self.n): for j in xrange(self.n): if i != j: if self.dist[i][j] > 1e-6: s = 1.0/self.dist[i][j] else: s = 0.0 t = (self.W[i][j]*self.O[i][j] + (1-self.W[i][j])*self.dist[i][j])*s R[i][j... | def SMACOFstepsimple(self): # compute the R (n*n) matrix self.getDistance() R = resize(array([0.0]),(self.n,self.n)) sumv = array([0.0]*self.n) for i in xrange(self.n): for j in xrange(self.n): if i != j: if self.dist[i][j] > 1e-6: s = 1.0/self.dist[i][j] else: s = 0.0 # the closer the value to 1.0, the better it is t ... | |
self.text.show() | def __init__(self, signalManager, canvasDlg, view, outWidget, inWidget, canvas, *args): apply(QCanvasLine.__init__,(self,canvas)+ args) self.signalManager = signalManager self.canvasDlg = canvasDlg self.outWidget = outWidget self.inWidget = inWidget self.view = view self.setZ(-10) self.signals = [] self.colors = [] out... | |
self.sortedAttrList = None | self.sortedAttrList = [] | def __init__(self): S2NMeasure.__init__(self) self.attrInfoMix = {} self.dataMix = None self.sortedAttrList = None |
def __call__(self, table, weight, verbose=0): | def __call__(self, table, weight=None, folds=5, verbose=0): | def __call__(self, table, weight, verbose=0): import types, whrandom import orange, orngTest, orngStat if (type(self.parameter)==types.ListType) or (type(self.parameter)==types.TupleType): to_set=[self.findobj(ld) for ld in self.parameter] else: to_set=[self.findobj(self.parameter)] |
cvind = orange.MakeRandomIndicesCV(table, 5) | cvind = orange.MakeRandomIndicesCV(table, folds) | def __call__(self, table, weight, verbose=0): import types, whrandom import orange, orngTest, orngStat if (type(self.parameter)==types.ListType) or (type(self.parameter)==types.TupleType): to_set=[self.findobj(ld) for ld in self.parameter] else: to_set=[self.findobj(self.parameter)] |
res=evaluate(orngTest.testWithIndices([self.object], (table, weight), cvind)) | if weight==None: res=evaluate(orngTest.testWithIndices([self.object], (table), cvind)) else: res=evaluate(orngTest.testWithIndices([self.object], (table, weight), cvind)) | def __call__(self, table, weight, verbose=0): import types, whrandom import orange, orngTest, orngStat if (type(self.parameter)==types.ListType) or (type(self.parameter)==types.TupleType): to_set=[self.findobj(ld) for ld in self.parameter] else: to_set=[self.findobj(self.parameter)] |
print par, res | print 'orngWrap:\n', par, res | def __call__(self, table, weight, verbose=0): import types, whrandom import orange, orngTest, orngStat if (type(self.parameter)==types.ListType) or (type(self.parameter)==types.TupleType): to_set=[self.findobj(ld) for ld in self.parameter] else: to_set=[self.findobj(self.parameter)] |
return self.object(table) | classifier = self.object(table) classifier.fittedParameter = bestpar return classifier | def __call__(self, table, weight, verbose=0): import types, whrandom import orange, orngTest, orngStat if (type(self.parameter)==types.ListType) or (type(self.parameter)==types.TupleType): to_set=[self.findobj(ld) for ld in self.parameter] else: to_set=[self.findobj(self.parameter)] |
def __init__(self, t): | def __init__(self, t, save_data=1): | def __init__(self, t): t = self._prepare(t) self.discData = t # save the discretized data ### PREPARE INDIVIDUAL ATTRIBUTES ### |
self.discData = t | if save_data: self.discData = t | def __init__(self, t): t = self._prepare(t) self.discData = t # save the discretized data ### PREPARE INDIVIDUAL ATTRIBUTES ### |
def exportGraph(self, f, absolute_int=10, positive_int = 0, negative_int = 0, best_attributes = 0, print_bits = 1, black_white = 0, significant_digits = 2, postscript = 1, pretty_names = 1, url = 0): | def exportGraph(self, f, absolute_int=10, positive_int = 0, negative_int = 0, best_attributes = 0, print_bits = 1, black_white = 0, significant_digits = 2, postscript = 1, pretty_names = 1, url = 0, widget_coloring=1): | def exportGraph(self, f, absolute_int=10, positive_int = 0, negative_int = 0, best_attributes = 0, print_bits = 1, black_white = 0, significant_digits = 2, postscript = 1, pretty_names = 1, url = 0): NA = len(self.names) |
color = "green" | if widget_coloring: color = "green" else: color = '"0.0 %f 0.9"'%(0.3+0.7*perc/100.0) | def exportGraph(self, f, absolute_int=10, positive_int = 0, negative_int = 0, best_attributes = 0, print_bits = 1, black_white = 0, significant_digits = 2, postscript = 1, pretty_names = 1, url = 0): NA = len(self.names) |
color = "red" | if widget_coloring: color = "red" else: color = '"0.5 %f 0.9"'%(0.3+0.7*perc/100.0) | def exportGraph(self, f, absolute_int=10, positive_int = 0, negative_int = 0, best_attributes = 0, print_bits = 1, black_white = 0, significant_digits = 2, postscript = 1, pretty_names = 1, url = 0): NA = len(self.names) |
return cdt.C + cdt.D + cdt.T == 0 | return cdt.C + cdt.D + cdt.T < 1e-20 | def isCDTEmpty(cdt): return cdt.C + cdt.D + cdt.T == 0 |
cdt = cdtComputer(*(all_ite, ) + computerArgs) if not isCDTEmpty(cdt[0]): | cdts = cdtComputer(*(all_ite, ) + computerArgs) if not isCDTEmpty(cdts[0]): | def AUC_x(cdtComputer, ite, all_ite, divideByIfIte, computerArgs): cdts = cdtComputer(*(ite, ) + computerArgs) if not isCDTEmpty(cdts[0]): return [(cdt.C+cdt.T/2)/(cdt.C+cdt.D+cdt.T)/divideByIfIte for cdt in cdts], True if all_ite: cdt = cdtComputer(*(all_ite, ) + computerArgs) if not isCDTEmpty(cdt[0]): return [(cdt.... |
def addCategory(self, text, checked = 1): check = QCheckBox(text, self.topLayout) | def addCategory(self, text, checked = 1, indent = 0): if indent: box = QHBox(self.topLayout) QWidget(box).setFixedSize(19, 8) check = QCheckBox(text, box) else: check = QCheckBox(text, self.topLayout) check.setChecked(checked) | def addCategory(self, text, checked = 1): check = QCheckBox(text, self.topLayout) self.checkBoxes.append(check) check.setChecked(checked) self.folders.append(text) |
check.setChecked(checked) | def addCategory(self, text, checked = 1): check = QCheckBox(text, self.topLayout) self.checkBoxes.append(check) check.setChecked(checked) self.folders.append(text) | |
self.resize(500,500) | self.resize(600,600) | def __init__(self,*args): apply(QMainWindow.__init__,(self,) + args) self.resize(500,500) self.setCaption("Qt Orange Update") self.toolbar = QToolBar(self, 'toolbar') self.statusBar = QStatusBar(self) self.text = QTextView (self) self.setCentralWidget(self.text) self.statusBar.message('Ready') |
self.addText("Current versions of Orange files were successfully located.") | def __init__(self,*args): apply(QMainWindow.__init__,(self,) + args) self.resize(500,500) self.setCaption("Qt Orange Update") self.toolbar = QToolBar(self, 'toolbar') self.statusBar = QStatusBar(self) self.text = QTextView (self) self.setCentralWidget(self.text) self.statusBar.message('Ready') | |
self.addText("Orange update failed to locate file '%s'. There is no information about current versions of Orange files." %(self.downfile), 0) self.addText("To check for newer versions of files click the 'Update Files' button.") | pass self.addText("To check for newer versions of files click the 'Update Files' button.", nobr = 0) | def __init__(self,*args): apply(QMainWindow.__init__,(self,) + args) self.resize(500,500) self.setCaption("Qt Orange Update") self.toolbar = QToolBar(self, 'toolbar') self.statusBar = QStatusBar(self) self.text = QTextView (self) self.setCentralWidget(self.text) self.statusBar.message('Ready') |
self.updateMissingFilesCB = QCheckBox("Update missing files", self.toolbar) self.updateMissingFilesCB.setChecked(1) | self.downloadNewFilesCB = QCheckBox("Download new files", self.toolbar) self.downloadNewFilesCB.setChecked(1) | def __init__(self,*args): apply(QMainWindow.__init__,(self,) + args) self.resize(500,500) self.setCaption("Qt Orange Update") self.toolbar = QToolBar(self, 'toolbar') self.statusBar = QStatusBar(self) self.text = QTextView (self) self.setCentralWidget(self.text) self.statusBar.message('Ready') |
self.addText("Failed to locate file '%s'. There is no information on Orange folders that need to be updated." %(self.downfile), 0) self.addText("No folders found.") | self.addText("Failed to locate file '%s'. There is no information on installed Orange files." %(self.downfile), nobr = 0) | def showFolders(self): self.updateGroups = [] self.dontUpdateGroups = [] try: vf = open(self.downfile) self.downstuff, self.updateGroups, self.dontUpdateGroups = self.readLocalVersionFile(vf.readlines(), updateGroups = 1) vf.close() except: self.addText("Failed to locate file '%s'. There is no information on Orange fol... |
dlg = foldersDlg("Check the list of folders you wish to update:", None, "", 1) for group in self.updateGroups: if group not in self.dontUpdateGroups: dlg.addCategory(group, 1) for group in self.dontUpdateGroups: dlg.addCategory(group, 0) | dlg = foldersDlg("Check Orange folders that you wish to update:", None, "", 1) dlg.addCategory("Orange Canvas", groupDict.get("Orange Canvas", 1)) dlg.addCategory("Documentation", groupDict.get("Documentation", 1)) dlg.addCategory("Orange Root", groupDict.get("Orange Root", 1)) dlg.addLabel("Orange Widgets:") for (gro... | def showFolders(self): self.updateGroups = [] self.dontUpdateGroups = [] try: vf = open(self.downfile) self.downstuff, self.updateGroups, self.dontUpdateGroups = self.readLocalVersionFile(vf.readlines(), updateGroups = 1) vf.close() except: self.addText("Failed to locate file '%s'. There is no information on Orange fol... |
def addText(self, text, nobr = 1): if nobr: self.text.append("<nobr>" + text + "</nobr>\n") else: self.text.append(text) self.text.ensureVisible(0, self.text.contentsHeight()) | def showFolders(self): self.updateGroups = [] self.dontUpdateGroups = [] try: vf = open(self.downfile) self.downstuff, self.updateGroups, self.dontUpdateGroups = self.readLocalVersionFile(vf.readlines(), updateGroups = 1) vf.close() except: self.addText("Failed to locate file '%s'. There is no information on Orange fol... | |
if len(dirs) >= 2 and dirs[0].lower() == "orangewidgets" and dirs[1] not in updateGroups and dirs[1].lower() != "icons": | if len(dirs) >= 2 and dirs[0].lower() == "orangewidgets" and dirs[1] not in updateGroups + dontUpdateGroups and dirs[1].lower() != "icons": | def readLocalVersionFile(self, data, updateGroups = 1): versions = {} updateGroups = []; dontUpdateGroups = [] for line in data: if not line: continue line = line.replace("\r", "") # replace \r in case of linux files line = line.replace("\n", "") if not line: continue if line[0] == "+": updateGroups.append(line[1:])... |
self.addText("Starting updating new files") self.addText("Reading file status from server") | self.addText("Reading file status from web server") | def executeUpdate(self): self.addText("Starting updating new files") self.addText("Reading file status from server") |
self.addText("Failed to locate file '%s'." %(self.downfile)) res = QMessageBox.information(self,'Update Orange',"We were unable to locate file 'whatsdown.txt'. This file contains information about versions of your local Orange files.\nThere are 2 solutions. \nIf you press 'Replace all' you will replace all your local f... | res = QMessageBox.information(self,'Update Orange',"There is no 'whatsdown.txt' file. This file contains information about versions of your local Orange files.\nIf you press 'Download Latest Files' you will replace all your local Orange files with the latest versions from the web.\n",'Download Latest Files', "Cancel", ... | def executeUpdate(self): self.addText("Starting updating new files") self.addText("Reading file status from server") |
self.addText("Searching for new widget categories...") | def executeUpdate(self): self.addText("Starting updating new files") self.addText("Reading file status from server") | |
self.addText("New category found: <b>%s</b>" % (category)) | def executeUpdate(self): self.addText("Starting updating new files") self.addText("Reading file status from server") | |
else: self.addText("No new categories were found.") | def executeUpdate(self): self.addText("Starting updating new files") self.addText("Reading file status from server") | |
self.addText("<hr>\nUpdating files...") | self.addText("<hr>Updating files...") | def executeUpdate(self): self.addText("Starting updating new files") self.addText("Reading file status from server") |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.