input
stringlengths
10
828
output
stringlengths
5
107
public class option get classifier return m classifier
returns the current moa classifier in use
public string classifier tip text return the moa classifier to use
returns the tooltip displayed in the gui
public instances define data format throws exception int num examples m actual generator instance stream moautils from option m generator abstract option handler m actual generator prepare for use m dataset format new instances m actual generator get header determine number of instances to generate num examples get num examples if m actual generator estimated remaining instances 1 if m actual generator estimated remaining instances num examples num examples int m actual generator estimated remaining instances set num examples act num examples return m dataset format
initializes the format for the dataset produced
public void set current object object obj if obj null this null string null this required type is instance obj obj instanceof string obj instanceof file obj instanceof task this required type is assignable from task obj get task result type this current value obj else throw new illegal argument exception object not of required type
sets current object
public capabilities get capabilities capabilities result new capabilities this attributes result enable capability nominal attributes result enable capability numeric attributes result enable capability missing values class result enable capability nominal class result enable capability missing class values result set minimum number instances 0 return result
returns the capabilities of this classifier
public instance generate example throws exception if m actual generator has more instances return m actual generator next instance else return null
generates one example of the dataset
public object get pre materialized object return this current value
returns the current object
public void build classifier instances data throws exception get capabilities test with fail data data new instances data data delete with missing class m actual classifier reset learning for int i 0 i data num instances i update classifier data instance i
generates a classifier
public instances generate examples throws exception instances result instance inst int i result new instances m dataset format 0 m random new random get seed for i 0 i get num examples act i inst generate example if inst null result add inst else break return result
generates all examples of the dataset
public void update classifier instance instance throws exception m actual classifier train on instance instance
updates a classifier using the given instance
public string get revision return revision utils extract revision 27
returns the revision string
public string to string string builder result result new string builder m actual classifier get description result 0 return result to string
returns a string representation of the model
public string get revision return revision utils extract revision 7
returns the revision string
protected object get prepared class option class option opt return this class option names to prepared objects get opt get name
gets a prepared option of this class
public boolean is empty return this n 0
check if this cluster is empty or not
public void add clus kernel other super add other this total n other total n
adds the given cluster to this cluster without making this cluster
protected void aggregate clus kernel other long time difference double neg lambda make older time difference neg lambda add other
make this cluster older bei weighting it and add to this cluster the
protected void make older long time difference double neg lambda if time difference 0 return double weight factor auxiliary functions weight neg lambda time difference this n weight factor for int i 0 i ls length i ls i weight factor ss i weight factor
make this cluster older
public double calc distance clus kernel other todo fernando felix adapt the distance function to the new algorithmn double n1 this get weight double n2 other get weight double this ls this ls double other ls other ls double res 0 0 for int i 0 i this ls length i double substracted this ls i n1 other ls i n2 res substracted substracted todo info added sqrt to the computation pk 10 09 10 return math sqrt res
calculate the distance to this other cluster
private double get total n return total n
returns the weighted number of points in the cluster
protected boolean is empty return this total n 0
check if this cluster is empty or not
protected boolean is leaf for int i 0 i entries length i entry entry entries i if entry get child null return false return true
checks if this node is a leaf
protected void clear this total n 0 this n 0 0 arrays fill this ls 0 0 arrays fill this ss 0 0
remove all points from this cluster
public entry nearest entry clus kernel buffer todo fernando adapt the nearest entry function to the new algorithmn entry res entries 0 double min res calc distance buffer for int i 1 i entries length i entry entry entries i if entry is empty break double distance entry calc distance buffer if distance min min distance res entry return res
returns the neareast code entry code to the given code cluster code
protected entry nearest entry entry new entry assert this entries 0 is empty entry res entries 0 double min res calc distance new entry for int i 1 i entries length i if this entries i is empty break entry entry entries i double distance entry calc distance new entry if distance min min distance res entry return res
return the nearest entry to the given one
protected int num free entries int res 0 for int i 0 i entries length i entry entry entries i if entry is empty res assert number entries entries length return res
return the number of free code entry code s in this node
public void add entry entry new entry long current time new entry set node this int free position get next empty position entries free position initialize entry new entry current time
add a new code entry code to this node
private int get next empty position int counter for counter 0 counter entries length counter entry e entries counter if e is empty break if counter entries length throw new runtime exception entry added to a node which is already full return counter
returns the position of the next free entry
protected entry get irrelevant entry double threshold for int i 0 i this entries length i entry entry this entries i if entry is irrelevant threshold return entry return null
if there exists an entry whose relevance is under the threshold given
protected int get raw level return level
return the level number in the node
protected void clear this data clear this buffer clear this child null this timestamp entry default timestamp
clear the entry
protected int get level clus tree tree int num root splits tree get num root splits return num root splits this get raw level
returns the level at which this node is in the tree
protected void shallow clear this buffer clear this data clear
clear the code data code and the code buffer custer code in this
protected void merge entries int pos1 int pos2 assert this num free entries 0 assert pos1 pos2 this entries pos1 merge with this entries pos2 for int i pos2 i entries length 1 i entries i entries i 1 entries entries length 1 clear
merge the two entries at the given position
protected double calc distance clus kernel cluster return data calc distance cluster
calculates the distance to the data in this entry
protected void initialize entry entry other long current time assert this is empty assert other get buffer is empty this data add other data this timestamp current time this child other child if child null for entry e child get entries e set parent entry this
when this entry is empty give it its first values
protected void merge with entry other we should only merge entries in leafs and leafes should have empty buffers assert this child null assert other child null assert other buffer is empty this data add other data if this timestamp other timestamp this timestamp other timestamp
merge this entry witht the given code entry code
protected void notify change listeners change event e new change event this for change listener l change listeners l state changed e
notifies all registered change listeners that the options have changed
protected clus kernel get buffer return buffer
getter for the buffer
public node get child return child
return the reference to the child of this code entry code to navigate
protected clus kernel get data return data
getter for the data
public void set child node child this child child
setter for the child in this entry
protected clus kernel empty buffer long current time double neg lambda this buffer make older current time this timestamp neg lambda clus kernel buffer copy new clus kernel this buffer this buffer clear return buffer copy
clear the buffer in this entry and return a copy
protected boolean is empty assert that if the data cluster is empty the buffer cluster is empty too assert this data is empty this buffer is empty this data is empty return this data is empty
check if this code entry code is empty or not
protected void overwrite old entry entry new entry assert this get buffer is empty assert new entry get buffer is empty this data overwrite old cluster new entry data new entry set parent entry this parent entry if new entry get child null for entry e new entry get child get entries e set parent entry this this set parent entry new entry get parent entry this child new entry child
overwrites the ls ss and weighted n in the data cluster of this
protected void recalculate data node current child this get child if current child null clus kernel current data this get data current data clear entry entries current child get entries for int i 0 i entries length i current data add entries i get data else this clear
this functions reads every entry in the child node and calculates the
public int get num root splits return num root splits
return the number of time the tree has grown in size
protected boolean is irrelevant double threshold return this get data get weight threshold
returns true if this entry is irrelevant with respecto the given
protected void make older long current time double neg lambda assert current time this timestamp current time current time this timestamp this timestamp long diff current time this timestamp this buffer make older diff neg lambda this data make older diff neg lambda this timestamp current time
ages this entries data and buffer according to the given
public int get height assert height max height return height
return the current height of the tree
public void check in double p if p null l add p else system out println miniball check in warning skipping null point
adds a point to the list
public void build b reset support end 0 pivot mb points end
recalculate miniball parameter center and radius
public void add cluster cluster clusters add cluster
add a cluster to the clustering
public void remove int index if index clusters size clusters remove index
remove a cluster from the clustering
public double squared radius return b squared radius
return the sqaured radius of the miniball
public cluster get int index if index clusters size return clusters get index return null
remove a cluster from the clustering
public double radius return 1 0 00001 math sqrt b squared radius
return the radius of the miniball
public int nr points return l size
return the actual number of points in the list
public int nr support points return b support size
return the number of support points used to calculate the miniball
private int discrete random index double p double r m meta random next double if utils sum p r double is na n utils sum p return 1 m meta random next int p length int i 0 double sum 0 0 while r sum won t be selecting anything if i p length return 1 sum p i system out println i i return i 1
discrete random index
public string get task name return this get class get simple name
gets the name of this task
public boolean result known for instance instance inst return branch for instance inst 0
gets whether the number of the branch for an instance is known
public void set loss function int function m loss function
set the loss function to use
public int get loss function return m loss
get the current loss function
public void reset m t 2 m weights null
reset the classifier
public string get class name string return instances header get class name string this model context
gets the name of the attribute of the class from the header
public string get class label string int class label index return instances header get class label string this model context class label index
gets the name of a label of the class from the header
public string get attribute name string int att index return instances header get attribute name string this model context att index
gets the name of an attribute from the header
public string get nominal value string int att index int val index return instances header get nominal value string this model context att index val index
gets the name of a value of an attribute from the header
synchronized public void remove cluster change listener cluster event listener l if listeners null listeners new vector listeners remove element l
remove a listener
protected void fire cluster change long timestamp string type string message if we have no listeners do nothing if listeners null listeners is empty create the event object to send cluster event event new cluster event this timestamp type message make a copy of the listener list in case anyone adds removes listeners vector targets synchronized this targets vector listeners clone walk through the listener list and call the sun moved method in each enumeration e targets elements while e has more elements cluster event listener l cluster event listener e next element l change cluster event
fire a cluster change event to all registered listeners
public void register service service holder holder throws exception service cache put holder get descriptor get uid holder if holder get descriptor get scope is higher service scope plugin application service registry get parent register service holder
register a service
public void unregister service service holder holder throws exception if holder get descriptor get scope is higher service scope plugin application service registry get parent unregister service holder service cache remove holder get descriptor get uid
unregister a service
public template get template string name locale locale string encoding throws ioexception return get template name locale encoding true
equivalent to tt get template name locale encoding true tt
public void debug object message if debug enabled system out println message to string
logs a debug message
public void stop list tms synchronized this stop true tms list task managers clone for int i 0 i tms size i task manager tm task manager tms get i tm terminate synchronized tm tm notify try tm join catch interrupted exception ex ignore
stops all threads in this thread pool gracefully
public string to string string pattern long hseconds seconds minutes hours days long tt get value days tt 8640000 tt 8640000 hours tt 360000 tt 360000 minutes tt 6000 tt 6000 seconds tt 100 tt 100 hseconds tt long values new long 5 values 0 new long days values 1 new long hours values 2 new long minutes values 3 new long seconds values 4 new long hseconds return message format format pattern values
formats the content of this code time ticks code object according to
public void close throws ioexception for iterator it message dispatcher get transport mappings iterator it has next transport mapping it next close timer cancel for iterator it pending requests values iterator it has next pending request pending pending request it next response event e new response event this null pending pdu null pending user object new interrupted exception snmp session has been closed pending listener on response e close all notification listeners if notification dispatcher null notification dispatcher close all
closes the session and frees any allocated resources i
public void set oid oid oid if oid null throw new illegal argument exception oid of a variable binding must not be null this oid oid
sets the object instance identifier for the variable binding
public void set variable variable variable if variable null throw new illegal argument exception variable of a variable binding must not be null this variable variable
sets the value of the variable binding
public octet string substring int begin index int end index if begin index 0 end index length todo implement better exception message new index out of bounds exception byte substring new byte end index begin index system arraycopy value begin index substring 0 substring length return new octet string substring
returns a new string that is a substring of this string
public void add transport mapping transport mapping transport if transport mappings get transport get supported address class null transport mappings put transport get supported address class transport
adds a transport mapping
public void add all variable binding vbs variable bindings ensure capacity variable bindings size vbs length for int i 0 i vbs length i variable bindings add vbs i
adds an array of variable bindings to this pdu
public transport mapping remove transport mapping transport mapping transport return transport mapping transport mappings remove transport get supported address class
removes a transport mapping
public collection get transport mappings return transport mappings values
gets a collection of all registered transport mappings
public transport mapping get transport address dest address class address class dest address get class transport mapping transport transport mapping transport mappings get address class return transport
returns a transport mapping that can handle the supplied address
public void trim if variable bindings size 0 variable bindings remove element at variable bindings size 1
remove the last variable binding from the pdu if such an element exists
public message processing model get message processing model int message processing model return message processing model mpm get message processing model
gets the code message processing model code for the supplied message
public void clear variable bindings clear set request id new integer32 0
removes all variable bindings from the pdu
public transport mapping create transport mapping address transport address if transport mappings null register transport mappings class c class transport mappings get transport address get class get name if c null return null class params new class 1 params 0 transport address get class constructor constructor null try constructor c get constructor params return transport mapping constructor new instance new object transport address catch exception ex if logger is debug enabled ex print stack trace logger error ex return null
returns a code transport mapping code instance that is initialized with
public void set priority int new priority server thread st server if st null st set priority new priority
changes the priority of the server thread for this tcp transport mapping
public int get priority server thread st server if st null return st get priority else return thread norm priority
returns the priority of the internal listen thread
public void add engine id address address octet string engine id engine ids put address engine id if snmp engine listeners null fire engine changed new snmp engine event this snmp engine event added engine id engine id address
adds an engine id to the internal storage
public void set thread name string name server thread st server if st null st set name name
sets the name of the listen thread for this udp transport mapping
public void close throws ioexception listen thread l listener if l null l close l interrupt if socket timeout 0 try l join catch interrupted exception ex logger warn ex listener null if socket is closed socket disconnect socket close
closes the socket and stops the listener thread
public void set priority int new priority listen thread lt listener if lt null lt set priority new priority
changes the priority of the listen thread for this udp transport mapping
public int get priority listen thread lt listener if lt null return lt get priority else return thread norm priority
returns the priority of the internal listen thread
public string get thread name server thread st server if st null return st get name else return null
returns the name of the listen thread
public void set thread name string name listen thread lt listener if lt null lt set name name
sets the name of the listen thread for this udp transport mapping
public string get thread name listen thread lt listener if lt null return lt get name else return null
returns the name of the listen thread