input
stringlengths
10
828
output
stringlengths
5
107
private jmenu item get about menu item if about menu item null about menu item new jmenu item about menu item set background econtyc data werte tffarbe about menu item set text strings get string gui 1 non nls 1 about menu item add action listener new action listener public void action performed action event e about jdialog about dialog get about jdialog point loc get jframe get location loc translate 20 20 about dialog set location loc about dialog set visible true return about menu item
this method initializes j menu item
private jmenu item get exit menu item if exit menu item null exit menu item new jmenu item exit menu item set background econtyc data werte tffarbe exit menu item set text strings get string gui 2 non nls 1 exit menu item add action listener new action listener public void action performed action event e system exit 0 return exit menu item
this method initializes j menu item
public int get prokuristenkosten int prokuristenkosten 0 for int i 0 i werte rohstoffzahl i if prokurist i if werte rohstoff i 3 1 prokuristenkosten int werte rohstoff i 1 2 else prokuristenkosten int werte rohstoff werte rohstoff i 3 1 werte rohstoff i 4 200 return prokuristenkosten
gets the prokuristenkosten
private jmenu get file menu if file menu null file menu new jmenu file menu set background econtyc data werte tffarbe file menu set text strings get string gui 3 non nls 1 file menu add get menu datei neues spiel file menu add get menu datei pause file menu add get menu datei speichern file menu add get menu datei laden file menu add get menu datei optionen file menu add get exit menu item return file menu
this method initializes j menu
private jmenu get help menu if help menu null help menu new jmenu help menu set background econtyc data werte tffarbe help menu set text strings get string gui 0 non nls 1 help menu add get hilfe menu item help menu add get about menu item help menu add get menuitemkonsole return help menu
this method initializes j menu
private jmenu bar get jjmenu bar if j jmenu bar null j jmenu bar new jmenu bar j jmenu bar add get file menu j jmenu bar add get help menu j jmenu bar set background econtyc data werte tffarbe return j jmenu bar
this method initializes j jmenu bar
private jmenu item get menu datei neues spiel if menu datei neues spiel null menu datei neues spiel new jmenu item menu datei neues spiel set background econtyc data werte tffarbe menu datei neues spiel set text strings get string gui 11 non nls 1 menu datei neues spiel add action listener new java awt event action listener public void action performed java awt event action event e master neues spiel return menu datei neues spiel
this method initializes menu datei neues spiel
public jmenu item get menu datei pause if menu datei pause null menu datei pause new jmenu item menu datei pause set background econtyc data werte tffarbe menu datei pause set text strings get string gui 12 non nls 1 menu datei pause add action listener new action listener public void action performed action event evt if master is pause master set pause false else master set pause true return menu datei pause
gets the menu datei pause
public tab verwaltung get tabverwaltung if tabverwaltung null tabverwaltung new tab verwaltung this spiel tabverwaltung set preferred size new java awt dimension 767 365 tabverwaltung set border border factory create etched border bevel border lowered tabverwaltung add component listener new component adapter public void component shown component event evt tabverwaltung tf update return tabverwaltung
gets the tabverwaltung
private jtext field get tfgeld if tfgeld null tfgeld new jtext field tfgeld set background econtyc data werte tffarbe tfgeld set bounds new rectangle 705 510 76 31 tfgeld set text 0 non nls 1 return tfgeld
this method initializes tfgeld
public jtext field get tfnachrichten if tfnachrichten null tfnachrichten new jtext field tfnachrichten set background econtyc data werte tffarbe tfnachrichten set bounds new rectangle 15 510 631 31 return tfnachrichten
this method initializes tfnachrichten
public void setup from xml string xml string throws ioexception xmlexception string reader in new string reader xml string read process in in close
creates the process from the given xml
public macro handler get macro handler return this macro handler
returns the macro handler
public void store string name ioobject object this storage map put name object
returns the macro handler
public ioobject retrieve string name boolean remove if remove return this storage map remove name else return this storage map get name
retrieves the stored object
public string to string string buffer result new string buffer for data table row row this for int i 0 i get number of columns i if i 0 result append result append row get value i result append tools get line separator return result to string
dumps the complete table into a string complete data
public void add logging listener logging listener logging listener this logging listeners add logging listener
adds the given logging listener
public void remove logging listener logging listener logging listener this logging listeners remove logging listener
removes the given logging listener
public boolean data table exists string name return data table map get name null
returns true if a data table object with the given name exists
protected example table get example table return example table
gets the example table the examples are from
public void set arguments attribute args arguments args
sets the arguments indices used in future tt generate
public boolean arguments set return get input attributes length 0 arguments null
returns tt true tt if the arguments have already been set and
public void add data table data table table data table map put table get name table for logging listener listener logging listeners listener add data table table
adds the given data table
private boolean arguments ok example table input attribute input a get input attributes for int i 0 i input a length i if tools compatible arguments i input a i return false return true
checks if the arguments are compatible with the attributes specified by
public boolean equals object o if o null necessary here because otherwise the next line will throw a npe return false if this get class equals o get class return false feature generator fg feature generator o if this get function equals fg get function return false if this arguments length fg arguments length return false for int i 0 i arguments length i if this arguments i equals fg arguments i return false return true
a feature generator equals another feature generator if its class is equal
public data table get data table string name return data table map get name
returns the data table associated with the given name
private void clear data tables data table map clear
removes all data tables before running a new process
public void add report stream report stream stream report stream map put stream get name stream
this method adds a new report stream with the given name
public report stream get report stream string name if name null name length 0 if report stream map size 1 return report stream map values iterator next else return null else return report stream map get name
returns the report stream with given name
public void set mikro average double value double number of examples this value value number of examples this example count number of examples
sets the value of this estimated performance criterion
public double get fitness if minimize for fitness return 1 get average else return get average
returns the fitness
public void remove report stream string name report stream map remove name
removes this report stream from process
public void set root operator process root operator root this root operator root this operator name map clear this root operator set process this
sets the current root operator
public process root operator get root operator return root operator
delivers the current root operator
public file get process file return process file
returns the current process file
public void set weights double weights this weight sum 0 0d this class weights weights for double w this class weights this weight sum w
sets the class weights
public component get visualization component iocontainer io container viewer new confusion matrix viewer super to string positive class positive class name new string negative class name positive class name this counter return viewer
this implementation returns a confusion matrix viewer based on a jtable
public operator get operator string name return operator name map get name
returns the operator with the given name
public void count example example example int label class name map get example get nominal value label attribute int plabel class name map get example get nominal value predicted label attribute double weight 1 0d if weight attribute null weight example get value weight attribute counter label plabel weight
increases the prediction value in the matrix
public string get name return names type
returns the name
public operator get current operator return current operator
returns the operator that is currently being executed
public string get description return descriptions type
returns the description
public double get fitness return get average
returns the accuracy or 1 error
public void set current operator operator operator this current operator operator
returns the operator that is currently being executed
public component get visualization component iocontainer io container return new confusion matrix viewer to weight string class names counter
this implementation returns a confusion matrix viewer based on a jtable
public void pause operator operator iocontainer iocontainer int breakpoint type set process state process state paused fire breakpoint event operator iocontainer breakpoint type while get process state process process state paused synchronized breakpoint lock try breakpoint lock wait catch interrupted exception e
pauses the process at a breakpoint
public void resume set process state process state running synchronized breakpoint lock breakpoint lock notify all fire resume event
resumes the process after it has been paused
public void stop this set process state process state stopped synchronized breakpoint lock breakpoint lock notify all
stops the process as soon as possible
public double get fitness return 1 get average
returns the fitness
public void count example example example double plabel double label example get value label attribute if predicted attribute is nominal plabel example get value predicted attribute else string label s example get nominal value label attribute plabel example get confidence label s label 1 0d double weight 1 0d if weight attribute null weight example get value weight attribute double diff math abs label plabel deviation sum diff diff weight weight double rel diff math abs label true label sum example counter relative sum rel diff rel diff weight weight
calculates the error for the current example
public boolean should stop return get process state process state stopped
returns true iff the process should be stopped
public void add breakpoint listener breakpoint listener listener breakpoint listeners add listener
removes a breakpoint listener
public void remove breakpoint listener breakpoint listener listener breakpoint listeners remove listener
adds a breakpoint listener
public double get max fitness return 1 0d
returns the maximum fitness of 1
public void count example example example double label example get value label attribute double plabel example get value predicted label attribute if label attribute is nominal string pred label string predicted label attribute get mapping map index int plabel plabel label attribute get mapping get index pred label string double weight 1 0d if weight attribute null weight example get value weight attribute double prod label plabel weight if double is na n prod sum label predict prod sum label label sum label sqr label label sum predict plabel sum predict sqr plabel plabel example count weight
updates all sums needed to compute the correlation coefficient
public void fire resume event iterator i breakpoint listeners iterator while i has next breakpoint listener i next resume
fires the event that the process was resumed
private performance vector count kernel model model performance vector performance criteria throws operator exception if performance criteria null performance criteria new performance vector this last count 0 int sv number model get number of support vectors for int i 0 i sv number i support vector sv model get support vector i if math abs sv get alpha 0 0d this last count estimated performance sv criterion new estimated performance number of support vectors last count 1 get parameter as int parameter optimization direction mdlcriterion minimization performance criteria add criterion sv criterion return performance criteria
creates a new performance vector if the given one is null
public input description get input description class cls if model class is assignable from cls return new input description cls false true else return super get input description cls
shows a parameter keep example set with default value quot false quot
public void start counting example set set boolean use example weights throws operator exception
initializes the criterion
private performance vector count example set example set performance vector performance criteria throws operator exception if performance criteria null performance criteria new performance vector mdlcriterion mdl criterion new mdlcriterion get parameter as int parameter optimization direction mdl criterion start counting example set true this last count mdl criterion get average performance criteria add criterion mdl criterion return performance criteria
creates a new performance vector if the given one is null
public input description get input description class cls if example set class is assignable from cls return new input description cls false true else return super get input description cls
shows a parameter keep example set with default value quot false quot
private int check number of inner operators log service log checking process setup log service init int error count operator chain root operator check number of inner operators if error count 0 log service log inner operators are ok log service init else log service log process setup not ok log service error return error count
checks the nesting number of inner operators of the current process
private int check properties log service log checking properties log service init int error count root operator check properties if error count 0 log service log properties are ok log service init else log service log properties are not ok log service error return error count
checks the properties parameter values of the current process
public void test average performance10x08 build average performance20x04 assert equals wrong weighted average 10 0 8 20 0 4 10 20 performance10x08 get mikro average 0 0000001 assert equals wrong makro average 0 8 0 4 2 performance10x08 get makro average 0 0000001
tests micro and makro average
public void count example example example delegate count example example
counts a single example by invoking the delegates method
public string get description return delegate get description
returns a description of the performance criterion
protected void build single average averagable averagable rank correlation other rank correlation averagable this counter other counter this value other value
averaging across instances of rank correlation is unsupported
public void start counting example set e set boolean use example weights throws operator exception super start counting e set use example weights this counter e set size if type rho this value rank statistics rho e set e set get attributes get label e set get attributes get predicted label else this value rank statistics tau b e set e set get attributes get label e set get attributes get predicted label
computes whichever of rho and tau was requested
public double count example double label double predicted label double dif label predicted label return dif dif
calculates the error for the current example
private void tear down try if should stop root operator process finished catch operator exception e log service log problem during finishing the process e get message log service error clean up clear macros clear report streams clear storage clear unknown parameters result service close log service flush log service log service get global
this method is invoked after an process has finished
public boolean format percent return true
indicates whether or not percentage format should be used in the
public double get max fitness return double positive infinity
returns the maximum fitness
public int compare to performance criterion o if this get class equals o get class throw new runtime exception mismatched criterion class this get class o get class if o get name equals this get name throw new runtime exception mismatched criterion type this get name o get name return double compare this get fitness o get fitness
the semantics of this method follow the specification in the interface
public void count example example example double plabel double label example get value label attribute double weight 1 0d if weight attribute null weight example get value weight attribute if predicted attribute is nominal plabel example get value predicted attribute else string label s example get nominal value label attribute plabel example get confidence label s label 1 0d double deviation count example label plabel if double is na n deviation count example with weight deviation weight else log service get global log simple criterion na n was generated log service warning
invokes code count example double double code and counts the
protected double transform double value return value
simply returns the given value
public void start counting example set example set boolean use example weights throws operator exception super start counting example set use example weights compute margin iterator example reader example set iterator this margin 1 0d attribute label attr example set get attributes get label while reader has next example example reader next string true label example get nominal value label attr double confidence example get confidence true label this margin math min margin confidence
calculates the margin
public void save throws ioexception save process file
saves the process to the process file
public void save file file throws ioexception charset encoding root operator get encoding charset encoding charset for name utf 16 print writer writer null try writer new print writer new output stream writer new file output stream file encoding write encoding writer println xml version 1 0 encoding encoding write process writer println process version rapid miner get short version tools get line separator root operator write xml writer false writer println process catch ioexception e throw e finally if writer null writer close log service log finished writing of process definition file file log service status
saves the process to the given process file
public void set main criterion name string mc name if mc name equals main criterion first get averagable mc name null log service get global log main criterion not found mc name log service error this main criterion mc name
sets the name of the main average must be added by
public performance criterion get main criterion if main criterion null return performance criterion get averagable 0 else performance criterion pc performance criterion get averagable main criterion if pc null return performance criterion get averagable 0 return pc
returns the main
public int compare to object o double result comparator compare this performance vector o if result 0 0 return 1 else if result 0 0 return 1 else return 0
returns a negative value iff o is better than this performance vector
public void count example example example double plabel double label example get value label attribute if predicted attribute is nominal plabel example get value predicted attribute else string label s example get value as string label attribute plabel example get confidence label s label 1 0d double weight 1 0d if weight attribute null weight example get value weight attribute double diff weight math abs label plabel deviation sum diff double rel diff math abs weight label true label sum example counter relative sum rel diff
calculates the error for the current example
public void start counting example set example set boolean use example weights throws operator exception super start counting example set use example weights create roc data this roc data add roc data generator create rocdata example set use example weights this auc roc data generator calculate auc this roc data get last this positive class example set get attributes get predicted label get mapping get positive string
calculates the auc
protected void init example set test set this test set test set
uses this example set in order to create appropriate criteria
public component get visualization component iocontainer io container return new rocviewer to string this roc data generator this roc data
this implementation returns a confusion matrix viewer based on a jtable
public void init writing this current values new hash map string double for int i 0 i size i averagable averagable get averagable i this current values put averagable get name averagable get average
init the value map which ensures an easy human readable format
public void set process file file file this process file file
sets the process file
public double transform double value return math sqrt value
applies a square root to the given value
public file resolve file name string name file working dir new file system get property user dir return tools get file process file null process file get parent file working dir name
resolves the given filename against the directory containing the
protected void init example set example set
this method will be invoked before the actual calculation is started
protected boolean show skip na nlabels parameter return true
subclasses might override this method and return false
public double get fitness if type error return 1 0d get average else return get average
returns the accuracy or 1 error
protected boolean show comparator parameter return true
subclasses might override this method and return false
protected boolean show criteria parameter return true
subclasses might override this method and return false
public component get visualization component iocontainer io container viewer new confusion matrix viewer super to string class names counter return viewer
this implementation returns a confusion matrix viewer based on a jtable
private void add performance value final string name string description add value new value double name description public double get double value if current performance vector null return double na n performance criterion c current performance vector get criterion name if c null return c get average else return double na n
adds the performance criteria as plottable values e
public string register name string name operator operator if operator name map get name null string base name name int index base name index of if index 0 base name base name substring 0 index int i 2 while operator name map get base name i null i string new name base name i operator name map put new name operator return new name else operator name map put name operator return name
returns a quot name i quot if name is already in use
public void unregister name string name operator name map remove name
this method is used for unregistering a name from the operator name map
protected performance vector evaluate example set test set performance vector input performance throws operator exception list performance criterion given criteria new linked list performance criterion this current performance vector initialise performance vector test set input performance given criteria boolean skip undefined true if show comparator parameter skip undefined get parameter as boolean parameter skip undefined labels boolean use example weights get parameter as boolean parameter use example weights evaluate this test set current performance vector given criteria skip undefined use example weights return current performance vector
evaluates the given test set
public input description get input description class cls if cls equals example set class return new input description cls true true else return super get input description cls
this method enables the keeping of the example set