def __init__(self, parent=None, signalManager=None): OWRpy.__init__(self) self.setRvariableNames(["strptime"]) self.data = {} self.RFunctionParam_x = '' self.inputs.addInput("x", _("Input Data"), signals.RDataFrame.RDataFrame, self.processx) self.outputs.addOutput("strptime Output", _("strptime Output"), signals.RDataFrame.RDataFrame) self.columnSelection = redRcomboBox(self.controlArea, label=_("Data Column:")) self.RFunctionParamformat_comboBox = redRcomboBox( self.controlArea, label="format:", items=[ _("yyyymmdd"), _("yymmdd"), _("ddmmyyyy"), _("ddmmyy"), _("mmddyyyy"), _("mmddyy") ], toolTip= _("Select the format of the date time. y is year m is month and d is day." )) redRCommitButton(self.bottomAreaRight, "Commit", callback=self.commitFunction)
def __init__(self, signalManager=None): OWRpy.__init__(self) self.setRvariableNames( ['score', 'mergedmatrix', 'mergedvals', 'tempmerge']) self.data = {} self.RFunctionParam_data = '' self.RFunctionParam_score = '' self.inputs.addInput("data", _("Sample Data"), signals.RDataFrame.RDataFrame, self.processdata) self.inputs.addInput("scoremat", _("Scoring Matrix"), signals.RDataFrame.RDataFrame, self.processscores) self.outputs.addOutput("fscoremat", _("Sored Samples"), signals.RDataFrame.RDataFrame) self.outputs.addOutput("maxScore", _("Max Scored Class"), signals.RVector.RVector) wb = redRwidgetBox(self.controlArea, orientation='horizontal') self.scoremethod = redRcomboBox( wb, label=_('Scoring Method'), items=[_('Multiplication'), _('Correlation')], callback=self.commitFunction) redRCommitButton(self.bottomAreaRight, _("Commit"), callback=self.commitFunction) self.RoutputWindow = redRfilterTable(wb, label=_('Scores'), displayLabel=False, sortable=True, filterable=False)
def __init__(self, parent=None, signalManager=None): OWRpy.__init__(self) self.setRvariableNames(["rbind"]) self.data = {} self.RFunctionParam_x = '' self.inputs.addInput( "x", _("Data"), [signals.RDataFrame.RDataFrame, signals.RVector.RVector], self.processx, multiple=True) self.outputs.addOutput("rbind Output", _("Joined Data"), signals.RDataFrame.RDataFrame) self.rowcolnames = redRcomboBox( self.controlArea, label=_('Source of Row / Column Names:'), callback=self.commitFunction) self.bindingMode = redRRadioButtons(self.controlArea, label=_('Binding Mode:'), buttons=[_('Row'), _('Column')], setChecked=_('Row')) self.RFunctionParamdeparse_level_lineEdit = redRlineEdit( self.controlArea, label=_("Deparse Level:"), text='1') redRCommitButton(self.bottomAreaRight, _("Commit"), callback=self.commitFunction)
def __init__(self, parent=None, signalManager=None): OWRpy.__init__(self) self.require_librarys(["caret"]) self.setRvariableNames(["train", 'tempData']) self.data = {} self.RFunctionParam_data = '' self.inputs.addInput("data", "data", [ signals.RArbitraryList.RArbitraryList, signals.RDataFrame.RDataFrame ], self.processdata) self.outputs.addOutput("train Output", "train Output", signals.RModelFit.RModelFit) self.trainingData = redRcomboBox(self.controlArea, label='Training Data:') self.RFunctionParamcustomArgs_lineEdit = redRlineEdit( self.controlArea, label="customArgs:", text='') #self.RFunctionParamtrControl_lineEdit = redRlineEdit(self.controlArea, label = "trControl:", text = '') self.RFunctionParammethod_comboBox = redRcomboBox( self.controlArea, label="Method:", items=[ "ada", "bagEarth", "bagFDA", "blackboost", "cforest", "ctree", "ctree2", "earth", "enet", "fda", "gamboost", "gaussprPoly", "gaussprRadial", "gaussprLinear", "gbm", "glm", "glmboost", "glmnet", "gpls", "J48", "JRip", "knn", "lars", "lasso", "lda", "Linda", "lm", "lmStepAIC", "LMT", "logitBoost", "lssvmPoly", "lssvmRadial", "lvq", "M5Rules", "mda", "multinom", "nb", "nnet", "nodeHarvest", "OneR", "pam", "pcaNNet", "pcr", "pda", "pda2", "penalized", "pls", "ppr", "qda", "QdaCov", "rda", "rf", "rlm", "rpart", "rvmLinear", "rvmPoly", "rvmRadial", "sda", "sddaLDA", "sddaQDA", "slda", "smda", "sparseLDA", "spls", "stepLDA", "stepQDA", "superpc", "svmPoly", "svmRadial", "svmLinear", "treebag", "vbmpRadial" ]) #self.formula = redRRFormulaEntry(self.controlArea) self.resultVariable = redRcomboBox(self.controlArea, label='Class Data:') self.RFunctionParamform_lineEdit = redRlineEdit(self.controlArea, label="form:", text='') self.RoutputWindow = redRtextEdit(self.controlArea, label="R Output Window") redRCommitButton(self.bottomAreaRight, "Commit", callback=self.commitFunction)
def __init__(self, parent=None, signalManager=None): OWRpy.__init__(self) self.require_librarys(["caret"]) self.setRvariableNames(["createDataPartition", 'dataOutputList']) self.data = {} self.RFunctionParam_y = '' self.inputs.addInput("y", "Input Vector List", signals.RDataFrame.RDataFrame, self.processy) self.outputs.addOutput("createDataPartition Output","Partition/Resample/Fold List", signals.RList.RList) self.outputs.addOutput("dataOutputList", "Data Output List \n(Subsets of data that matches the partitioning)", signals.RList.RList) self.ListElementCombo = redRcomboBox(self.controlArea, label = 'List Element (Vector):') self.functionCombo = redRcomboBox(self.controlArea, label = 'Function:', items = ['Partition', 'Resample', 'Fold']) self.RFunctionParamp_spinBox = redRSpinBox(self.controlArea, label = "Percentage (Partition):", value = 50, min = 1, max = 100) #self.RFunctionParamlist_radioButtons = redRradioButtons(self.controlArea, label = "list:", buttons = ["TRUE"], setChecked = "") self.RFunctionParamgroups_spinBox = redRSpinBox(self.controlArea, label = "Number of Quantiles (Partition on Numeric Data):", value = 5, min = 1) self.RFunctionParamtimes_spinBox = redRSpinBox(self.controlArea, label = "Number of Partitions (Partition and Resample):", value = 1, min = 1, toolTip = 'Typically higher values are set for resampling because one wants to generate several resamples at once.') self.RFunctionParam_folds_spinBox = redRSpinBox(self.controlArea, label = "Number of Folds (Folds):", value = 10, min = 1) redRCommitButton(self.bottomAreaRight, "Commit", callback = self.commitFunction) self.RoutputWindow = redRtextEdit(self.controlArea, label = "R Output Window")
def __init__(self, parent=None, signalManager=None): OWRpy.__init__(self) self.setRvariableNames(["predict", 'tempData']) self.data = {} self.RFunctionParam_object = '' self.RFunctionParam_newData = '' self.inputs.addInput("object", "object", signals.RModelFit.RModelFit, self.processobject) self.inputs.addInput("newData", "newData", [ signals.RArbitraryList.RArbitraryList, signals.RDataFrame.RDataFrame ], self.processnewData) self.outputs.addOutput("predict Output", "predict Output", signals.RModelFit.RModelFit) self.testData = redRcomboBox(self.controlArea, label='Test Data:') self.classLabels = redRcomboBox(self.controlArea, label='Class Labels:') redRCommitButton(self.bottomAreaRight, "Commit", callback=self.commitFunction) self.RoutputWindow = redRtextEdit(self.controlArea, label="R Output Window")
def __init__(self, parent=None, signalManager=None): OWRpy.__init__(self) self.RFunctionParam_height = '' self.inputs.addInput("height", "Plotting Vector", signals.RList.RList, self.processheight) self.RFunctionParammain_lineEdit = redRlineEdit(self.controlArea, label = "main:", text = '') self.RFunctionParamhoriz_lineEdit = redRlineEdit(self.controlArea, label = "horiz:", text = '') self.namesBox = redRcomboBox(self.controlArea, label = 'Data Element:', callback = self.commitFunction) self.RFunctionParamspace_lineEdit = redRSpinBox(self.controlArea, label = "Space:", min = 0, max = 99, value = 5) self.RFunctionParamxlab_lineEdit = redRlineEdit(self.controlArea, label = "xlab:", text = '') self.plotArea = redRgraphicsView(self.controlArea,label='Bar Plot', displayLabel=False) self.commit = redRCommitButton(self.bottomAreaRight, "Commit", callback = self.commitFunction, processOnInput=True)
def __init__(self, parent=None, signalManager=None): OWRpy.__init__(self) self.setRvariableNames(["melt"]) self.require_librarys(["reshape"]) self.data = {} self.RFunctionParam_data = '' self.inputs.addInput("data", "Data Table", signals.RDataFrame.RDataFrame, self.processdata) self.outputs.addOutput("melt Output","Molten Data", signals.RDataFrame.RDataFrame) self.RFunctionParamna_rm_radioButtons = redRradioButtons(self.controlArea, label = "Remove NA's:", buttons = ["TRUE","FALSE"], setChecked = "TRUE") self.RFunctionParammeasure_vars_comboBox = redRcomboBox(self.controlArea, label = "Measure Variables (Values):") self.RFunctionParamvariable_name_lineEdit = redRlineEdit(self.controlArea, label = "New Variable Column Name:", text = 'variable') self.RFunctionParamid_vars_listBox = redRListBox(self.controlArea, label = "id_vars:") self.RFunctionParamid_vars_listBox.setSelectionMode(QAbstractItemView.ExtendedSelection) redRCommitButton(self.bottomAreaRight, "Commit", callback = self.commitFunction) self.RoutputWindow = redRtextEdit(self.controlArea, label = "R Output Window")
def __init__(self, parent=None, signalManager=None): OWRpy.__init__(self) self.require_librarys(["caret"]) self.setRvariableNames(["preProcess", 'preProcess_values']) self.data = {} self.RFunctionParam_x = '' self.inputs.addInput("x", "x", signals.RList.RList, self.processx) self.outputs.addOutput("preProcess Output", "preProcess Output", signals.RModelFit.RModelFit) self.outputs.addOutput('preProcess_values', 'Processed Values', signals.RList.RList) self.trainingElement = redRcomboBox(self.controlArea, lable='Training Dataset:') self.RFunctionParamthresh_spinBox = redRSpinBox( self.controlArea, label="Threshold (PCA):", value=95, min=1, max=99) self.RFunctionParammethod_listBox = redRListBox( self.controlArea, label="Method:", items=["center", "scale", "pca", "spatilaSign"], toolTip= 'Select the options to be applied to the data. If nothing is selected then center and scale will be applied by default' ) for i in range(self.RFunctionParammethod_listBox.count()): if unicode(self.RFunctionParammethod_listBox.item(i).text()) in [ 'center', 'scale' ]: self.RFunctionParammethod_listBox.setItemSelected( self.RFunctionParammethod_listBox.item(i), True) redRCommitButton(self.bottomAreaRight, "Commit", callback=self.commitFunction)
def __init__(self, parent=None, signalManager=None): OWRpy.__init__(self) self.setRvariableNames(["cast"]) self.data = {} self.require_librarys(["reshape"]) self.RFunctionParam_data = '' self.inputs.addInput("data", "Molten Data", signals.RDataFrame.RDataFrame, self.processdata) self.outputs.addOutput("cast Output", "Reshaped Data", signals.RDataFrame.RDataFrame) self.RFunctionParamformula_listBox = redRListBox( self.controlArea, label="Reshape Variables:") self.RFunctionParamformula_listBox.setSelectionMode( QAbstractItemView.ExtendedSelection) self.RFunctionParamfun_aggregate_lineEdit = redRcomboBox( self.controlArea, label="Aggregating Function:", items=['NULL', 'mean', 'median', 'mode', 'range']) redRCommitButton(self.bottomAreaRight, "Commit", callback=self.commitFunction) self.RoutputWindow = redRtextEdit(self.controlArea, label="R Output Window")
def __init__(self, parent=None, signalManager=None): #Here we init the parent class of our widget OWRpy. OWRpy.__init__(self) #create a R variable cor in the R session. #the output variable will not conflict with some other widgets variables self.setRvariableNames(["distri"]) # Define the outputs of this widget self.outputs.addOutput('id0', 'Results', redRRVector) #START THE GUI LAYOUT area = widgetBox(self.controlArea,orientation='horizontal') options = widgetBox(area,orientation='vertical') area.layout().setAlignment(options,Qt.AlignTop) self.count = RedRSpinBox(options, label='# Observations to Generate', min = 0,max=60000000, value = 10) self.methodButtons = redRcomboBox(options, label = "Distributions", items = [("rnorm", "Normal"), ('rbeta','Beta'), ('rbinom','Binomial'), ('rcauchy','Cauchy'), ('rchisq','Chi Square'), ('rexp','Exponential'), ('rf','F'), ('rgamma','Gamma') ], editable=True, callback = self.onDistChange) textBoxWidth = 70 self.distOptions = widgetBox(options) self.normalDist = groupBox(self.distOptions,label='Normal Distribution') self.normMean = redRlineEdit(self.normalDist, label='Mean',id='mean', text='0', width=textBoxWidth) self.normSD = redRlineEdit(self.normalDist, label='Standard Deviations',id='sd', text='1',width=textBoxWidth) self.betaDist = groupBox(self.distOptions,label='Beta Distribution') self.betaShape1 = redRlineEdit(self.betaDist, label='Shape 1', id='shape1', width=textBoxWidth,text='1') self.betaShape2 = redRlineEdit(self.betaDist, label='Shape 2', id='shape2', width=textBoxWidth,text='1') self.betaNCP = redRlineEdit(self.betaDist, label='Non-centrality', id='ncp', width=textBoxWidth,text='0') self.betaDist.hide() self.binomDist = groupBox(self.distOptions,label='Binomial Distribution') self.binomSize = redRlineEdit(self.binomDist, label='Size', id='size', width=textBoxWidth,text='1') self.binomProb = redRlineEdit(self.binomDist, label='Probability', id='prob', width=textBoxWidth,text='.5') self.binomDist.hide() self.cauchyDist = groupBox(self.distOptions,label='Cauchy Distribution') self.cauchyLocation = redRlineEdit(self.cauchyDist, label='Location', id='location', width=textBoxWidth,text='0') self.cauchyScale = redRlineEdit(self.cauchyDist, label='Scale', id='scale', width=textBoxWidth,text='1') self.cauchyDist.hide() self.gammaDist = groupBox(self.distOptions,label='Gamma Distribution') self.gammaShape = redRlineEdit(self.gammaDist, label='Shape', id='location', width=textBoxWidth,text='1') self.gammaRate = redRlineEdit(self.gammaDist, label='Rate', id='scale', width=textBoxWidth,text='1') self.gammaScale = redRlineEdit(self.gammaDist, label='Scale', id='scale', width=textBoxWidth,text='.5') self.gammaDist.hide() self.chiDist = groupBox(self.distOptions,label='Chi Square Distribution') self.chiDF = redRlineEdit(self.chiDist, label='Degrees of Freedom', id='df', width=textBoxWidth,text='1') self.chiNCP = redRlineEdit(self.chiDist, label='Non-centrality', id='ncp', width=textBoxWidth,text='0') self.chiDist.hide() self.fDist = groupBox(self.distOptions,label='F Distribution') self.fDF1 = redRlineEdit(self.fDist, label='Degrees of Freedom 1', id='df1', width=textBoxWidth,text='1') self.fDF2 = redRlineEdit(self.fDist, label='Degrees of Freedom 2', id='df2', width=textBoxWidth,text='1') self.fNCP = redRlineEdit(self.fDist, label='Non-centrality', id='ncp', width=textBoxWidth,text='0') self.fDist.hide() self.expDist = groupBox(self.distOptions,label='Exponential Distribution') self.expRate = redRlineEdit(self.expDist, label='Rate ', id='rate', width=textBoxWidth,text='1') self.expDist.hide() commit = redRCommitButton(options, "Commit", toolTip='Calculate values', callback = self.commitFunction) options.layout().setAlignment(commit, Qt.AlignRight)