input
stringlengths
10
828
output
stringlengths
5
107
public double get ratio example set example set throws operator exception switch get parameter as int parameter sample case sample absolute double target size get parameter as int parameter sample size if target size example set size return 1d else return target size example set size case sample relative return get parameter as double parameter sample ratio default return 1
this method should return the ratio used for stratified sampling
protected void apply on data example set example set attribute old attributes attribute new attributes copying data for example example example set for int i 0 i old attributes length i if old attributes i is numerical example set value new attributes i compute value old attributes i example get value old attributes i
this method must be implemented by the subclasses
public boolean is supporting attribute roles return false
subclasses which need to have the attribute roles must return true
public void process starts throws operator exception apply count set 0 apply count at last execution 0
called when the process starts
private void check for compatibility list example set all example sets throws operator exception example set first all example sets get 0 iterator example set i all example sets iterator while i has next check for compatibility first i next
checks whether all attributes in set 1 occur in the others as well
protected string get new generic column name int column hash set string used names new hash set string for attribute column col get all attribute columns used names add col get name while used names contains attribute column column return attribute column
returns a new column name for new column to build
public void set breakpoint int position boolean on break point position on fire update this
sets or clears a breakpoint at the given position
public example set do work example set example set throws operator exception example set working set is supporting attribute roles get selected attributes example set new non special attributes example set get selected attributes example set model model create preprocessing model working set model set parameter parameter create view get parameter as boolean parameter create view return model apply example set
helper wrapper for
public boolean is supporting view return true
subclasses might overwrite this in order to hide the create view parameter
public attribute get source attribute return source attribute
this returns the attribute this aggregation function will derive the data from
public boolean is counting only distinct return is counting only distinct
this determines if values are counted only once if occurring more than once
public void set default attribute attribute double array data row row row set attribute double na n
this method will fill in the default value of this aggregation function
public boolean has breakpoint return has breakpoint breakpoint listener breakpoint before has breakpoint breakpoint listener breakpoint after
returns true iff this operator has a breakpoint at any possible position
public void count example example for aggregator aggregator aggregators aggregator count example
this will count the given examples for all registered
public void count example example double weight for aggregator aggregator aggregators aggregator count example weight
this will count the given examples for all registered
public void set error tolerant boolean flag is error tollerant cache flag set parameter parameter error tolerant boolean to string flag
use this method to set the parameter
public int get row return row number
returns the row where the error occurred
public int get row lenght return row lenght
returns the length of the the row
override public example set apply example set e set throws operator exception log e set get attributes size features before filtering iterator attribute role i e set get attributes all attribute roles boolean filter special get parameter as boolean parameter filter special features while i has next attribute role role i next if role is special filter special continue if switch off feature role i remove check for stop log e set get attributes size features left after filtering return e set
applies filtering of features by looping through all features and
override public void update model example set update example set throws operator exception iterator model i models iterator while i has next i next update model update example set
updates the model if the classifier is updatable
public output stream open selected file throws operator exception if file output port is connected try return new file output stream operator get parameter as file file parameter name catch file not found exception e throw new user error operator 301 operator get parameter as file file parameter name else return new byte array output stream override public void close throws ioexception super close file output port deliver new buffered file object this to byte array
returns an output stream depending on whether the
public output stream open selected file boolean append throws operator exception if file output port is connected try return new file output stream operator get parameter as file file parameter name append catch file not found exception e throw new user error operator 301 operator get parameter as file file parameter name else return new byte array output stream override public void close throws ioexception super close file output port deliver new buffered file object this to byte array
returns an output stream depending on whether the
public int get row offset return row offset
returns the row offset
public int get column offset return column offset
returns the column offset
public boolean has workbook return workbook jxl null workbook poi null
returns if there is an active workbook
public abstract table model create excel table model int sheet index throws biff exception ioexception invalid format exception if get file get absolute path ends with xlsx excel 2007 file if workbook poi null create workbook poi excel2007 sheet table model excel sheet table model new excel2007 sheet table model workbook poi get sheet at sheet index return excel sheet table model else excel pre 2007 file if workbook jxl null create workbook jxl excel sheet table model excel sheet table model new excel sheet table model workbook jxl get sheet sheet index return excel sheet table model
creates an excel table model either
public int get number of sheets throws biff exception ioexception invalid format exception if get file get absolute path ends with xlsx excel 2007 file if workbook poi null create workbook poi return workbook poi get number of sheets else excel pre 2007 file if workbook jxl null create workbook jxl return workbook jxl get number of sheets
returns the number of sheets in the excel file
public charset get encoding return this encoding
returns the encoding for this configuration
public file get file return workbook file
this returns the file of the referenced excel file
public int inc nummer of missing return number of missings
increase the number of read missing value by one
public void set workbook file file selected file if selected file equals this workbook file return if workbook jxl null workbook jxl close workbook jxl null workbook file selected file workbook poi null row offset 0 column offset 0 row last integer max value column last integer max value sheet 0
this will set the workbook file
private void create workbook jxl throws biff exception ioexception file file get file workbook settings workbook settings new workbook settings if encoding null workbook settings set encoding encoding name workbook jxl workbook get workbook file workbook settings
creates the jxl workbook
private void create workbook poi throws invalid format exception ioexception workbook poi workbook factory create get file
creates the poi workbook
public string get annotation int line return annotations map get line
this returns the annotation of a line or null if no present
public boolean is activated return is activated
indicated whether this column is actual read imported or if it is ignored
protected boolean is supporting first row as names return true
this method might be overwritten by subclasses to avoid that the first row
protected parameter type make file parameter type return file input port handler make file parameter type this get file parameter name name of the file to read the data from new port provider override public port get port return file input port get file extensions
creates but does not add the file parameter named by
public void activate column boolean flag is activated flag
activates or deactivates this column
public boolean is complete return column meta data null column meta data length 0
returns true if meta data is manually set
private cell get current cell int index return current row cells index column offset return current row cells index
gets the cell with the given index in the current row
public number get number int column index throws parse exception throw new parse exception new parsing error current example index column index parsing error error code unparseable real
this method is not supported by the xml result set
public date get date int column index throws parse exception throw new parse exception new parsing error current example index column index parsing error error code unparseable date
this method is not supported by the xml result set
public string get resource identifier return file name
this returns the full resource identifier
private string get xpath from element list list pair string string element names string builder sb new string builder if element names is empty sb append for pair string string element element names sb append if element get first null sb append configuration get namespace id element get first sb append sb append element get second return sb to string
creates an xpath expression from the given element names
public boolean is namespace aware return is namespace aware
this method defines whether the xml should be parsed namespace aware or not
public void set resource identifier string resource identifier this file name resource identifier this prefetched document null reseting cached dom
this sets the used resource identifier
public xpath matches list model document document map string string namespace map string default namespace uri int max elements this document document this xpath xpath factory new instance new xpath this max elements max elements xpath set namespace context new map based namespace context namespace map default namespace uri
creates a new xpath matches list model
public void set namespaces map map string string namespaces map since in this class we need uri id instead of id uri invert the map this namespace uri to id map new hash map string string for map entry string string entry namespaces map entry set namespace uri to id map put entry get value entry get key
sets the namespaces map
public void set highlighted object node boolean highlighted if highlighted highlighted nodes add node else highlighted nodes remove node
marks a tree element as highlighted
private void add row string id string namespace vector string row vector new vector string 2 row vector add id row vector add namespace table data add row vector fire table rows inserted get row count 1 get row count 1
appends a row to the table
private void fire state change string message boolean error for xpath matches result listener listener listeners listener inform state change message error
informs all xpath matches result listener of this model about a state change
public parameter type get parameter type string name iterator parameter type i get parameters get parameter types iterator while i has next parameter type current i next if current get key equals name return current return null
returns the parameter type with the given name
public void add xpath string x path if contains xpath x path vector string new row new vector string column count new row add xpath column x path list string value list get data for xpath x path string value null if value list size 0 value value list get 0 new row add value column value x paths add new row fire table rows inserted x paths size 1 x paths size 1 attribute table model update
adds an xpath to the model
public boolean has errors for int i 0 i get row count i if has error i xpath column return true return false
returns true if at least one xpath in the model in invalid
public void remove rows int selected rows arrays sort selected rows for int i selected rows length 1 i 0 i int row selected rows i x paths remove row fire table rows deleted row row
removes the rows with the given indices from the model
public document get domrepresentation throws ioexception return new xmlexporter export process this false
this returns this operator with all its parameter settings as a
public string get xml boolean hide default boolean only core elements try return xmltools to string new xmlexporter only core elements export process this hide default xmlimporter process file charset catch exception e log service get root log level warning cannot generate process xml e e log service get root log level warning i18 n get message log service get root get resource bundle com rapidminer operator operator generating xml process error e e return e to string
returns the xml representation of this operator
public void clear error list clear port clear meta data errors
clears the list of errors
public boolean supports capability operator capability lc if lc operator capability numerical attributes return true if lc operator capability binominal label return true if lc operator capability numerical label return true if lc operator capability weighted examples return true if lc operator capability formula provider return true return false
returns true for numerical attributes binominal classes and numerical
public boolean supports capability operator capability lc if lc operator capability numerical attributes return true if lc operator capability binominal label return true if lc operator capability formula provider return true return false
returns true for numerical attributes binominal classes and numerical
public void reset clear port clear all check operator transform meta data
clears all errors meta data etc
protected void logln int level string message level mapped level wrapper logging handler levels rapid miner verbosity level 1 if param operator null param operator get logger log mapped level message else log service get root log mapped level message
log the output plus newline
public void check all excluding meta data get root clear port clear metadata port clear simple errors if is enabled check operator propagate dirtyness update execution order
as check all but does not check the meta data for performance reasons
public boolean is valid xpath string x path string if x path string null return true xpath x path xpath factory new instance new xpath try xpath expression expression x path compile x path string catch xpath expression exception e return false return true
return true iff x path string is a valid xpath i
public boolean supports capability operator capability lc switch lc case numerical attributes case polynominal label case binominal label case numerical label case weighted examples return true default return false
returns true for all types of attributes and numerical and binominal labels
public boolean supports capability operator capability lc if lc operator capability polynominal attributes return true if lc operator capability binominal attributes return true if lc operator capability numerical attributes return true if lc operator capability binominal label return true if lc operator capability numerical label return true return false
returns true for all types of attributes and numerical and binominal labels
public example set perform prediction example set example set attribute predicted label throws operator exception return null
this method isnt called at all since we have overridden the calling method
protected meta data modify generated model meta data prediction model meta data unmodified meta data return unmodified meta data
modifies the meta data of the generated model
override public boolean supports capability operator capability capability switch capability case numerical label case no label case updatable case formula provider return false default return true
support polynominal labels
protected model apply inner learner example set example set throws operator exception inner example source deliver example set execute inner learner return model inner model sink get data model class
this is a convenience method to apply the inner operators and return the
override public example set perform prediction example set original example set attribute predicted label throws operator exception switch classification type case one against all start non ecocprocess original example set one against all break case one against one start non ecocprocess original example set one against one break case exhaustive code start ecocprocess original example set code matrix break case random code start ecocprocess original example set code matrix break default throw new operator exception unknown classification strategy selected return original example set
chooses the right evaluation procedure depending on classification type
private model train model example set example set throws operator exception training inner source deliver example set get subprocess 0 execute return model inner sink get data model class
runs the quot embedded quot learner on the example set and retuns a
protected meta data modify example set meta data example set meta data unmodified meta data attribute meta data weight attribute new attribute meta data weight ontology real attributes weight name unmodified meta data add attribute weight attribute return super modify example set meta data unmodified meta data
adding weight attributes
protected model train base model example set example set throws operator exception model model apply inner learner example set return model
runs the quot embedded quot learner on the example set and returns a
private void read optional parameters throws user error this start model model input get data or null model class if this start model null log get name no model found in input
helper method reading a start model from the input if present
public model get model int index return this model info get index get first
getter method for embedded models
protected benefit calculate benefit example set training set attribute attribute throws operator exception chi squared weighting weight op null try weight op operator service create operator chi squared weighting class catch operator creation exception e get logger warning cannot create chi squared calculation operator return null double weight double na n if weight op null attribute weights weights weight op do work training set weight weights get weight attribute get name if double is na n weight return new benefit weight attribute else return null
this method calculates the benefit of the given attribute
public data table create pairwise data table return new data table pairwise matrix extraction adapter this this row names this column names new string first attribute name second attribute name name
this creates a pairwise data table where each combination is only included once
public data table create pairwise data table boolean show symetrical return new data table pairwise matrix extraction adapter this this row names this column names new string first attribute name second attribute name name show symetrical
this creates a pairwise data table
public void serialize output stream out object object throws ioexception serialization type type if object instanceof example set type serialization type streamed example set dense current version else type serialization type java binary serialize out object type
serializes the object with a default type appropriate for the given object
public void serialize output stream out object object serialization type serialization type throws ioexception write header out serialization type serialization type get body serializer serialize object out out flush
serializes the object to the stream using the given serialization type
public object deserialize input stream in throws ioexception serialization type type deserialize header in return type get body serializer deserialize in
deserializes an object serialized by
public object deserialize from buffer byte buffer throws ioexception class not found exception byte array input stream buf in new byte array input stream buffer try return deserialize buf in finally buf in close
deserializes the object from a byte buffer created by
public void write example set example set output stream output stream throws ioexception data output stream out new data output stream output stream list attribute role all roles new linked list attribute role iterator attribute role i example set get attributes all attribute roles while i has next all roles add i next boolean sparse false todo remove ugly instanceof check if example set size 0 example set get example 0 get data row instanceof sparse data row sparse true write header example set get annotations all roles out sparse write data example set out all roles sparse out flush
writes header and data of the example set to the stream
private void write data example set example set data output stream out list attribute role all roles boolean sparse throws ioexception out write int example set size column type column types convert to column types all roles for example example example set int attribute index 0 for attribute role role all roles attribute attribute role get attribute double value example get value attribute write datum value attribute index attribute column types attribute index out sparse attribute index if sparse indicates linebreaks out write int 1
writes nominals and integers as integer all others as double
public string get name return this get class get simple name
the default implementation returns the classname without package
public icon get result icon return renderer service get icon this get class
returns the icon registered for this class on the
protected string create process tree int indent string self prefix string child prefix operator mark operator string mark if mark operator null get name equals mark operator get name return tools indent indent mark length mark self prefix get name apply count get operator class name else return tools indent indent self prefix get name apply count get operator class name
returns this operators name and class
public void write annotations data output out annotations annotations throws ioexception if version version 3 log service get root warning ignoring annotations in example set stream version version log service get root log level warning com rapidminer operator tools example set to stream ignoring annotations version else if annotations null out write int 0 else out write int annotations size for string key annotations get keys write string out key write string out annotations get annotation key
one integer for size
public plotter configuration model get plotter settings return settings
this method returns the plotter settings controlling which plotter is
protected static class ellipsoid point style implements point style override public shape create shape double x double y return new ellipse2 d double x pointsize 2 0d y pointsize 2 0d pointsize pointsize
the point style that should be used for plotting points
public void set parameter value string key string value parameter settings put key value
this method sets a parameter specified by the key to the
public string get parameter value string generalized key return parameter settings get generalized key
this method will return the parameter value of the given generalized key
public boolean is parameter set string generalized key name return parameter settings contains key generalized key name
this method checks whether the parameter with this generalized key is stored
public void set range int dimension range range set range data table get column name dimension range
this is a convenience method for setting the correct range parameter
public void clear int clear flags if clear flags port clear simple errors 0 error list clear get input ports clear clear flags get output ports clear clear flags
clears output and input ports
public void assume preconditions satisfied for input port input port get input ports get all ports for precondition precondition input port get all preconditions precondition assume satisfied
assumes that all preconditions are satisfied
public void disconnect ports for output port port get output ports get all ports if port is connected port disconnect for input port port get input ports get all ports if port is connected port get source disconnect
this method will disconnect all ports from as well the input ports as
override public boolean is supporting log scale int axis if axis x axis axis y axis return true else return super is supporting log scale axis
returns true if a log scale for this column is supported
public void register settings listener plotter settings changed listener listener settings listeners add listener inform settings listener listener
this listener will be registered and immediately informed over all settings