repository_name
stringlengths
5
67
func_path_in_repository
stringlengths
4
234
func_name
stringlengths
0
314
whole_func_string
stringlengths
52
3.87M
language
stringclasses
6 values
func_code_string
stringlengths
52
3.87M
func_code_tokens
listlengths
15
672k
func_documentation_string
stringlengths
1
47.2k
func_documentation_tokens
listlengths
1
3.92k
split_name
stringclasses
1 value
func_code_url
stringlengths
85
339
fracpete/python-weka-wrapper3
python/weka/flow/base.py
Actor.execute
def execute(self): """ Executes the actor. :return: None if successful, otherwise error message :rtype: str """ if self.skip: return None result = self.pre_execute() if result is None: try: result = self.do_execute...
python
def execute(self): """ Executes the actor. :return: None if successful, otherwise error message :rtype: str """ if self.skip: return None result = self.pre_execute() if result is None: try: result = self.do_execute...
[ "def", "execute", "(", "self", ")", ":", "if", "self", ".", "skip", ":", "return", "None", "result", "=", "self", ".", "pre_execute", "(", ")", "if", "result", "is", "None", ":", "try", ":", "result", "=", "self", ".", "do_execute", "(", ")", "exce...
Executes the actor. :return: None if successful, otherwise error message :rtype: str
[ "Executes", "the", "actor", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/flow/base.py#L384-L403
fracpete/python-weka-wrapper3
python/weka/flow/base.py
OutputProducer.output
def output(self): """ Returns the next available output token. :return: the next token, None if none available :rtype: Token """ if (self._output is None) or (len(self._output) == 0): result = None else: result = self._output.pop(0) ...
python
def output(self): """ Returns the next available output token. :return: the next token, None if none available :rtype: Token """ if (self._output is None) or (len(self._output) == 0): result = None else: result = self._output.pop(0) ...
[ "def", "output", "(", "self", ")", ":", "if", "(", "self", ".", "_output", "is", "None", ")", "or", "(", "len", "(", "self", ".", "_output", ")", "==", "0", ")", ":", "result", "=", "None", "else", ":", "result", "=", "self", ".", "_output", "....
Returns the next available output token. :return: the next token, None if none available :rtype: Token
[ "Returns", "the", "next", "available", "output", "token", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/flow/base.py#L544-L555
fracpete/python-weka-wrapper3
python/weka/flow/base.py
StorageHandler.expand
def expand(self, s): """ Expands all occurrences of "@{...}" within the string with the actual values currently stored in internal storage. :param s: the string to expand :type s: str :return: the expanded string :rtype: str """ result = s ...
python
def expand(self, s): """ Expands all occurrences of "@{...}" within the string with the actual values currently stored in internal storage. :param s: the string to expand :type s: str :return: the expanded string :rtype: str """ result = s ...
[ "def", "expand", "(", "self", ",", "s", ")", ":", "result", "=", "s", "while", "result", ".", "find", "(", "\"@{\"", ")", ">", "-", "1", ":", "start", "=", "result", ".", "index", "(", "\"@{\"", ")", "end", "=", "result", ".", "index", "(", "\"...
Expands all occurrences of "@{...}" within the string with the actual values currently stored in internal storage. :param s: the string to expand :type s: str :return: the expanded string :rtype: str
[ "Expands", "all", "occurrences", "of", "@", "{", "...", "}", "within", "the", "string", "with", "the", "actual", "values", "currently", "stored", "in", "internal", "storage", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/flow/base.py#L573-L593
fracpete/python-weka-wrapper3
python/weka/flow/base.py
StorageHandler.extract
def extract(cls, padded): """ Removes the surrounding "@{...}" from the name. :param padded: the padded string :type padded: str :return: the extracted name :rtype: str """ if padded.startswith("@{") and padded.endswith("}"): return padded[2:l...
python
def extract(cls, padded): """ Removes the surrounding "@{...}" from the name. :param padded: the padded string :type padded: str :return: the extracted name :rtype: str """ if padded.startswith("@{") and padded.endswith("}"): return padded[2:l...
[ "def", "extract", "(", "cls", ",", "padded", ")", ":", "if", "padded", ".", "startswith", "(", "\"@{\"", ")", "and", "padded", ".", "endswith", "(", "\"}\"", ")", ":", "return", "padded", "[", "2", ":", "len", "(", "padded", ")", "-", "1", "]", "...
Removes the surrounding "@{...}" from the name. :param padded: the padded string :type padded: str :return: the extracted name :rtype: str
[ "Removes", "the", "surrounding", "@", "{", "...", "}", "from", "the", "name", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/flow/base.py#L611-L623
fracpete/python-weka-wrapper3
python/weka/flow/control.py
ActorHandler.fix_config
def fix_config(self, options): """ Fixes the options, if necessary. I.e., it adds all required elements to the dictionary. :param options: the options to fix :type options: dict :return: the (potentially) fixed options :rtype: dict """ options = super(Act...
python
def fix_config(self, options): """ Fixes the options, if necessary. I.e., it adds all required elements to the dictionary. :param options: the options to fix :type options: dict :return: the (potentially) fixed options :rtype: dict """ options = super(Act...
[ "def", "fix_config", "(", "self", ",", "options", ")", ":", "options", "=", "super", "(", "ActorHandler", ",", "self", ")", ".", "fix_config", "(", "options", ")", "opt", "=", "\"actors\"", "if", "opt", "not", "in", "options", ":", "options", "[", "opt...
Fixes the options, if necessary. I.e., it adds all required elements to the dictionary. :param options: the options to fix :type options: dict :return: the (potentially) fixed options :rtype: dict
[ "Fixes", "the", "options", "if", "necessary", ".", "I", ".", "e", ".", "it", "adds", "all", "required", "elements", "to", "the", "dictionary", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/flow/control.py#L70-L87
fracpete/python-weka-wrapper3
python/weka/flow/control.py
ActorHandler.to_dict
def to_dict(self): """ Returns a dictionary that represents this object, to be used for JSONification. :return: the object dictionary :rtype: dict """ result = super(ActorHandler, self).to_dict() result["type"] = "ActorHandler" del result["config"]["actor...
python
def to_dict(self): """ Returns a dictionary that represents this object, to be used for JSONification. :return: the object dictionary :rtype: dict """ result = super(ActorHandler, self).to_dict() result["type"] = "ActorHandler" del result["config"]["actor...
[ "def", "to_dict", "(", "self", ")", ":", "result", "=", "super", "(", "ActorHandler", ",", "self", ")", ".", "to_dict", "(", ")", "result", "[", "\"type\"", "]", "=", "\"ActorHandler\"", "del", "result", "[", "\"config\"", "]", "[", "\"actors\"", "]", ...
Returns a dictionary that represents this object, to be used for JSONification. :return: the object dictionary :rtype: dict
[ "Returns", "a", "dictionary", "that", "represents", "this", "object", "to", "be", "used", "for", "JSONification", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/flow/control.py#L89-L102
fracpete/python-weka-wrapper3
python/weka/flow/control.py
ActorHandler.from_dict
def from_dict(cls, d): """ Restores an object state from a dictionary, used in de-JSONification. :param d: the object dictionary :type d: dict :return: the object :rtype: object """ result = super(ActorHandler, cls).from_dict(d) if "actors" in d: ...
python
def from_dict(cls, d): """ Restores an object state from a dictionary, used in de-JSONification. :param d: the object dictionary :type d: dict :return: the object :rtype: object """ result = super(ActorHandler, cls).from_dict(d) if "actors" in d: ...
[ "def", "from_dict", "(", "cls", ",", "d", ")", ":", "result", "=", "super", "(", "ActorHandler", ",", "cls", ")", ".", "from_dict", "(", "d", ")", "if", "\"actors\"", "in", "d", ":", "l", "=", "d", "[", "\"actors\"", "]", "for", "e", "in", "l", ...
Restores an object state from a dictionary, used in de-JSONification. :param d: the object dictionary :type d: dict :return: the object :rtype: object
[ "Restores", "an", "object", "state", "from", "a", "dictionary", "used", "in", "de", "-", "JSONification", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/flow/control.py#L105-L123
fracpete/python-weka-wrapper3
python/weka/flow/control.py
ActorHandler.actors
def actors(self, actors): """ Sets the sub-actors of the actor. :param actors: the sub-actors :type actors: list """ if actors is None: actors = self.default_actors() self.check_actors(actors) self.config["actors"] = actors
python
def actors(self, actors): """ Sets the sub-actors of the actor. :param actors: the sub-actors :type actors: list """ if actors is None: actors = self.default_actors() self.check_actors(actors) self.config["actors"] = actors
[ "def", "actors", "(", "self", ",", "actors", ")", ":", "if", "actors", "is", "None", ":", "actors", "=", "self", ".", "default_actors", "(", ")", "self", ".", "check_actors", "(", "actors", ")", "self", ".", "config", "[", "\"actors\"", "]", "=", "ac...
Sets the sub-actors of the actor. :param actors: the sub-actors :type actors: list
[ "Sets", "the", "sub", "-", "actors", "of", "the", "actor", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/flow/control.py#L139-L149
fracpete/python-weka-wrapper3
python/weka/flow/control.py
ActorHandler.active
def active(self): """ Returns the count of non-skipped actors. :return: the count :rtype: int """ result = 0 for actor in self.actors: if not actor.skip: result += 1 return result
python
def active(self): """ Returns the count of non-skipped actors. :return: the count :rtype: int """ result = 0 for actor in self.actors: if not actor.skip: result += 1 return result
[ "def", "active", "(", "self", ")", ":", "result", "=", "0", "for", "actor", "in", "self", ".", "actors", ":", "if", "not", "actor", ".", "skip", ":", "result", "+=", "1", "return", "result" ]
Returns the count of non-skipped actors. :return: the count :rtype: int
[ "Returns", "the", "count", "of", "non", "-", "skipped", "actors", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/flow/control.py#L152-L163
fracpete/python-weka-wrapper3
python/weka/flow/control.py
ActorHandler.first_active
def first_active(self): """ Returns the first non-skipped actor. :return: the first active actor, None if not available :rtype: Actor """ result = None for actor in self.actors: if not actor.skip: result = actor break ...
python
def first_active(self): """ Returns the first non-skipped actor. :return: the first active actor, None if not available :rtype: Actor """ result = None for actor in self.actors: if not actor.skip: result = actor break ...
[ "def", "first_active", "(", "self", ")", ":", "result", "=", "None", "for", "actor", "in", "self", ".", "actors", ":", "if", "not", "actor", ".", "skip", ":", "result", "=", "actor", "break", "return", "result" ]
Returns the first non-skipped actor. :return: the first active actor, None if not available :rtype: Actor
[ "Returns", "the", "first", "non", "-", "skipped", "actor", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/flow/control.py#L166-L178
fracpete/python-weka-wrapper3
python/weka/flow/control.py
ActorHandler.last_active
def last_active(self): """ Returns the last non-skipped actor. :return: the last active actor, None if not available :rtype: Actor """ result = None for actor in reversed(self.actors): if not actor.skip: result = actor ...
python
def last_active(self): """ Returns the last non-skipped actor. :return: the last active actor, None if not available :rtype: Actor """ result = None for actor in reversed(self.actors): if not actor.skip: result = actor ...
[ "def", "last_active", "(", "self", ")", ":", "result", "=", "None", "for", "actor", "in", "reversed", "(", "self", ".", "actors", ")", ":", "if", "not", "actor", ".", "skip", ":", "result", "=", "actor", "break", "return", "result" ]
Returns the last non-skipped actor. :return: the last active actor, None if not available :rtype: Actor
[ "Returns", "the", "last", "non", "-", "skipped", "actor", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/flow/control.py#L181-L193
fracpete/python-weka-wrapper3
python/weka/flow/control.py
ActorHandler.index_of
def index_of(self, name): """ Returns the index of the actor with the given name. :param name: the name of the Actor to find :type name: str :return: the index, -1 if not found :rtype: int """ result = -1 for index, actor in enumerate(self.actors)...
python
def index_of(self, name): """ Returns the index of the actor with the given name. :param name: the name of the Actor to find :type name: str :return: the index, -1 if not found :rtype: int """ result = -1 for index, actor in enumerate(self.actors)...
[ "def", "index_of", "(", "self", ",", "name", ")", ":", "result", "=", "-", "1", "for", "index", ",", "actor", "in", "enumerate", "(", "self", ".", "actors", ")", ":", "if", "actor", ".", "name", "==", "name", ":", "result", "=", "index", "break", ...
Returns the index of the actor with the given name. :param name: the name of the Actor to find :type name: str :return: the index, -1 if not found :rtype: int
[ "Returns", "the", "index", "of", "the", "actor", "with", "the", "given", "name", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/flow/control.py#L195-L209
fracpete/python-weka-wrapper3
python/weka/flow/control.py
ActorHandler.setup
def setup(self): """ Configures the actor before execution. :return: None if successful, otherwise error message :rtype: str """ result = super(ActorHandler, self).setup() if result is None: self.update_parent() try: self.c...
python
def setup(self): """ Configures the actor before execution. :return: None if successful, otherwise error message :rtype: str """ result = super(ActorHandler, self).setup() if result is None: self.update_parent() try: self.c...
[ "def", "setup", "(", "self", ")", ":", "result", "=", "super", "(", "ActorHandler", ",", "self", ")", ".", "setup", "(", ")", "if", "result", "is", "None", ":", "self", ".", "update_parent", "(", ")", "try", ":", "self", ".", "check_actors", "(", "...
Configures the actor before execution. :return: None if successful, otherwise error message :rtype: str
[ "Configures", "the", "actor", "before", "execution", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/flow/control.py#L218-L247
fracpete/python-weka-wrapper3
python/weka/flow/control.py
ActorHandler.wrapup
def wrapup(self): """ Finishes up after execution finishes, does not remove any graphical output. """ for actor in self.actors: if actor.skip: continue actor.wrapup() super(ActorHandler, self).wrapup()
python
def wrapup(self): """ Finishes up after execution finishes, does not remove any graphical output. """ for actor in self.actors: if actor.skip: continue actor.wrapup() super(ActorHandler, self).wrapup()
[ "def", "wrapup", "(", "self", ")", ":", "for", "actor", "in", "self", ".", "actors", ":", "if", "actor", ".", "skip", ":", "continue", "actor", ".", "wrapup", "(", ")", "super", "(", "ActorHandler", ",", "self", ")", ".", "wrapup", "(", ")" ]
Finishes up after execution finishes, does not remove any graphical output.
[ "Finishes", "up", "after", "execution", "finishes", "does", "not", "remove", "any", "graphical", "output", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/flow/control.py#L264-L272
fracpete/python-weka-wrapper3
python/weka/flow/control.py
ActorHandler.cleanup
def cleanup(self): """ Destructive finishing up after execution stopped. """ for actor in self.actors: if actor.skip: continue actor.cleanup() super(ActorHandler, self).cleanup()
python
def cleanup(self): """ Destructive finishing up after execution stopped. """ for actor in self.actors: if actor.skip: continue actor.cleanup() super(ActorHandler, self).cleanup()
[ "def", "cleanup", "(", "self", ")", ":", "for", "actor", "in", "self", ".", "actors", ":", "if", "actor", ".", "skip", ":", "continue", "actor", ".", "cleanup", "(", ")", "super", "(", "ActorHandler", ",", "self", ")", ".", "cleanup", "(", ")" ]
Destructive finishing up after execution stopped.
[ "Destructive", "finishing", "up", "after", "execution", "stopped", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/flow/control.py#L274-L282
fracpete/python-weka-wrapper3
python/weka/flow/control.py
SequentialDirector.stop_execution
def stop_execution(self): """ Triggers the stopping of the object. """ if not (self._stopping or self._stopped): for actor in self.owner.actors: actor.stop_execution() self._stopping = True
python
def stop_execution(self): """ Triggers the stopping of the object. """ if not (self._stopping or self._stopped): for actor in self.owner.actors: actor.stop_execution() self._stopping = True
[ "def", "stop_execution", "(", "self", ")", ":", "if", "not", "(", "self", ".", "_stopping", "or", "self", ".", "_stopped", ")", ":", "for", "actor", "in", "self", ".", "owner", ".", "actors", ":", "actor", ".", "stop_execution", "(", ")", "self", "."...
Triggers the stopping of the object.
[ "Triggers", "the", "stopping", "of", "the", "object", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/flow/control.py#L472-L479
fracpete/python-weka-wrapper3
python/weka/flow/control.py
SequentialDirector.do_execute
def do_execute(self): """ Actual execution of the director. :return: None if successful, otherwise error message :rtype: str """ self._stopped = False self._stopping = False not_finished_actor = self.owner.first_active pending_actors = [] ...
python
def do_execute(self): """ Actual execution of the director. :return: None if successful, otherwise error message :rtype: str """ self._stopped = False self._stopping = False not_finished_actor = self.owner.first_active pending_actors = [] ...
[ "def", "do_execute", "(", "self", ")", ":", "self", ".", "_stopped", "=", "False", "self", ".", "_stopping", "=", "False", "not_finished_actor", "=", "self", ".", "owner", ".", "first_active", "pending_actors", "=", "[", "]", "finished", "=", "False", "act...
Actual execution of the director. :return: None if successful, otherwise error message :rtype: str
[ "Actual", "execution", "of", "the", "director", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/flow/control.py#L540-L631
fracpete/python-weka-wrapper3
python/weka/flow/control.py
Flow.check_actors
def check_actors(self, actors): """ Performs checks on the actors that are to be used. Raises an exception if invalid setup. :param actors: the actors to check :type actors: list """ super(Flow, self).check_actors(actors) actor = self.first_active if (act...
python
def check_actors(self, actors): """ Performs checks on the actors that are to be used. Raises an exception if invalid setup. :param actors: the actors to check :type actors: list """ super(Flow, self).check_actors(actors) actor = self.first_active if (act...
[ "def", "check_actors", "(", "self", ",", "actors", ")", ":", "super", "(", "Flow", ",", "self", ")", ".", "check_actors", "(", "actors", ")", "actor", "=", "self", ".", "first_active", "if", "(", "actor", "is", "not", "None", ")", "and", "not", "base...
Performs checks on the actors that are to be used. Raises an exception if invalid setup. :param actors: the actors to check :type actors: list
[ "Performs", "checks", "on", "the", "actors", "that", "are", "to", "be", "used", ".", "Raises", "an", "exception", "if", "invalid", "setup", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/flow/control.py#L672-L682
fracpete/python-weka-wrapper3
python/weka/flow/control.py
Flow.load
def load(cls, fname): """ Loads the flow from a JSON file. :param fname: the file to load :type fname: str :return: the flow :rtype: Flow """ with open(fname) as f: content = f.readlines() return Flow.from_json(''.join(content))
python
def load(cls, fname): """ Loads the flow from a JSON file. :param fname: the file to load :type fname: str :return: the flow :rtype: Flow """ with open(fname) as f: content = f.readlines() return Flow.from_json(''.join(content))
[ "def", "load", "(", "cls", ",", "fname", ")", ":", "with", "open", "(", "fname", ")", "as", "f", ":", "content", "=", "f", ".", "readlines", "(", ")", "return", "Flow", ".", "from_json", "(", "''", ".", "join", "(", "content", ")", ")" ]
Loads the flow from a JSON file. :param fname: the file to load :type fname: str :return: the flow :rtype: Flow
[ "Loads", "the", "flow", "from", "a", "JSON", "file", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/flow/control.py#L695-L706
fracpete/python-weka-wrapper3
python/weka/flow/control.py
Sequence.new_director
def new_director(self): """ Creates the director to use for handling the sub-actors. :return: the director instance :rtype: Director """ result = SequentialDirector(self) result.record_output = False result.allow_source = False return result
python
def new_director(self): """ Creates the director to use for handling the sub-actors. :return: the director instance :rtype: Director """ result = SequentialDirector(self) result.record_output = False result.allow_source = False return result
[ "def", "new_director", "(", "self", ")", ":", "result", "=", "SequentialDirector", "(", "self", ")", "result", ".", "record_output", "=", "False", "result", ".", "allow_source", "=", "False", "return", "result" ]
Creates the director to use for handling the sub-actors. :return: the director instance :rtype: Director
[ "Creates", "the", "director", "to", "use", "for", "handling", "the", "sub", "-", "actors", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/flow/control.py#L756-L766
fracpete/python-weka-wrapper3
python/weka/flow/control.py
Sequence.check_actors
def check_actors(self, actors): """ Performs checks on the actors that are to be used. Raises an exception if invalid setup. :param actors: the actors to check :type actors: list """ super(Sequence, self).check_actors(actors) actor = self.first_active if ...
python
def check_actors(self, actors): """ Performs checks on the actors that are to be used. Raises an exception if invalid setup. :param actors: the actors to check :type actors: list """ super(Sequence, self).check_actors(actors) actor = self.first_active if ...
[ "def", "check_actors", "(", "self", ",", "actors", ")", ":", "super", "(", "Sequence", ",", "self", ")", ".", "check_actors", "(", "actors", ")", "actor", "=", "self", ".", "first_active", "if", "(", "actor", "is", "not", "None", ")", "and", "not", "...
Performs checks on the actors that are to be used. Raises an exception if invalid setup. :param actors: the actors to check :type actors: list
[ "Performs", "checks", "on", "the", "actors", "that", "are", "to", "be", "used", ".", "Raises", "an", "exception", "if", "invalid", "setup", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/flow/control.py#L768-L778
fracpete/python-weka-wrapper3
python/weka/flow/control.py
Sequence.do_execute
def do_execute(self): """ The actual execution of the actor. :return: None if successful, otherwise error message :rtype: str """ self.first_active.input = self.input result = self._director.execute() if result is None: self._output.append(sel...
python
def do_execute(self): """ The actual execution of the actor. :return: None if successful, otherwise error message :rtype: str """ self.first_active.input = self.input result = self._director.execute() if result is None: self._output.append(sel...
[ "def", "do_execute", "(", "self", ")", ":", "self", ".", "first_active", ".", "input", "=", "self", ".", "input", "result", "=", "self", ".", "_director", ".", "execute", "(", ")", "if", "result", "is", "None", ":", "self", ".", "_output", ".", "appe...
The actual execution of the actor. :return: None if successful, otherwise error message :rtype: str
[ "The", "actual", "execution", "of", "the", "actor", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/flow/control.py#L780-L791
fracpete/python-weka-wrapper3
python/weka/flow/control.py
Tee.fix_config
def fix_config(self, options): """ Fixes the options, if necessary. I.e., it adds all required elements to the dictionary. :param options: the options to fix :type options: dict :return: the (potentially) fixed options :rtype: dict """ options = super(Tee...
python
def fix_config(self, options): """ Fixes the options, if necessary. I.e., it adds all required elements to the dictionary. :param options: the options to fix :type options: dict :return: the (potentially) fixed options :rtype: dict """ options = super(Tee...
[ "def", "fix_config", "(", "self", ",", "options", ")", ":", "options", "=", "super", "(", "Tee", ",", "self", ")", ".", "fix_config", "(", "options", ")", "opt", "=", "\"condition\"", "if", "opt", "not", "in", "options", ":", "options", "[", "opt", "...
Fixes the options, if necessary. I.e., it adds all required elements to the dictionary. :param options: the options to fix :type options: dict :return: the (potentially) fixed options :rtype: dict
[ "Fixes", "the", "options", "if", "necessary", ".", "I", ".", "e", ".", "it", "adds", "all", "required", "elements", "to", "the", "dictionary", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/flow/control.py#L834-L854
fracpete/python-weka-wrapper3
python/weka/flow/control.py
Tee.check_actors
def check_actors(self, actors): """ Performs checks on the actors that are to be used. Raises an exception if invalid setup. :param actors: the actors to check :type actors: list """ super(Tee, self).check_actors(actors) actor = self.first_active if actor...
python
def check_actors(self, actors): """ Performs checks on the actors that are to be used. Raises an exception if invalid setup. :param actors: the actors to check :type actors: list """ super(Tee, self).check_actors(actors) actor = self.first_active if actor...
[ "def", "check_actors", "(", "self", ",", "actors", ")", ":", "super", "(", "Tee", ",", "self", ")", ".", "check_actors", "(", "actors", ")", "actor", "=", "self", ".", "first_active", "if", "actor", "is", "None", ":", "if", "self", ".", "_requires_acti...
Performs checks on the actors that are to be used. Raises an exception if invalid setup. :param actors: the actors to check :type actors: list
[ "Performs", "checks", "on", "the", "actors", "that", "are", "to", "be", "used", ".", "Raises", "an", "exception", "if", "invalid", "setup", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/flow/control.py#L868-L881
fracpete/python-weka-wrapper3
python/weka/flow/control.py
Tee.do_execute
def do_execute(self): """ The actual execution of the actor. :return: None if successful, otherwise error message :rtype: str """ result = None teeoff = True cond = self.storagehandler.expand(str(self.resolve_option("condition"))) if len(cond) > 0...
python
def do_execute(self): """ The actual execution of the actor. :return: None if successful, otherwise error message :rtype: str """ result = None teeoff = True cond = self.storagehandler.expand(str(self.resolve_option("condition"))) if len(cond) > 0...
[ "def", "do_execute", "(", "self", ")", ":", "result", "=", "None", "teeoff", "=", "True", "cond", "=", "self", ".", "storagehandler", ".", "expand", "(", "str", "(", "self", ".", "resolve_option", "(", "\"condition\"", ")", ")", ")", "if", "len", "(", ...
The actual execution of the actor. :return: None if successful, otherwise error message :rtype: str
[ "The", "actual", "execution", "of", "the", "actor", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/flow/control.py#L883-L900
fracpete/python-weka-wrapper3
python/weka/flow/control.py
Trigger.fix_config
def fix_config(self, options): """ Fixes the options, if necessary. I.e., it adds all required elements to the dictionary. :param options: the options to fix :type options: dict :return: the (potentially) fixed options :rtype: dict """ options = super(Tri...
python
def fix_config(self, options): """ Fixes the options, if necessary. I.e., it adds all required elements to the dictionary. :param options: the options to fix :type options: dict :return: the (potentially) fixed options :rtype: dict """ options = super(Tri...
[ "def", "fix_config", "(", "self", ",", "options", ")", ":", "options", "=", "super", "(", "Trigger", ",", "self", ")", ".", "fix_config", "(", "options", ")", "opt", "=", "\"condition\"", "if", "opt", "not", "in", "options", ":", "options", "[", "opt",...
Fixes the options, if necessary. I.e., it adds all required elements to the dictionary. :param options: the options to fix :type options: dict :return: the (potentially) fixed options :rtype: dict
[ "Fixes", "the", "options", "if", "necessary", ".", "I", ".", "e", ".", "it", "adds", "all", "required", "elements", "to", "the", "dictionary", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/flow/control.py#L942-L962
fracpete/python-weka-wrapper3
python/weka/flow/control.py
BranchDirector.check_actors
def check_actors(self): """ Checks the actors of the owner. Raises an exception if invalid. """ actors = [] for actor in self.owner.actors: if actor.skip: continue actors.append(actor) if len(actors) == 0: return ...
python
def check_actors(self): """ Checks the actors of the owner. Raises an exception if invalid. """ actors = [] for actor in self.owner.actors: if actor.skip: continue actors.append(actor) if len(actors) == 0: return ...
[ "def", "check_actors", "(", "self", ")", ":", "actors", "=", "[", "]", "for", "actor", "in", "self", ".", "owner", ".", "actors", ":", "if", "actor", ".", "skip", ":", "continue", "actors", ".", "append", "(", "actor", ")", "if", "len", "(", "actor...
Checks the actors of the owner. Raises an exception if invalid.
[ "Checks", "the", "actors", "of", "the", "owner", ".", "Raises", "an", "exception", "if", "invalid", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/flow/control.py#L1061-L1074
fracpete/python-weka-wrapper3
python/weka/flow/control.py
BranchDirector.do_execute
def do_execute(self): """ Actual execution of the director. :return: None if successful, otherwise error message :rtype: str """ result = None self._stopped = False self._stopping = False for actor in self.owner.actors: if self.is_st...
python
def do_execute(self): """ Actual execution of the director. :return: None if successful, otherwise error message :rtype: str """ result = None self._stopped = False self._stopping = False for actor in self.owner.actors: if self.is_st...
[ "def", "do_execute", "(", "self", ")", ":", "result", "=", "None", "self", ".", "_stopped", "=", "False", "self", ".", "_stopping", "=", "False", "for", "actor", "in", "self", ".", "owner", ".", "actors", ":", "if", "self", ".", "is_stopping", "(", "...
Actual execution of the director. :return: None if successful, otherwise error message :rtype: str
[ "Actual", "execution", "of", "the", "director", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/flow/control.py#L1091-L1111
fracpete/python-weka-wrapper3
python/weka/flow/control.py
ContainerValuePicker.fix_config
def fix_config(self, options): """ Fixes the options, if necessary. I.e., it adds all required elements to the dictionary. :param options: the options to fix :type options: dict :return: the (potentially) fixed options :rtype: dict """ options = super(Con...
python
def fix_config(self, options): """ Fixes the options, if necessary. I.e., it adds all required elements to the dictionary. :param options: the options to fix :type options: dict :return: the (potentially) fixed options :rtype: dict """ options = super(Con...
[ "def", "fix_config", "(", "self", ",", "options", ")", ":", "options", "=", "super", "(", "ContainerValuePicker", ",", "self", ")", ".", "fix_config", "(", "options", ")", "opt", "=", "\"value\"", "if", "opt", "not", "in", "options", ":", "options", "[",...
Fixes the options, if necessary. I.e., it adds all required elements to the dictionary. :param options: the options to fix :type options: dict :return: the (potentially) fixed options :rtype: dict
[ "Fixes", "the", "options", "if", "necessary", ".", "I", ".", "e", ".", "it", "adds", "all", "required", "elements", "to", "the", "dictionary", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/flow/control.py#L1186-L1210
fracpete/python-weka-wrapper3
python/weka/flow/control.py
ContainerValuePicker.do_execute
def do_execute(self): """ The actual execution of the actor. :return: None if successful, otherwise error message :rtype: str """ result = None cont = self.input.payload name = str(self.resolve_option("value")) value = cont.get(name) switc...
python
def do_execute(self): """ The actual execution of the actor. :return: None if successful, otherwise error message :rtype: str """ result = None cont = self.input.payload name = str(self.resolve_option("value")) value = cont.get(name) switc...
[ "def", "do_execute", "(", "self", ")", ":", "result", "=", "None", "cont", "=", "self", ".", "input", ".", "payload", "name", "=", "str", "(", "self", ".", "resolve_option", "(", "\"value\"", ")", ")", "value", "=", "cont", ".", "get", "(", "name", ...
The actual execution of the actor. :return: None if successful, otherwise error message :rtype: str
[ "The", "actual", "execution", "of", "the", "actor", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/flow/control.py#L1212-L1236
fracpete/python-weka-wrapper3
python/weka/flow/conversion.py
CommandlineToAny.fix_config
def fix_config(self, options): """ Fixes the options, if necessary. I.e., it adds all required elements to the dictionary. :param options: the options to fix :type options: dict :return: the (potentially) fixed options :rtype: dict """ options = super(Com...
python
def fix_config(self, options): """ Fixes the options, if necessary. I.e., it adds all required elements to the dictionary. :param options: the options to fix :type options: dict :return: the (potentially) fixed options :rtype: dict """ options = super(Com...
[ "def", "fix_config", "(", "self", ",", "options", ")", ":", "options", "=", "super", "(", "CommandlineToAny", ",", "self", ")", ".", "fix_config", "(", "options", ")", "opt", "=", "\"wrapper\"", "if", "opt", "not", "in", "options", ":", "options", "[", ...
Fixes the options, if necessary. I.e., it adds all required elements to the dictionary. :param options: the options to fix :type options: dict :return: the (potentially) fixed options :rtype: dict
[ "Fixes", "the", "options", "if", "necessary", ".", "I", ".", "e", ".", "it", "adds", "all", "required", "elements", "to", "the", "dictionary", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/flow/conversion.py#L188-L205
fracpete/python-weka-wrapper3
python/weka/flow/conversion.py
CommandlineToAny.check_input
def check_input(self, obj): """ Performs checks on the input object. Raises an exception if unsupported. :param obj: the object to check :type obj: object """ if isinstance(obj, str): return if isinstance(obj, unicode): return rais...
python
def check_input(self, obj): """ Performs checks on the input object. Raises an exception if unsupported. :param obj: the object to check :type obj: object """ if isinstance(obj, str): return if isinstance(obj, unicode): return rais...
[ "def", "check_input", "(", "self", ",", "obj", ")", ":", "if", "isinstance", "(", "obj", ",", "str", ")", ":", "return", "if", "isinstance", "(", "obj", ",", "unicode", ")", ":", "return", "raise", "Exception", "(", "\"Unsupported class: \"", "+", "self"...
Performs checks on the input object. Raises an exception if unsupported. :param obj: the object to check :type obj: object
[ "Performs", "checks", "on", "the", "input", "object", ".", "Raises", "an", "exception", "if", "unsupported", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/flow/conversion.py#L207-L218
fracpete/python-weka-wrapper3
python/weka/flow/conversion.py
CommandlineToAny.convert
def convert(self): """ Performs the actual conversion. :return: None if successful, otherwise errors message :rtype: str """ cname = str(self.config["wrapper"]) self._output = classes.from_commandline(self._input, classname=cname) return None
python
def convert(self): """ Performs the actual conversion. :return: None if successful, otherwise errors message :rtype: str """ cname = str(self.config["wrapper"]) self._output = classes.from_commandline(self._input, classname=cname) return None
[ "def", "convert", "(", "self", ")", ":", "cname", "=", "str", "(", "self", ".", "config", "[", "\"wrapper\"", "]", ")", "self", ".", "_output", "=", "classes", ".", "from_commandline", "(", "self", ".", "_input", ",", "classname", "=", "cname", ")", ...
Performs the actual conversion. :return: None if successful, otherwise errors message :rtype: str
[ "Performs", "the", "actual", "conversion", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/flow/conversion.py#L220-L229
fracpete/python-weka-wrapper3
python/weka/plot/experiments.py
plot_experiment
def plot_experiment(mat, title="Experiment", axes_swapped=False, measure="Statistic", show_stdev=False, key_loc="lower right", outfile=None, wait=True): """ Plots the results from an experiment. :param mat: the result matrix to plot :type mat: ResultMatrix :param title: the titl...
python
def plot_experiment(mat, title="Experiment", axes_swapped=False, measure="Statistic", show_stdev=False, key_loc="lower right", outfile=None, wait=True): """ Plots the results from an experiment. :param mat: the result matrix to plot :type mat: ResultMatrix :param title: the titl...
[ "def", "plot_experiment", "(", "mat", ",", "title", "=", "\"Experiment\"", ",", "axes_swapped", "=", "False", ",", "measure", "=", "\"Statistic\"", ",", "show_stdev", "=", "False", ",", "key_loc", "=", "\"lower right\"", ",", "outfile", "=", "None", ",", "wa...
Plots the results from an experiment. :param mat: the result matrix to plot :type mat: ResultMatrix :param title: the title for the experiment :type title: str :param axes_swapped: whether the axes whether swapped ("sets x cls" or "cls x sets") :type axes_swapped: bool :param measure: the m...
[ "Plots", "the", "results", "from", "an", "experiment", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/plot/experiments.py#L28-L99
fracpete/python-weka-wrapper3
python/weka/plot/__init__.py
create_subsample
def create_subsample(data, percent, seed=1): """ Generates a subsample of the dataset. :param data: the data to create the subsample from :type data: Instances :param percent: the percentage (0-100) :type percent: float :param seed: the seed value to use :type seed: int """ if pe...
python
def create_subsample(data, percent, seed=1): """ Generates a subsample of the dataset. :param data: the data to create the subsample from :type data: Instances :param percent: the percentage (0-100) :type percent: float :param seed: the seed value to use :type seed: int """ if pe...
[ "def", "create_subsample", "(", "data", ",", "percent", ",", "seed", "=", "1", ")", ":", "if", "percent", "<=", "0", "or", "percent", ">=", "100", ":", "return", "data", "data", "=", "Instances", ".", "copy_instances", "(", "data", ")", "data", ".", ...
Generates a subsample of the dataset. :param data: the data to create the subsample from :type data: Instances :param percent: the percentage (0-100) :type percent: float :param seed: the seed value to use :type seed: int
[ "Generates", "a", "subsample", "of", "the", "dataset", ".", ":", "param", "data", ":", "the", "data", "to", "create", "the", "subsample", "from", ":", "type", "data", ":", "Instances", ":", "param", "percent", ":", "the", "percentage", "(", "0", "-", "...
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/plot/__init__.py#L45-L60
fracpete/python-weka-wrapper3
python/weka/classifiers.py
predictions_to_instances
def predictions_to_instances(data, preds): """ Turns the predictions turned into an Instances object. :param data: the original dataset format :type data: Instances :param preds: the predictions to convert :type preds: list :return: the predictions, None if no predictions present :rtype...
python
def predictions_to_instances(data, preds): """ Turns the predictions turned into an Instances object. :param data: the original dataset format :type data: Instances :param preds: the predictions to convert :type preds: list :return: the predictions, None if no predictions present :rtype...
[ "def", "predictions_to_instances", "(", "data", ",", "preds", ")", ":", "if", "len", "(", "preds", ")", "==", "0", ":", "return", "None", "is_numeric", "=", "isinstance", "(", "preds", "[", "0", "]", ",", "NumericPrediction", ")", "# create header", "atts"...
Turns the predictions turned into an Instances object. :param data: the original dataset format :type data: Instances :param preds: the predictions to convert :type preds: list :return: the predictions, None if no predictions present :rtype: Instances
[ "Turns", "the", "predictions", "turned", "into", "an", "Instances", "object", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/classifiers.py#L2061-L2114
fracpete/python-weka-wrapper3
python/weka/classifiers.py
Classifier.distributions_for_instances
def distributions_for_instances(self, data): """ Peforms predictions, returning the class distributions. :param data: the Instances to get the class distributions for :type data: Instances :return: the class distribution matrix, None if not a batch predictor :rtype: ndar...
python
def distributions_for_instances(self, data): """ Peforms predictions, returning the class distributions. :param data: the Instances to get the class distributions for :type data: Instances :return: the class distribution matrix, None if not a batch predictor :rtype: ndar...
[ "def", "distributions_for_instances", "(", "self", ",", "data", ")", ":", "if", "self", ".", "is_batchpredictor", ":", "return", "typeconv", ".", "double_matrix_to_ndarray", "(", "self", ".", "__distributions", "(", "data", ".", "jobject", ")", ")", "else", ":...
Peforms predictions, returning the class distributions. :param data: the Instances to get the class distributions for :type data: Instances :return: the class distribution matrix, None if not a batch predictor :rtype: ndarray
[ "Peforms", "predictions", "returning", "the", "class", "distributions", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/classifiers.py#L120-L132
fracpete/python-weka-wrapper3
python/weka/classifiers.py
Classifier.batch_size
def batch_size(self, size): """ Sets the batch size, in case this classifier is a batch predictor. :param size: the size of the batch :type size: str """ if self.is_batchpredictor: javabridge.call(self.jobject, "setBatchSize", "(Ljava/lang/String;)V", size)
python
def batch_size(self, size): """ Sets the batch size, in case this classifier is a batch predictor. :param size: the size of the batch :type size: str """ if self.is_batchpredictor: javabridge.call(self.jobject, "setBatchSize", "(Ljava/lang/String;)V", size)
[ "def", "batch_size", "(", "self", ",", "size", ")", ":", "if", "self", ".", "is_batchpredictor", ":", "javabridge", ".", "call", "(", "self", ".", "jobject", ",", "\"setBatchSize\"", ",", "\"(Ljava/lang/String;)V\"", ",", "size", ")" ]
Sets the batch size, in case this classifier is a batch predictor. :param size: the size of the batch :type size: str
[ "Sets", "the", "batch", "size", "in", "case", "this", "classifier", "is", "a", "batch", "predictor", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/classifiers.py#L148-L156
fracpete/python-weka-wrapper3
python/weka/classifiers.py
Classifier.to_source
def to_source(self, classname): """ Returns the model as Java source code if the classifier implements weka.classifiers.Sourcable. :param classname: the classname for the generated Java code :type classname: str :return: the model as source code string :rtype: str ...
python
def to_source(self, classname): """ Returns the model as Java source code if the classifier implements weka.classifiers.Sourcable. :param classname: the classname for the generated Java code :type classname: str :return: the model as source code string :rtype: str ...
[ "def", "to_source", "(", "self", ",", "classname", ")", ":", "if", "not", "self", ".", "check_type", "(", "self", ".", "jobject", ",", "\"weka.classifiers.Sourcable\"", ")", ":", "return", "None", "return", "javabridge", ".", "call", "(", "self", ".", "job...
Returns the model as Java source code if the classifier implements weka.classifiers.Sourcable. :param classname: the classname for the generated Java code :type classname: str :return: the model as source code string :rtype: str
[ "Returns", "the", "model", "as", "Java", "source", "code", "if", "the", "classifier", "implements", "weka", ".", "classifiers", ".", "Sourcable", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/classifiers.py#L196-L207
fracpete/python-weka-wrapper3
python/weka/classifiers.py
GridSearch.evaluation
def evaluation(self, evl): """ Sets the statistic to use for evaluation. :param evl: the statistic :type evl: SelectedTag, Tag or str """ if isinstance(evl, str): evl = self.tags_evaluation.find(evl) if isinstance(evl, Tag): evl = Selected...
python
def evaluation(self, evl): """ Sets the statistic to use for evaluation. :param evl: the statistic :type evl: SelectedTag, Tag or str """ if isinstance(evl, str): evl = self.tags_evaluation.find(evl) if isinstance(evl, Tag): evl = Selected...
[ "def", "evaluation", "(", "self", ",", "evl", ")", ":", "if", "isinstance", "(", "evl", ",", "str", ")", ":", "evl", "=", "self", ".", "tags_evaluation", ".", "find", "(", "evl", ")", "if", "isinstance", "(", "evl", ",", "Tag", ")", ":", "evl", "...
Sets the statistic to use for evaluation. :param evl: the statistic :type evl: SelectedTag, Tag or str
[ "Sets", "the", "statistic", "to", "use", "for", "evaluation", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/classifiers.py#L355-L366
fracpete/python-weka-wrapper3
python/weka/classifiers.py
GridSearch.x
def x(self): """ Returns a dictionary with all the current values for the X of the grid. Keys for the dictionary: property, min, max, step, base, expression Types: property=str, min=float, max=float, step=float, base=float, expression=str :return: the dictionary with the paramet...
python
def x(self): """ Returns a dictionary with all the current values for the X of the grid. Keys for the dictionary: property, min, max, step, base, expression Types: property=str, min=float, max=float, step=float, base=float, expression=str :return: the dictionary with the paramet...
[ "def", "x", "(", "self", ")", ":", "result", "=", "{", "}", "result", "[", "\"property\"", "]", "=", "javabridge", ".", "call", "(", "self", ".", "jobject", ",", "\"getXProperty\"", ",", "\"()Ljava/lang/String;\"", ")", "result", "[", "\"min\"", "]", "="...
Returns a dictionary with all the current values for the X of the grid. Keys for the dictionary: property, min, max, step, base, expression Types: property=str, min=float, max=float, step=float, base=float, expression=str :return: the dictionary with the parameters :rtype: dict
[ "Returns", "a", "dictionary", "with", "all", "the", "current", "values", "for", "the", "X", "of", "the", "grid", ".", "Keys", "for", "the", "dictionary", ":", "property", "min", "max", "step", "base", "expression", "Types", ":", "property", "=", "str", "...
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/classifiers.py#L369-L385
fracpete/python-weka-wrapper3
python/weka/classifiers.py
GridSearch.x
def x(self, d): """ Allows to configure the X of the grid with one method call. Keys for the dictionary: property, min, max, step, base, expression Types: property=str, min=float, max=float, step=float, base=float, expression=str :param d: the dictionary with the parameters ...
python
def x(self, d): """ Allows to configure the X of the grid with one method call. Keys for the dictionary: property, min, max, step, base, expression Types: property=str, min=float, max=float, step=float, base=float, expression=str :param d: the dictionary with the parameters ...
[ "def", "x", "(", "self", ",", "d", ")", ":", "if", "\"property\"", "in", "d", ":", "javabridge", ".", "call", "(", "self", ".", "jobject", ",", "\"setXProperty\"", ",", "\"(Ljava/lang/String;)V\"", ",", "d", "[", "\"property\"", "]", ")", "if", "\"min\""...
Allows to configure the X of the grid with one method call. Keys for the dictionary: property, min, max, step, base, expression Types: property=str, min=float, max=float, step=float, base=float, expression=str :param d: the dictionary with the parameters :type d: dict
[ "Allows", "to", "configure", "the", "X", "of", "the", "grid", "with", "one", "method", "call", ".", "Keys", "for", "the", "dictionary", ":", "property", "min", "max", "step", "base", "expression", "Types", ":", "property", "=", "str", "min", "=", "float"...
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/classifiers.py#L388-L408
fracpete/python-weka-wrapper3
python/weka/classifiers.py
GridSearch.y
def y(self): """ Returns a dictionary with all the current values for the Y of the grid. Keys for the dictionary: property, min, max, step, base, expression Types: property=str, min=float, max=float, step=float, base=float, expression=str :return: the dictionary with the paramet...
python
def y(self): """ Returns a dictionary with all the current values for the Y of the grid. Keys for the dictionary: property, min, max, step, base, expression Types: property=str, min=float, max=float, step=float, base=float, expression=str :return: the dictionary with the paramet...
[ "def", "y", "(", "self", ")", ":", "result", "=", "{", "}", "result", "[", "\"property\"", "]", "=", "javabridge", ".", "call", "(", "self", ".", "jobject", ",", "\"getYProperty\"", ",", "\"()Ljava/lang/String;\"", ")", "result", "[", "\"min\"", "]", "="...
Returns a dictionary with all the current values for the Y of the grid. Keys for the dictionary: property, min, max, step, base, expression Types: property=str, min=float, max=float, step=float, base=float, expression=str :return: the dictionary with the parameters :rtype: dict
[ "Returns", "a", "dictionary", "with", "all", "the", "current", "values", "for", "the", "Y", "of", "the", "grid", ".", "Keys", "for", "the", "dictionary", ":", "property", "min", "max", "step", "base", "expression", "Types", ":", "property", "=", "str", "...
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/classifiers.py#L411-L427
fracpete/python-weka-wrapper3
python/weka/classifiers.py
GridSearch.y
def y(self, d): """ Allows to configure the Y of the grid with one method call. Keys for the dictionary: property, min, max, step, base, expression Types: property=str, min=float, max=float, step=float, base=float, expression=str :param d: the dictionary with the parameters ...
python
def y(self, d): """ Allows to configure the Y of the grid with one method call. Keys for the dictionary: property, min, max, step, base, expression Types: property=str, min=float, max=float, step=float, base=float, expression=str :param d: the dictionary with the parameters ...
[ "def", "y", "(", "self", ",", "d", ")", ":", "if", "\"property\"", "in", "d", ":", "javabridge", ".", "call", "(", "self", ".", "jobject", ",", "\"setYProperty\"", ",", "\"(Ljava/lang/String;)V\"", ",", "d", "[", "\"property\"", "]", ")", "if", "\"min\""...
Allows to configure the Y of the grid with one method call. Keys for the dictionary: property, min, max, step, base, expression Types: property=str, min=float, max=float, step=float, base=float, expression=str :param d: the dictionary with the parameters :type d: dict
[ "Allows", "to", "configure", "the", "Y", "of", "the", "grid", "with", "one", "method", "call", ".", "Keys", "for", "the", "dictionary", ":", "property", "min", "max", "step", "base", "expression", "Types", ":", "property", "=", "str", "min", "=", "float"...
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/classifiers.py#L430-L450
fracpete/python-weka-wrapper3
python/weka/classifiers.py
MultipleClassifiersCombiner.classifiers
def classifiers(self): """ Returns the list of base classifiers. :return: the classifier list :rtype: list """ objects = javabridge.get_env().get_object_array_elements( javabridge.call(self.jobject, "getClassifiers", "()[Lweka/classifiers/Classifier;")) ...
python
def classifiers(self): """ Returns the list of base classifiers. :return: the classifier list :rtype: list """ objects = javabridge.get_env().get_object_array_elements( javabridge.call(self.jobject, "getClassifiers", "()[Lweka/classifiers/Classifier;")) ...
[ "def", "classifiers", "(", "self", ")", ":", "objects", "=", "javabridge", ".", "get_env", "(", ")", ".", "get_object_array_elements", "(", "javabridge", ".", "call", "(", "self", ".", "jobject", ",", "\"getClassifiers\"", ",", "\"()[Lweka/classifiers/Classifier;\...
Returns the list of base classifiers. :return: the classifier list :rtype: list
[ "Returns", "the", "list", "of", "base", "classifiers", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/classifiers.py#L573-L585
fracpete/python-weka-wrapper3
python/weka/classifiers.py
MultipleClassifiersCombiner.classifiers
def classifiers(self, classifiers): """ Sets the base classifiers. :param classifiers: the list of base classifiers to use :type classifiers: list """ obj = [] for classifier in classifiers: obj.append(classifier.jobject) javabridge.call(self....
python
def classifiers(self, classifiers): """ Sets the base classifiers. :param classifiers: the list of base classifiers to use :type classifiers: list """ obj = [] for classifier in classifiers: obj.append(classifier.jobject) javabridge.call(self....
[ "def", "classifiers", "(", "self", ",", "classifiers", ")", ":", "obj", "=", "[", "]", "for", "classifier", "in", "classifiers", ":", "obj", ".", "append", "(", "classifier", ".", "jobject", ")", "javabridge", ".", "call", "(", "self", ".", "jobject", ...
Sets the base classifiers. :param classifiers: the list of base classifiers to use :type classifiers: list
[ "Sets", "the", "base", "classifiers", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/classifiers.py#L588-L598
fracpete/python-weka-wrapper3
python/weka/classifiers.py
Kernel.eval
def eval(self, id1, id2, inst1): """ Computes the result of the kernel function for two instances. If id1 == -1, eval use inst1 instead of an instance in the dataset. :param id1: the index of the first instance in the dataset :type id1: int :param id2: the index of the s...
python
def eval(self, id1, id2, inst1): """ Computes the result of the kernel function for two instances. If id1 == -1, eval use inst1 instead of an instance in the dataset. :param id1: the index of the first instance in the dataset :type id1: int :param id2: the index of the s...
[ "def", "eval", "(", "self", ",", "id1", ",", "id2", ",", "inst1", ")", ":", "jinst1", "=", "None", "if", "inst1", "is", "not", "None", ":", "jinst1", "=", "inst1", ".", "jobject", "return", "javabridge", ".", "call", "(", "self", ".", "jobject", ",...
Computes the result of the kernel function for two instances. If id1 == -1, eval use inst1 instead of an instance in the dataset. :param id1: the index of the first instance in the dataset :type id1: int :param id2: the index of the second instance in the dataset :type id2: int ...
[ "Computes", "the", "result", "of", "the", "kernel", "function", "for", "two", "instances", ".", "If", "id1", "==", "-", "1", "eval", "use", "inst1", "instead", "of", "an", "instance", "in", "the", "dataset", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/classifiers.py#L666-L681
fracpete/python-weka-wrapper3
python/weka/classifiers.py
KernelClassifier.kernel
def kernel(self): """ Returns the current kernel. :return: the kernel or None if none found :rtype: Kernel """ result = javabridge.static_call( "weka/classifiers/KernelHelper", "getKernel", "(Ljava/lang/Object;)Lweka/classifiers/functions/supportV...
python
def kernel(self): """ Returns the current kernel. :return: the kernel or None if none found :rtype: Kernel """ result = javabridge.static_call( "weka/classifiers/KernelHelper", "getKernel", "(Ljava/lang/Object;)Lweka/classifiers/functions/supportV...
[ "def", "kernel", "(", "self", ")", ":", "result", "=", "javabridge", ".", "static_call", "(", "\"weka/classifiers/KernelHelper\"", ",", "\"getKernel\"", ",", "\"(Ljava/lang/Object;)Lweka/classifiers/functions/supportVector/Kernel;\"", ",", "self", ".", "jobject", ")", "if...
Returns the current kernel. :return: the kernel or None if none found :rtype: Kernel
[ "Returns", "the", "current", "kernel", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/classifiers.py#L727-L741
fracpete/python-weka-wrapper3
python/weka/classifiers.py
KernelClassifier.kernel
def kernel(self, kernel): """ Sets the kernel. :param kernel: the kernel to set :type kernel: Kernel """ result = javabridge.static_call( "weka/classifiers/KernelHelper", "setKernel", "(Ljava/lang/Object;Lweka/classifiers/functions/supportVector/K...
python
def kernel(self, kernel): """ Sets the kernel. :param kernel: the kernel to set :type kernel: Kernel """ result = javabridge.static_call( "weka/classifiers/KernelHelper", "setKernel", "(Ljava/lang/Object;Lweka/classifiers/functions/supportVector/K...
[ "def", "kernel", "(", "self", ",", "kernel", ")", ":", "result", "=", "javabridge", ".", "static_call", "(", "\"weka/classifiers/KernelHelper\"", ",", "\"setKernel\"", ",", "\"(Ljava/lang/Object;Lweka/classifiers/functions/supportVector/Kernel;)Z\"", ",", "self", ".", "jo...
Sets the kernel. :param kernel: the kernel to set :type kernel: Kernel
[ "Sets", "the", "kernel", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/classifiers.py#L744-L756
fracpete/python-weka-wrapper3
python/weka/classifiers.py
CostMatrix.apply_cost_matrix
def apply_cost_matrix(self, data, rnd): """ Applies the cost matrix to the data. :param data: the data to apply to :type data: Instances :param rnd: the random number generator :type rnd: Random """ return Instances( javabridge.call( ...
python
def apply_cost_matrix(self, data, rnd): """ Applies the cost matrix to the data. :param data: the data to apply to :type data: Instances :param rnd: the random number generator :type rnd: Random """ return Instances( javabridge.call( ...
[ "def", "apply_cost_matrix", "(", "self", ",", "data", ",", "rnd", ")", ":", "return", "Instances", "(", "javabridge", ".", "call", "(", "self", ".", "jobject", ",", "\"applyCostMatrix\"", ",", "\"(Lweka/core/Instances;Ljava/util/Random;)Lweka/core/Instances;\"", ",", ...
Applies the cost matrix to the data. :param data: the data to apply to :type data: Instances :param rnd: the random number generator :type rnd: Random
[ "Applies", "the", "cost", "matrix", "to", "the", "data", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/classifiers.py#L924-L936
fracpete/python-weka-wrapper3
python/weka/classifiers.py
CostMatrix.expected_costs
def expected_costs(self, class_probs, inst=None): """ Calculates the expected misclassification cost for each possible class value, given class probability estimates. :param class_probs: the class probabilities :type class_probs: ndarray :return: the calculated costs ...
python
def expected_costs(self, class_probs, inst=None): """ Calculates the expected misclassification cost for each possible class value, given class probability estimates. :param class_probs: the class probabilities :type class_probs: ndarray :return: the calculated costs ...
[ "def", "expected_costs", "(", "self", ",", "class_probs", ",", "inst", "=", "None", ")", ":", "if", "inst", "is", "None", ":", "costs", "=", "javabridge", ".", "call", "(", "self", ".", "jobject", ",", "\"expectedCosts\"", ",", "\"([D)[D\"", ",", "javabr...
Calculates the expected misclassification cost for each possible class value, given class probability estimates. :param class_probs: the class probabilities :type class_probs: ndarray :return: the calculated costs :rtype: ndarray
[ "Calculates", "the", "expected", "misclassification", "cost", "for", "each", "possible", "class", "value", "given", "class", "probability", "estimates", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/classifiers.py#L938-L956
fracpete/python-weka-wrapper3
python/weka/classifiers.py
CostMatrix.get_cell
def get_cell(self, row, col): """ Returns the JB_Object at the specified location. :param row: the 0-based index of the row :type row: int :param col: the 0-based index of the column :type col: int :return: the object in that cell :rtype: JB_Object ...
python
def get_cell(self, row, col): """ Returns the JB_Object at the specified location. :param row: the 0-based index of the row :type row: int :param col: the 0-based index of the column :type col: int :return: the object in that cell :rtype: JB_Object ...
[ "def", "get_cell", "(", "self", ",", "row", ",", "col", ")", ":", "return", "javabridge", ".", "call", "(", "self", ".", "jobject", ",", "\"getCell\"", ",", "\"(II)Ljava/lang/Object;\"", ",", "row", ",", "col", ")" ]
Returns the JB_Object at the specified location. :param row: the 0-based index of the row :type row: int :param col: the 0-based index of the column :type col: int :return: the object in that cell :rtype: JB_Object
[ "Returns", "the", "JB_Object", "at", "the", "specified", "location", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/classifiers.py#L958-L970
fracpete/python-weka-wrapper3
python/weka/classifiers.py
CostMatrix.set_cell
def set_cell(self, row, col, obj): """ Sets the JB_Object at the specified location. Automatically unwraps JavaObject. :param row: the 0-based index of the row :type row: int :param col: the 0-based index of the column :type col: int :param obj: the object for th...
python
def set_cell(self, row, col, obj): """ Sets the JB_Object at the specified location. Automatically unwraps JavaObject. :param row: the 0-based index of the row :type row: int :param col: the 0-based index of the column :type col: int :param obj: the object for th...
[ "def", "set_cell", "(", "self", ",", "row", ",", "col", ",", "obj", ")", ":", "if", "isinstance", "(", "obj", ",", "JavaObject", ")", ":", "obj", "=", "obj", ".", "jobject", "javabridge", ".", "call", "(", "self", ".", "jobject", ",", "\"setCell\"", ...
Sets the JB_Object at the specified location. Automatically unwraps JavaObject. :param row: the 0-based index of the row :type row: int :param col: the 0-based index of the column :type col: int :param obj: the object for that cell :type obj: object
[ "Sets", "the", "JB_Object", "at", "the", "specified", "location", ".", "Automatically", "unwraps", "JavaObject", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/classifiers.py#L972-L986
fracpete/python-weka-wrapper3
python/weka/classifiers.py
CostMatrix.get_element
def get_element(self, row, col, inst=None): """ Returns the value at the specified location. :param row: the 0-based index of the row :type row: int :param col: the 0-based index of the column :type col: int :param inst: the Instace :type inst: Instance ...
python
def get_element(self, row, col, inst=None): """ Returns the value at the specified location. :param row: the 0-based index of the row :type row: int :param col: the 0-based index of the column :type col: int :param inst: the Instace :type inst: Instance ...
[ "def", "get_element", "(", "self", ",", "row", ",", "col", ",", "inst", "=", "None", ")", ":", "if", "inst", "is", "None", ":", "return", "javabridge", ".", "call", "(", "self", ".", "jobject", ",", "\"getElement\"", ",", "\"(II)D\"", ",", "row", ","...
Returns the value at the specified location. :param row: the 0-based index of the row :type row: int :param col: the 0-based index of the column :type col: int :param inst: the Instace :type inst: Instance :return: the value in that cell :rtype: float
[ "Returns", "the", "value", "at", "the", "specified", "location", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/classifiers.py#L988-L1006
fracpete/python-weka-wrapper3
python/weka/classifiers.py
CostMatrix.set_element
def set_element(self, row, col, value): """ Sets the float value at the specified location. :param row: the 0-based index of the row :type row: int :param col: the 0-based index of the column :type col: int :param value: the float value for that cell :typ...
python
def set_element(self, row, col, value): """ Sets the float value at the specified location. :param row: the 0-based index of the row :type row: int :param col: the 0-based index of the column :type col: int :param value: the float value for that cell :typ...
[ "def", "set_element", "(", "self", ",", "row", ",", "col", ",", "value", ")", ":", "javabridge", ".", "call", "(", "self", ".", "jobject", ",", "\"setElement\"", ",", "\"(IID)V\"", ",", "row", ",", "col", ",", "value", ")" ]
Sets the float value at the specified location. :param row: the 0-based index of the row :type row: int :param col: the 0-based index of the column :type col: int :param value: the float value for that cell :type value: float
[ "Sets", "the", "float", "value", "at", "the", "specified", "location", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/classifiers.py#L1008-L1020
fracpete/python-weka-wrapper3
python/weka/classifiers.py
CostMatrix.get_max_cost
def get_max_cost(self, class_value, inst=None): """ Gets the maximum cost for a particular class value. :param class_value: the class value to get the maximum cost for :type class_value: int :param inst: the Instance :type inst: Instance :return: the cost ...
python
def get_max_cost(self, class_value, inst=None): """ Gets the maximum cost for a particular class value. :param class_value: the class value to get the maximum cost for :type class_value: int :param inst: the Instance :type inst: Instance :return: the cost ...
[ "def", "get_max_cost", "(", "self", ",", "class_value", ",", "inst", "=", "None", ")", ":", "if", "inst", "is", "None", ":", "return", "javabridge", ".", "call", "(", "self", ".", "jobject", ",", "\"getMaxCost\"", ",", "\"(I)D\"", ",", "class_value", ")"...
Gets the maximum cost for a particular class value. :param class_value: the class value to get the maximum cost for :type class_value: int :param inst: the Instance :type inst: Instance :return: the cost :rtype: float
[ "Gets", "the", "maximum", "cost", "for", "a", "particular", "class", "value", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/classifiers.py#L1022-L1038
fracpete/python-weka-wrapper3
python/weka/classifiers.py
Evaluation.crossvalidate_model
def crossvalidate_model(self, classifier, data, num_folds, rnd, output=None): """ Crossvalidates the model using the specified data, number of folds and random number generator wrapper. :param classifier: the classifier to cross-validate :type classifier: Classifier :param data:...
python
def crossvalidate_model(self, classifier, data, num_folds, rnd, output=None): """ Crossvalidates the model using the specified data, number of folds and random number generator wrapper. :param classifier: the classifier to cross-validate :type classifier: Classifier :param data:...
[ "def", "crossvalidate_model", "(", "self", ",", "classifier", ",", "data", ",", "num_folds", ",", "rnd", ",", "output", "=", "None", ")", ":", "if", "output", "is", "None", ":", "generator", "=", "[", "]", "else", ":", "generator", "=", "[", "output", ...
Crossvalidates the model using the specified data, number of folds and random number generator wrapper. :param classifier: the classifier to cross-validate :type classifier: Classifier :param data: the data to evaluate on :type data: Instances :param num_folds: the number of fol...
[ "Crossvalidates", "the", "model", "using", "the", "specified", "data", "number", "of", "folds", "and", "random", "number", "generator", "wrapper", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/classifiers.py#L1133-L1155
fracpete/python-weka-wrapper3
python/weka/classifiers.py
Evaluation.summary
def summary(self, title=None, complexity=False): """ Generates a summary. :param title: optional title :type title: str :param complexity: whether to print the complexity information as well :type complexity: bool :return: the summary :rtype: str ...
python
def summary(self, title=None, complexity=False): """ Generates a summary. :param title: optional title :type title: str :param complexity: whether to print the complexity information as well :type complexity: bool :return: the summary :rtype: str ...
[ "def", "summary", "(", "self", ",", "title", "=", "None", ",", "complexity", "=", "False", ")", ":", "if", "title", "is", "None", ":", "return", "javabridge", ".", "call", "(", "self", ".", "jobject", ",", "\"toSummaryString\"", ",", "\"()Ljava/lang/String...
Generates a summary. :param title: optional title :type title: str :param complexity: whether to print the complexity information as well :type complexity: bool :return: the summary :rtype: str
[ "Generates", "a", "summary", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/classifiers.py#L1221-L1237
fracpete/python-weka-wrapper3
python/weka/classifiers.py
Evaluation.class_details
def class_details(self, title=None): """ Generates the class details. :param title: optional title :type title: str :return: the details :rtype: str """ if title is None: return javabridge.call( self.jobject, "toClassDetailsStr...
python
def class_details(self, title=None): """ Generates the class details. :param title: optional title :type title: str :return: the details :rtype: str """ if title is None: return javabridge.call( self.jobject, "toClassDetailsStr...
[ "def", "class_details", "(", "self", ",", "title", "=", "None", ")", ":", "if", "title", "is", "None", ":", "return", "javabridge", ".", "call", "(", "self", ".", "jobject", ",", "\"toClassDetailsString\"", ",", "\"()Ljava/lang/String;\"", ")", "else", ":", ...
Generates the class details. :param title: optional title :type title: str :return: the details :rtype: str
[ "Generates", "the", "class", "details", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/classifiers.py#L1239-L1253
fracpete/python-weka-wrapper3
python/weka/classifiers.py
Evaluation.matrix
def matrix(self, title=None): """ Generates the confusion matrix. :param title: optional title :type title: str :return: the matrix :rtype: str """ if title is None: return javabridge.call(self.jobject, "toMatrixString", "()Ljava/lang/String;"...
python
def matrix(self, title=None): """ Generates the confusion matrix. :param title: optional title :type title: str :return: the matrix :rtype: str """ if title is None: return javabridge.call(self.jobject, "toMatrixString", "()Ljava/lang/String;"...
[ "def", "matrix", "(", "self", ",", "title", "=", "None", ")", ":", "if", "title", "is", "None", ":", "return", "javabridge", ".", "call", "(", "self", ".", "jobject", ",", "\"toMatrixString\"", ",", "\"()Ljava/lang/String;\"", ")", "else", ":", "return", ...
Generates the confusion matrix. :param title: optional title :type title: str :return: the matrix :rtype: str
[ "Generates", "the", "confusion", "matrix", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/classifiers.py#L1255-L1267
fracpete/python-weka-wrapper3
python/weka/classifiers.py
Evaluation.predictions
def predictions(self): """ Returns the predictions. :return: the predictions. None if not available :rtype: list """ preds = javabridge.get_collection_wrapper( javabridge.call(self.jobject, "predictions", "()Ljava/util/ArrayList;")) if self.discard_pr...
python
def predictions(self): """ Returns the predictions. :return: the predictions. None if not available :rtype: list """ preds = javabridge.get_collection_wrapper( javabridge.call(self.jobject, "predictions", "()Ljava/util/ArrayList;")) if self.discard_pr...
[ "def", "predictions", "(", "self", ")", ":", "preds", "=", "javabridge", ".", "get_collection_wrapper", "(", "javabridge", ".", "call", "(", "self", ".", "jobject", ",", "\"predictions\"", ",", "\"()Ljava/util/ArrayList;\"", ")", ")", "if", "self", ".", "disca...
Returns the predictions. :return: the predictions. None if not available :rtype: list
[ "Returns", "the", "predictions", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/classifiers.py#L1905-L1925
fracpete/python-weka-wrapper3
python/weka/classifiers.py
PredictionOutput.print_all
def print_all(self, cls, data): """ Prints the header, classifications and footer to the buffer. :param cls: the classifier :type cls: Classifier :param data: the test data :type data: Instances """ javabridge.call( self.jobject, "print", "(Lw...
python
def print_all(self, cls, data): """ Prints the header, classifications and footer to the buffer. :param cls: the classifier :type cls: Classifier :param data: the test data :type data: Instances """ javabridge.call( self.jobject, "print", "(Lw...
[ "def", "print_all", "(", "self", ",", "cls", ",", "data", ")", ":", "javabridge", ".", "call", "(", "self", ".", "jobject", ",", "\"print\"", ",", "\"(Lweka/classifiers/Classifier;Lweka/core/Instances;)V\"", ",", "cls", ".", "jobject", ",", "data", ".", "jobje...
Prints the header, classifications and footer to the buffer. :param cls: the classifier :type cls: Classifier :param data: the test data :type data: Instances
[ "Prints", "the", "header", "classifications", "and", "footer", "to", "the", "buffer", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/classifiers.py#L2001-L2012
fracpete/python-weka-wrapper3
python/weka/classifiers.py
PredictionOutput.print_classifications
def print_classifications(self, cls, data): """ Prints the classifications to the buffer. :param cls: the classifier :type cls: Classifier :param data: the test data :type data: Instances """ javabridge.call( self.jobject, "printClassification...
python
def print_classifications(self, cls, data): """ Prints the classifications to the buffer. :param cls: the classifier :type cls: Classifier :param data: the test data :type data: Instances """ javabridge.call( self.jobject, "printClassification...
[ "def", "print_classifications", "(", "self", ",", "cls", ",", "data", ")", ":", "javabridge", ".", "call", "(", "self", ".", "jobject", ",", "\"printClassifications\"", ",", "\"(Lweka/classifiers/Classifier;Lweka/core/Instances;)V\"", ",", "cls", ".", "jobject", ","...
Prints the classifications to the buffer. :param cls: the classifier :type cls: Classifier :param data: the test data :type data: Instances
[ "Prints", "the", "classifications", "to", "the", "buffer", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/classifiers.py#L2014-L2025
fracpete/python-weka-wrapper3
python/weka/classifiers.py
PredictionOutput.print_classification
def print_classification(self, cls, inst, index): """ Prints the classification to the buffer. :param cls: the classifier :type cls: Classifier :param inst: the test instance :type inst: Instance :param index: the 0-based index of the test instance :type ...
python
def print_classification(self, cls, inst, index): """ Prints the classification to the buffer. :param cls: the classifier :type cls: Classifier :param inst: the test instance :type inst: Instance :param index: the 0-based index of the test instance :type ...
[ "def", "print_classification", "(", "self", ",", "cls", ",", "inst", ",", "index", ")", ":", "javabridge", ".", "call", "(", "self", ".", "jobject", ",", "\"printClassification\"", ",", "\"(Lweka/classifiers/Classifier;Lweka/core/Instance;I)V\"", ",", "cls", ".", ...
Prints the classification to the buffer. :param cls: the classifier :type cls: Classifier :param inst: the test instance :type inst: Instance :param index: the 0-based index of the test instance :type index: int
[ "Prints", "the", "classification", "to", "the", "buffer", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/classifiers.py#L2027-L2040
fracpete/python-weka-wrapper3
python/weka/core/tokenizers.py
Tokenizer.tokenize
def tokenize(self, s): """ Tokenizes the string. :param s: the string to tokenize :type s: str :return: the iterator :rtype: TokenIterator """ javabridge.call(self.jobject, "tokenize", "(Ljava/lang/String;)V", s) return TokenIterator(self)
python
def tokenize(self, s): """ Tokenizes the string. :param s: the string to tokenize :type s: str :return: the iterator :rtype: TokenIterator """ javabridge.call(self.jobject, "tokenize", "(Ljava/lang/String;)V", s) return TokenIterator(self)
[ "def", "tokenize", "(", "self", ",", "s", ")", ":", "javabridge", ".", "call", "(", "self", ".", "jobject", ",", "\"tokenize\"", ",", "\"(Ljava/lang/String;)V\"", ",", "s", ")", "return", "TokenIterator", "(", "self", ")" ]
Tokenizes the string. :param s: the string to tokenize :type s: str :return: the iterator :rtype: TokenIterator
[ "Tokenizes", "the", "string", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/core/tokenizers.py#L76-L86
fracpete/python-weka-wrapper3
python/weka/datagenerators.py
main
def main(): """ Runs a datagenerator from the command-line. Calls JVM start/stop automatically. Use -h to see all options. """ parser = argparse.ArgumentParser( description='Executes a data generator from the command-line. Calls JVM start/stop automatically.') parser.add_argument("-j", m...
python
def main(): """ Runs a datagenerator from the command-line. Calls JVM start/stop automatically. Use -h to see all options. """ parser = argparse.ArgumentParser( description='Executes a data generator from the command-line. Calls JVM start/stop automatically.') parser.add_argument("-j", m...
[ "def", "main", "(", ")", ":", "parser", "=", "argparse", ".", "ArgumentParser", "(", "description", "=", "'Executes a data generator from the command-line. Calls JVM start/stop automatically.'", ")", "parser", ".", "add_argument", "(", "\"-j\"", ",", "metavar", "=", "\"...
Runs a datagenerator from the command-line. Calls JVM start/stop automatically. Use -h to see all options.
[ "Runs", "a", "datagenerator", "from", "the", "command", "-", "line", ".", "Calls", "JVM", "start", "/", "stop", "automatically", ".", "Use", "-", "h", "to", "see", "all", "options", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/datagenerators.py#L180-L209
fracpete/python-weka-wrapper3
python/weka/datagenerators.py
DataGenerator.define_data_format
def define_data_format(self): """ Returns the data format. :return: the data format :rtype: Instances """ data = javabridge.call(self.jobject, "defineDataFormat", "()Lweka/core/Instances;") if data is None: return None else: return...
python
def define_data_format(self): """ Returns the data format. :return: the data format :rtype: Instances """ data = javabridge.call(self.jobject, "defineDataFormat", "()Lweka/core/Instances;") if data is None: return None else: return...
[ "def", "define_data_format", "(", "self", ")", ":", "data", "=", "javabridge", ".", "call", "(", "self", ".", "jobject", ",", "\"defineDataFormat\"", ",", "\"()Lweka/core/Instances;\"", ")", "if", "data", "is", "None", ":", "return", "None", "else", ":", "re...
Returns the data format. :return: the data format :rtype: Instances
[ "Returns", "the", "data", "format", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/datagenerators.py#L50-L61
fracpete/python-weka-wrapper3
python/weka/datagenerators.py
DataGenerator.dataset_format
def dataset_format(self): """ Returns the dataset format. :return: the format :rtype: Instances """ data = javabridge.call(self.jobject, "getDatasetFormat", "()Lweka/core/Instances;") if data is None: return None else: return Insta...
python
def dataset_format(self): """ Returns the dataset format. :return: the format :rtype: Instances """ data = javabridge.call(self.jobject, "getDatasetFormat", "()Lweka/core/Instances;") if data is None: return None else: return Insta...
[ "def", "dataset_format", "(", "self", ")", ":", "data", "=", "javabridge", ".", "call", "(", "self", ".", "jobject", ",", "\"getDatasetFormat\"", ",", "\"()Lweka/core/Instances;\"", ")", "if", "data", "is", "None", ":", "return", "None", "else", ":", "return...
Returns the dataset format. :return: the format :rtype: Instances
[ "Returns", "the", "dataset", "format", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/datagenerators.py#L74-L85
fracpete/python-weka-wrapper3
python/weka/datagenerators.py
DataGenerator.generate_example
def generate_example(self): """ Returns a single Instance. :return: the next example :rtype: Instance """ data = javabridge.call(self.jobject, "generateExample", "()Lweka/core/Instance;") if data is None: return None else: return I...
python
def generate_example(self): """ Returns a single Instance. :return: the next example :rtype: Instance """ data = javabridge.call(self.jobject, "generateExample", "()Lweka/core/Instance;") if data is None: return None else: return I...
[ "def", "generate_example", "(", "self", ")", ":", "data", "=", "javabridge", ".", "call", "(", "self", ".", "jobject", ",", "\"generateExample\"", ",", "\"()Lweka/core/Instance;\"", ")", "if", "data", "is", "None", ":", "return", "None", "else", ":", "return...
Returns a single Instance. :return: the next example :rtype: Instance
[ "Returns", "a", "single", "Instance", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/datagenerators.py#L116-L127
fracpete/python-weka-wrapper3
python/weka/datagenerators.py
DataGenerator.generate_examples
def generate_examples(self): """ Returns complete dataset. :return: the generated dataset :rtype: Instances """ data = javabridge.call(self.jobject, "generateExamples", "()Lweka/core/Instances;") if data is None: return None else: ...
python
def generate_examples(self): """ Returns complete dataset. :return: the generated dataset :rtype: Instances """ data = javabridge.call(self.jobject, "generateExamples", "()Lweka/core/Instances;") if data is None: return None else: ...
[ "def", "generate_examples", "(", "self", ")", ":", "data", "=", "javabridge", ".", "call", "(", "self", ".", "jobject", ",", "\"generateExamples\"", ",", "\"()Lweka/core/Instances;\"", ")", "if", "data", "is", "None", ":", "return", "None", "else", ":", "ret...
Returns complete dataset. :return: the generated dataset :rtype: Instances
[ "Returns", "complete", "dataset", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/datagenerators.py#L129-L140
fracpete/python-weka-wrapper3
python/weka/datagenerators.py
DataGenerator.make_copy
def make_copy(cls, generator): """ Creates a copy of the generator. :param generator: the generator to copy :type generator: DataGenerator :return: the copy of the generator :rtype: DataGenerator """ return from_commandline( to_commandline(gen...
python
def make_copy(cls, generator): """ Creates a copy of the generator. :param generator: the generator to copy :type generator: DataGenerator :return: the copy of the generator :rtype: DataGenerator """ return from_commandline( to_commandline(gen...
[ "def", "make_copy", "(", "cls", ",", "generator", ")", ":", "return", "from_commandline", "(", "to_commandline", "(", "generator", ")", ",", "classname", "=", "classes", ".", "get_classname", "(", "DataGenerator", "(", ")", ")", ")" ]
Creates a copy of the generator. :param generator: the generator to copy :type generator: DataGenerator :return: the copy of the generator :rtype: DataGenerator
[ "Creates", "a", "copy", "of", "the", "generator", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/datagenerators.py#L167-L177
fracpete/python-weka-wrapper3
python/weka/flow/source.py
FileSupplier.fix_config
def fix_config(self, options): """ Fixes the options, if necessary. I.e., it adds all required elements to the dictionary. :param options: the options to fix :type options: dict :return: the (potentially) fixed options :rtype: dict """ options = super(Fil...
python
def fix_config(self, options): """ Fixes the options, if necessary. I.e., it adds all required elements to the dictionary. :param options: the options to fix :type options: dict :return: the (potentially) fixed options :rtype: dict """ options = super(Fil...
[ "def", "fix_config", "(", "self", ",", "options", ")", ":", "options", "=", "super", "(", "FileSupplier", ",", "self", ")", ".", "fix_config", "(", "options", ")", "opt", "=", "\"files\"", "if", "opt", "not", "in", "options", ":", "options", "[", "opt"...
Fixes the options, if necessary. I.e., it adds all required elements to the dictionary. :param options: the options to fix :type options: dict :return: the (potentially) fixed options :rtype: dict
[ "Fixes", "the", "options", "if", "necessary", ".", "I", ".", "e", ".", "it", "adds", "all", "required", "elements", "to", "the", "dictionary", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/flow/source.py#L116-L133
fracpete/python-weka-wrapper3
python/weka/flow/source.py
FileSupplier.do_execute
def do_execute(self): """ The actual execution of the actor. :return: None if successful, otherwise error message :rtype: str """ for f in self.resolve_option("files"): self._output.append(Token(f)) return None
python
def do_execute(self): """ The actual execution of the actor. :return: None if successful, otherwise error message :rtype: str """ for f in self.resolve_option("files"): self._output.append(Token(f)) return None
[ "def", "do_execute", "(", "self", ")", ":", "for", "f", "in", "self", ".", "resolve_option", "(", "\"files\"", ")", ":", "self", ".", "_output", ".", "append", "(", "Token", "(", "f", ")", ")", "return", "None" ]
The actual execution of the actor. :return: None if successful, otherwise error message :rtype: str
[ "The", "actual", "execution", "of", "the", "actor", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/flow/source.py#L135-L144
fracpete/python-weka-wrapper3
python/weka/flow/source.py
ListFiles.quickinfo
def quickinfo(self): """ Returns a short string describing some of the options of the actor. :return: the info, None if not available :rtype: str """ return "dir: " + str(self.config["dir"]) \ + ", files: " + str(self.config["list_files"]) \ ...
python
def quickinfo(self): """ Returns a short string describing some of the options of the actor. :return: the info, None if not available :rtype: str """ return "dir: " + str(self.config["dir"]) \ + ", files: " + str(self.config["list_files"]) \ ...
[ "def", "quickinfo", "(", "self", ")", ":", "return", "\"dir: \"", "+", "str", "(", "self", ".", "config", "[", "\"dir\"", "]", ")", "+", "\", files: \"", "+", "str", "(", "self", ".", "config", "[", "\"list_files\"", "]", ")", "+", "\", dirs: \"", "+",...
Returns a short string describing some of the options of the actor. :return: the info, None if not available :rtype: str
[ "Returns", "a", "short", "string", "describing", "some", "of", "the", "options", "of", "the", "actor", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/flow/source.py#L173-L183
fracpete/python-weka-wrapper3
python/weka/flow/source.py
ListFiles.fix_config
def fix_config(self, options): """ Fixes the options, if necessary. I.e., it adds all required elements to the dictionary. :param options: the options to fix :type options: dict :return: the (potentially) fixed options :rtype: dict """ options = super(Lis...
python
def fix_config(self, options): """ Fixes the options, if necessary. I.e., it adds all required elements to the dictionary. :param options: the options to fix :type options: dict :return: the (potentially) fixed options :rtype: dict """ options = super(Lis...
[ "def", "fix_config", "(", "self", ",", "options", ")", ":", "options", "=", "super", "(", "ListFiles", ",", "self", ")", ".", "fix_config", "(", "options", ")", "opt", "=", "\"dir\"", "if", "opt", "not", "in", "options", ":", "options", "[", "opt", "...
Fixes the options, if necessary. I.e., it adds all required elements to the dictionary. :param options: the options to fix :type options: dict :return: the (potentially) fixed options :rtype: dict
[ "Fixes", "the", "options", "if", "necessary", ".", "I", ".", "e", ".", "it", "adds", "all", "required", "elements", "to", "the", "dictionary", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/flow/source.py#L185-L226
fracpete/python-weka-wrapper3
python/weka/flow/source.py
ListFiles._list
def _list(self, path, collected): """ Lists all the files/dirs in directory that match the pattern. :param path: the directory to search :type path: str :param collected: the files/dirs collected so far (full path) :type collected: list :return: None if successfu...
python
def _list(self, path, collected): """ Lists all the files/dirs in directory that match the pattern. :param path: the directory to search :type path: str :param collected: the files/dirs collected so far (full path) :type collected: list :return: None if successfu...
[ "def", "_list", "(", "self", ",", "path", ",", "collected", ")", ":", "list_files", "=", "self", ".", "resolve_option", "(", "\"list_files\"", ")", "list_dirs", "=", "self", ".", "resolve_option", "(", "\"list_dirs\"", ")", "recursive", "=", "self", ".", "...
Lists all the files/dirs in directory that match the pattern. :param path: the directory to search :type path: str :param collected: the files/dirs collected so far (full path) :type collected: list :return: None if successful, error otherwise :rtype: str
[ "Lists", "all", "the", "files", "/", "dirs", "in", "directory", "that", "match", "the", "pattern", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/flow/source.py#L228-L260
fracpete/python-weka-wrapper3
python/weka/flow/source.py
ListFiles.do_execute
def do_execute(self): """ The actual execution of the actor. :return: None if successful, otherwise error message :rtype: str """ directory = str(self.resolve_option("dir")) if not os.path.exists(directory): return "Directory '" + directory + "' does ...
python
def do_execute(self): """ The actual execution of the actor. :return: None if successful, otherwise error message :rtype: str """ directory = str(self.resolve_option("dir")) if not os.path.exists(directory): return "Directory '" + directory + "' does ...
[ "def", "do_execute", "(", "self", ")", ":", "directory", "=", "str", "(", "self", ".", "resolve_option", "(", "\"dir\"", ")", ")", "if", "not", "os", ".", "path", ".", "exists", "(", "directory", ")", ":", "return", "\"Directory '\"", "+", "directory", ...
The actual execution of the actor. :return: None if successful, otherwise error message :rtype: str
[ "The", "actual", "execution", "of", "the", "actor", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/flow/source.py#L262-L279
fracpete/python-weka-wrapper3
python/weka/flow/source.py
GetStorageValue.fix_config
def fix_config(self, options): """ Fixes the options, if necessary. I.e., it adds all required elements to the dictionary. :param options: the options to fix :type options: dict :return: the (potentially) fixed options :rtype: dict """ options = super(Get...
python
def fix_config(self, options): """ Fixes the options, if necessary. I.e., it adds all required elements to the dictionary. :param options: the options to fix :type options: dict :return: the (potentially) fixed options :rtype: dict """ options = super(Get...
[ "def", "fix_config", "(", "self", ",", "options", ")", ":", "options", "=", "super", "(", "GetStorageValue", ",", "self", ")", ".", "fix_config", "(", "options", ")", "opt", "=", "\"storage_name\"", "if", "opt", "not", "in", "options", ":", "options", "[...
Fixes the options, if necessary. I.e., it adds all required elements to the dictionary. :param options: the options to fix :type options: dict :return: the (potentially) fixed options :rtype: dict
[ "Fixes", "the", "options", "if", "necessary", ".", "I", ".", "e", ".", "it", "adds", "all", "required", "elements", "to", "the", "dictionary", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/flow/source.py#L317-L334
fracpete/python-weka-wrapper3
python/weka/flow/source.py
GetStorageValue.do_execute
def do_execute(self): """ The actual execution of the actor. :return: None if successful, otherwise error message :rtype: str """ if self.storagehandler is None: return "No storage handler available!" sname = str(self.resolve_option("storage_name")) ...
python
def do_execute(self): """ The actual execution of the actor. :return: None if successful, otherwise error message :rtype: str """ if self.storagehandler is None: return "No storage handler available!" sname = str(self.resolve_option("storage_name")) ...
[ "def", "do_execute", "(", "self", ")", ":", "if", "self", ".", "storagehandler", "is", "None", ":", "return", "\"No storage handler available!\"", "sname", "=", "str", "(", "self", ".", "resolve_option", "(", "\"storage_name\"", ")", ")", "if", "sname", "not",...
The actual execution of the actor. :return: None if successful, otherwise error message :rtype: str
[ "The", "actual", "execution", "of", "the", "actor", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/flow/source.py#L336-L349
fracpete/python-weka-wrapper3
python/weka/flow/source.py
ForLoop.fix_config
def fix_config(self, options): """ Fixes the options, if necessary. I.e., it adds all required elements to the dictionary. :param options: the options to fix :type options: dict :return: the (potentially) fixed options :rtype: dict """ options = super(For...
python
def fix_config(self, options): """ Fixes the options, if necessary. I.e., it adds all required elements to the dictionary. :param options: the options to fix :type options: dict :return: the (potentially) fixed options :rtype: dict """ options = super(For...
[ "def", "fix_config", "(", "self", ",", "options", ")", ":", "options", "=", "super", "(", "ForLoop", ",", "self", ")", ".", "fix_config", "(", "options", ")", "opt", "=", "\"min\"", "if", "opt", "not", "in", "options", ":", "options", "[", "opt", "]"...
Fixes the options, if necessary. I.e., it adds all required elements to the dictionary. :param options: the options to fix :type options: dict :return: the (potentially) fixed options :rtype: dict
[ "Fixes", "the", "options", "if", "necessary", ".", "I", ".", "e", ".", "it", "adds", "all", "required", "elements", "to", "the", "dictionary", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/flow/source.py#L389-L418
fracpete/python-weka-wrapper3
python/weka/flow/source.py
ForLoop.do_execute
def do_execute(self): """ The actual execution of the actor. :return: None if successful, otherwise error message :rtype: str """ for i in range( int(self.resolve_option("min")), int(self.resolve_option("max")) + 1, int(sel...
python
def do_execute(self): """ The actual execution of the actor. :return: None if successful, otherwise error message :rtype: str """ for i in range( int(self.resolve_option("min")), int(self.resolve_option("max")) + 1, int(sel...
[ "def", "do_execute", "(", "self", ")", ":", "for", "i", "in", "range", "(", "int", "(", "self", ".", "resolve_option", "(", "\"min\"", ")", ")", ",", "int", "(", "self", ".", "resolve_option", "(", "\"max\"", ")", ")", "+", "1", ",", "int", "(", ...
The actual execution of the actor. :return: None if successful, otherwise error message :rtype: str
[ "The", "actual", "execution", "of", "the", "actor", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/flow/source.py#L420-L432
fracpete/python-weka-wrapper3
python/weka/flow/source.py
LoadDatabase.fix_config
def fix_config(self, options): """ Fixes the options, if necessary. I.e., it adds all required elements to the dictionary. :param options: the options to fix :type options: dict :return: the (potentially) fixed options :rtype: dict """ opt = "db_url" ...
python
def fix_config(self, options): """ Fixes the options, if necessary. I.e., it adds all required elements to the dictionary. :param options: the options to fix :type options: dict :return: the (potentially) fixed options :rtype: dict """ opt = "db_url" ...
[ "def", "fix_config", "(", "self", ",", "options", ")", ":", "opt", "=", "\"db_url\"", "if", "opt", "not", "in", "options", ":", "options", "[", "opt", "]", "=", "\"jdbc:mysql://somehost:3306/somedatabase\"", "if", "opt", "not", "in", "self", ".", "help", "...
Fixes the options, if necessary. I.e., it adds all required elements to the dictionary. :param options: the options to fix :type options: dict :return: the (potentially) fixed options :rtype: dict
[ "Fixes", "the", "options", "if", "necessary", ".", "I", ".", "e", ".", "it", "adds", "all", "required", "elements", "to", "the", "dictionary", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/flow/source.py#L473-L518
fracpete/python-weka-wrapper3
python/weka/flow/source.py
LoadDatabase.do_execute
def do_execute(self): """ The actual execution of the actor. :return: None if successful, otherwise error message :rtype: str """ iquery = InstanceQuery() iquery.db_url = str(self.resolve_option("db_url")) iquery.user = str(self.resolve_option("user")) ...
python
def do_execute(self): """ The actual execution of the actor. :return: None if successful, otherwise error message :rtype: str """ iquery = InstanceQuery() iquery.db_url = str(self.resolve_option("db_url")) iquery.user = str(self.resolve_option("user")) ...
[ "def", "do_execute", "(", "self", ")", ":", "iquery", "=", "InstanceQuery", "(", ")", "iquery", ".", "db_url", "=", "str", "(", "self", ".", "resolve_option", "(", "\"db_url\"", ")", ")", "iquery", ".", "user", "=", "str", "(", "self", ".", "resolve_op...
The actual execution of the actor. :return: None if successful, otherwise error message :rtype: str
[ "The", "actual", "execution", "of", "the", "actor", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/flow/source.py#L520-L537
fracpete/python-weka-wrapper3
python/weka/flow/source.py
DataGenerator.fix_config
def fix_config(self, options): """ Fixes the options, if necessary. I.e., it adds all required elements to the dictionary. :param options: the options to fix :type options: dict :return: the (potentially) fixed options :rtype: dict """ opt = "setup" ...
python
def fix_config(self, options): """ Fixes the options, if necessary. I.e., it adds all required elements to the dictionary. :param options: the options to fix :type options: dict :return: the (potentially) fixed options :rtype: dict """ opt = "setup" ...
[ "def", "fix_config", "(", "self", ",", "options", ")", ":", "opt", "=", "\"setup\"", "if", "opt", "not", "in", "options", ":", "options", "[", "opt", "]", "=", "datagen", ".", "DataGenerator", "(", "classname", "=", "\"weka.datagenerators.classifiers.classific...
Fixes the options, if necessary. I.e., it adds all required elements to the dictionary. :param options: the options to fix :type options: dict :return: the (potentially) fixed options :rtype: dict
[ "Fixes", "the", "options", "if", "necessary", ".", "I", ".", "e", ".", "it", "adds", "all", "required", "elements", "to", "the", "dictionary", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/flow/source.py#L575-L596
fracpete/python-weka-wrapper3
python/weka/flow/source.py
DataGenerator.to_config
def to_config(self, k, v): """ Hook method that allows conversion of individual options. :param k: the key of the option :type k: str :param v: the value :type v: object :return: the potentially processed value :rtype: object """ if k == "...
python
def to_config(self, k, v): """ Hook method that allows conversion of individual options. :param k: the key of the option :type k: str :param v: the value :type v: object :return: the potentially processed value :rtype: object """ if k == "...
[ "def", "to_config", "(", "self", ",", "k", ",", "v", ")", ":", "if", "k", "==", "\"setup\"", ":", "return", "base", ".", "to_commandline", "(", "v", ")", "return", "super", "(", "DataGenerator", ",", "self", ")", ".", "to_config", "(", "k", ",", "v...
Hook method that allows conversion of individual options. :param k: the key of the option :type k: str :param v: the value :type v: object :return: the potentially processed value :rtype: object
[ "Hook", "method", "that", "allows", "conversion", "of", "individual", "options", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/flow/source.py#L598-L611
fracpete/python-weka-wrapper3
python/weka/flow/source.py
DataGenerator.from_config
def from_config(self, k, v): """ Hook method that allows converting values from the dictionary. :param k: the key in the dictionary :type k: str :param v: the value :type v: object :return: the potentially parsed value :rtype: object """ i...
python
def from_config(self, k, v): """ Hook method that allows converting values from the dictionary. :param k: the key in the dictionary :type k: str :param v: the value :type v: object :return: the potentially parsed value :rtype: object """ i...
[ "def", "from_config", "(", "self", ",", "k", ",", "v", ")", ":", "if", "k", "==", "\"setup\"", ":", "return", "from_commandline", "(", "v", ",", "classname", "=", "to_commandline", "(", "datagen", ".", "DataGenerator", "(", ")", ")", ")", "return", "su...
Hook method that allows converting values from the dictionary. :param k: the key in the dictionary :type k: str :param v: the value :type v: object :return: the potentially parsed value :rtype: object
[ "Hook", "method", "that", "allows", "converting", "values", "from", "the", "dictionary", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/flow/source.py#L613-L626
fracpete/python-weka-wrapper3
python/weka/flow/source.py
DataGenerator.do_execute
def do_execute(self): """ The actual execution of the actor. :return: None if successful, otherwise error message :rtype: str """ generator = datagen.DataGenerator.make_copy(self.resolve_option("setup")) generator.dataset_format = generator.define_data_format() ...
python
def do_execute(self): """ The actual execution of the actor. :return: None if successful, otherwise error message :rtype: str """ generator = datagen.DataGenerator.make_copy(self.resolve_option("setup")) generator.dataset_format = generator.define_data_format() ...
[ "def", "do_execute", "(", "self", ")", ":", "generator", "=", "datagen", ".", "DataGenerator", ".", "make_copy", "(", "self", ".", "resolve_option", "(", "\"setup\"", ")", ")", "generator", ".", "dataset_format", "=", "generator", ".", "define_data_format", "(...
The actual execution of the actor. :return: None if successful, otherwise error message :rtype: str
[ "The", "actual", "execution", "of", "the", "actor", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/flow/source.py#L628-L643
fracpete/python-weka-wrapper3
python/weka/flow/source.py
CombineStorage.fix_config
def fix_config(self, options): """ Fixes the options, if necessary. I.e., it adds all required elements to the dictionary. :param options: the options to fix :type options: dict :return: the (potentially) fixed options :rtype: dict """ options = super(Com...
python
def fix_config(self, options): """ Fixes the options, if necessary. I.e., it adds all required elements to the dictionary. :param options: the options to fix :type options: dict :return: the (potentially) fixed options :rtype: dict """ options = super(Com...
[ "def", "fix_config", "(", "self", ",", "options", ")", ":", "options", "=", "super", "(", "CombineStorage", ",", "self", ")", ".", "fix_config", "(", "options", ")", "opt", "=", "\"format\"", "if", "opt", "not", "in", "options", ":", "options", "[", "o...
Fixes the options, if necessary. I.e., it adds all required elements to the dictionary. :param options: the options to fix :type options: dict :return: the (potentially) fixed options :rtype: dict
[ "Fixes", "the", "options", "if", "necessary", ".", "I", ".", "e", ".", "it", "adds", "all", "required", "elements", "to", "the", "dictionary", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/flow/source.py#L681-L699
fracpete/python-weka-wrapper3
python/weka/flow/source.py
CombineStorage.do_execute
def do_execute(self): """ The actual execution of the actor. :return: None if successful, otherwise error message :rtype: str """ formatstr = str(self.resolve_option("format")) expanded = self.storagehandler.expand(formatstr) self._output.append(Token(exp...
python
def do_execute(self): """ The actual execution of the actor. :return: None if successful, otherwise error message :rtype: str """ formatstr = str(self.resolve_option("format")) expanded = self.storagehandler.expand(formatstr) self._output.append(Token(exp...
[ "def", "do_execute", "(", "self", ")", ":", "formatstr", "=", "str", "(", "self", ".", "resolve_option", "(", "\"format\"", ")", ")", "expanded", "=", "self", ".", "storagehandler", ".", "expand", "(", "formatstr", ")", "self", ".", "_output", ".", "appe...
The actual execution of the actor. :return: None if successful, otherwise error message :rtype: str
[ "The", "actual", "execution", "of", "the", "actor", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/flow/source.py#L701-L711
fracpete/python-weka-wrapper3
python/weka/flow/source.py
StringConstants.fix_config
def fix_config(self, options): """ Fixes the options, if necessary. I.e., it adds all required elements to the dictionary. :param options: the options to fix :type options: dict :return: the (potentially) fixed options :rtype: dict """ options = super(Str...
python
def fix_config(self, options): """ Fixes the options, if necessary. I.e., it adds all required elements to the dictionary. :param options: the options to fix :type options: dict :return: the (potentially) fixed options :rtype: dict """ options = super(Str...
[ "def", "fix_config", "(", "self", ",", "options", ")", ":", "options", "=", "super", "(", "StringConstants", ",", "self", ")", ".", "fix_config", "(", "options", ")", "opt", "=", "\"strings\"", "if", "opt", "not", "in", "options", ":", "options", "[", ...
Fixes the options, if necessary. I.e., it adds all required elements to the dictionary. :param options: the options to fix :type options: dict :return: the (potentially) fixed options :rtype: dict
[ "Fixes", "the", "options", "if", "necessary", ".", "I", ".", "e", ".", "it", "adds", "all", "required", "elements", "to", "the", "dictionary", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/flow/source.py#L749-L766
fracpete/python-weka-wrapper3
python/weka/flow/source.py
StringConstants.do_execute
def do_execute(self): """ The actual execution of the actor. :return: None if successful, otherwise error message :rtype: str """ for s in self.resolve_option("strings"): self._output.append(Token(s)) return None
python
def do_execute(self): """ The actual execution of the actor. :return: None if successful, otherwise error message :rtype: str """ for s in self.resolve_option("strings"): self._output.append(Token(s)) return None
[ "def", "do_execute", "(", "self", ")", ":", "for", "s", "in", "self", ".", "resolve_option", "(", "\"strings\"", ")", ":", "self", ".", "_output", ".", "append", "(", "Token", "(", "s", ")", ")", "return", "None" ]
The actual execution of the actor. :return: None if successful, otherwise error message :rtype: str
[ "The", "actual", "execution", "of", "the", "actor", ".", ":", "return", ":", "None", "if", "successful", "otherwise", "error", "message", ":", "rtype", ":", "str" ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/flow/source.py#L768-L777
fracpete/python-weka-wrapper3
python/weka/flow/sink.py
Sink.post_execute
def post_execute(self): """ Gets executed after the actual execution. :return: None if successful, otherwise error message :rtype: str """ result = super(Sink, self).post_execute() if result is None: self._input = None return result
python
def post_execute(self): """ Gets executed after the actual execution. :return: None if successful, otherwise error message :rtype: str """ result = super(Sink, self).post_execute() if result is None: self._input = None return result
[ "def", "post_execute", "(", "self", ")", ":", "result", "=", "super", "(", "Sink", ",", "self", ")", ".", "post_execute", "(", ")", "if", "result", "is", "None", ":", "self", ".", "_input", "=", "None", "return", "result" ]
Gets executed after the actual execution. :return: None if successful, otherwise error message :rtype: str
[ "Gets", "executed", "after", "the", "actual", "execution", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/flow/sink.py#L46-L56
fracpete/python-weka-wrapper3
python/weka/flow/sink.py
Console.fix_config
def fix_config(self, options): """ Fixes the options, if necessary. I.e., it adds all required elements to the dictionary. :param options: the options to fix :type options: dict :return: the (potentially) fixed options :rtype: dict """ options = super(Con...
python
def fix_config(self, options): """ Fixes the options, if necessary. I.e., it adds all required elements to the dictionary. :param options: the options to fix :type options: dict :return: the (potentially) fixed options :rtype: dict """ options = super(Con...
[ "def", "fix_config", "(", "self", ",", "options", ")", ":", "options", "=", "super", "(", "Console", ",", "self", ")", ".", "fix_config", "(", "options", ")", "opt", "=", "\"prefix\"", "if", "opt", "not", "in", "options", ":", "options", "[", "opt", ...
Fixes the options, if necessary. I.e., it adds all required elements to the dictionary. :param options: the options to fix :type options: dict :return: the (potentially) fixed options :rtype: dict
[ "Fixes", "the", "options", "if", "necessary", ".", "I", ".", "e", ".", "it", "adds", "all", "required", "elements", "to", "the", "dictionary", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/flow/sink.py#L129-L146
fracpete/python-weka-wrapper3
python/weka/flow/sink.py
FileOutputSink.fix_config
def fix_config(self, options): """ Fixes the options, if necessary. I.e., it adds all required elements to the dictionary. :param options: the options to fix :type options: dict :return: the (potentially) fixed options :rtype: dict """ options = super(Fil...
python
def fix_config(self, options): """ Fixes the options, if necessary. I.e., it adds all required elements to the dictionary. :param options: the options to fix :type options: dict :return: the (potentially) fixed options :rtype: dict """ options = super(Fil...
[ "def", "fix_config", "(", "self", ",", "options", ")", ":", "options", "=", "super", "(", "FileOutputSink", ",", "self", ")", ".", "fix_config", "(", "options", ")", "opt", "=", "\"output\"", "if", "opt", "not", "in", "options", ":", "options", "[", "o...
Fixes the options, if necessary. I.e., it adds all required elements to the dictionary. :param options: the options to fix :type options: dict :return: the (potentially) fixed options :rtype: dict
[ "Fixes", "the", "options", "if", "necessary", ".", "I", ".", "e", ".", "it", "adds", "all", "required", "elements", "to", "the", "dictionary", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/flow/sink.py#L185-L202
fracpete/python-weka-wrapper3
python/weka/flow/sink.py
DumpFile.fix_config
def fix_config(self, options): """ Fixes the options, if necessary. I.e., it adds all required elements to the dictionary. :param options: the options to fix :type options: dict :return: the (potentially) fixed options :rtype: dict """ options = super(Dum...
python
def fix_config(self, options): """ Fixes the options, if necessary. I.e., it adds all required elements to the dictionary. :param options: the options to fix :type options: dict :return: the (potentially) fixed options :rtype: dict """ options = super(Dum...
[ "def", "fix_config", "(", "self", ",", "options", ")", ":", "options", "=", "super", "(", "DumpFile", ",", "self", ")", ".", "fix_config", "(", "options", ")", "opt", "=", "\"append\"", "if", "opt", "not", "in", "options", ":", "options", "[", "opt", ...
Fixes the options, if necessary. I.e., it adds all required elements to the dictionary. :param options: the options to fix :type options: dict :return: the (potentially) fixed options :rtype: dict
[ "Fixes", "the", "options", "if", "necessary", ".", "I", ".", "e", ".", "it", "adds", "all", "required", "elements", "to", "the", "dictionary", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/flow/sink.py#L240-L257
fracpete/python-weka-wrapper3
python/weka/flow/sink.py
DumpFile.do_execute
def do_execute(self): """ The actual execution of the actor. :return: None if successful, otherwise error message :rtype: str """ result = None f = None try: if bool(self.resolve_option("append")): f = open(str(self.resolve_opt...
python
def do_execute(self): """ The actual execution of the actor. :return: None if successful, otherwise error message :rtype: str """ result = None f = None try: if bool(self.resolve_option("append")): f = open(str(self.resolve_opt...
[ "def", "do_execute", "(", "self", ")", ":", "result", "=", "None", "f", "=", "None", "try", ":", "if", "bool", "(", "self", ".", "resolve_option", "(", "\"append\"", ")", ")", ":", "f", "=", "open", "(", "str", "(", "self", ".", "resolve_option", "...
The actual execution of the actor. :return: None if successful, otherwise error message :rtype: str
[ "The", "actual", "execution", "of", "the", "actor", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/flow/sink.py#L259-L280
fracpete/python-weka-wrapper3
python/weka/flow/sink.py
ModelWriter.check_input
def check_input(self, token): """ Performs checks on the input token. Raises an exception if unsupported. :param token: the token to check :type token: Token """ if not isinstance(token.payload, ModelContainer): raise Exception(self.full_name + ": Input token...
python
def check_input(self, token): """ Performs checks on the input token. Raises an exception if unsupported. :param token: the token to check :type token: Token """ if not isinstance(token.payload, ModelContainer): raise Exception(self.full_name + ": Input token...
[ "def", "check_input", "(", "self", ",", "token", ")", ":", "if", "not", "isinstance", "(", "token", ".", "payload", ",", "ModelContainer", ")", ":", "raise", "Exception", "(", "self", ".", "full_name", "+", "\": Input token is not a ModelContainer!\"", ")" ]
Performs checks on the input token. Raises an exception if unsupported. :param token: the token to check :type token: Token
[ "Performs", "checks", "on", "the", "input", "token", ".", "Raises", "an", "exception", "if", "unsupported", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/flow/sink.py#L308-L316
fracpete/python-weka-wrapper3
python/weka/flow/sink.py
ModelWriter.do_execute
def do_execute(self): """ The actual execution of the actor. :return: None if successful, otherwise error message :rtype: str """ result = None cont = self.input.payload serialization.write_all( str(self.resolve_option("output")), ...
python
def do_execute(self): """ The actual execution of the actor. :return: None if successful, otherwise error message :rtype: str """ result = None cont = self.input.payload serialization.write_all( str(self.resolve_option("output")), ...
[ "def", "do_execute", "(", "self", ")", ":", "result", "=", "None", "cont", "=", "self", ".", "input", ".", "payload", "serialization", ".", "write_all", "(", "str", "(", "self", ".", "resolve_option", "(", "\"output\"", ")", ")", ",", "[", "cont", ".",...
The actual execution of the actor. :return: None if successful, otherwise error message :rtype: str
[ "The", "actual", "execution", "of", "the", "actor", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/flow/sink.py#L318-L330
fracpete/python-weka-wrapper3
python/weka/flow/sink.py
MatrixPlot.fix_config
def fix_config(self, options): """ Fixes the options, if necessary. I.e., it adds all required elements to the dictionary. :param options: the options to fix :type options: dict :return: the (potentially) fixed options :rtype: dict """ options = super(Mat...
python
def fix_config(self, options): """ Fixes the options, if necessary. I.e., it adds all required elements to the dictionary. :param options: the options to fix :type options: dict :return: the (potentially) fixed options :rtype: dict """ options = super(Mat...
[ "def", "fix_config", "(", "self", ",", "options", ")", ":", "options", "=", "super", "(", "MatrixPlot", ",", "self", ")", ".", "fix_config", "(", "options", ")", "opt", "=", "\"percent\"", "if", "opt", "not", "in", "options", ":", "options", "[", "opt"...
Fixes the options, if necessary. I.e., it adds all required elements to the dictionary. :param options: the options to fix :type options: dict :return: the (potentially) fixed options :rtype: dict
[ "Fixes", "the", "options", "if", "necessary", ".", "I", ".", "e", ".", "it", "adds", "all", "required", "elements", "to", "the", "dictionary", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/flow/sink.py#L358-L405
fracpete/python-weka-wrapper3
python/weka/flow/sink.py
LinePlot.fix_config
def fix_config(self, options): """ Fixes the options, if necessary. I.e., it adds all required elements to the dictionary. :param options: the options to fix :type options: dict :return: the (potentially) fixed options :rtype: dict """ options = super(Lin...
python
def fix_config(self, options): """ Fixes the options, if necessary. I.e., it adds all required elements to the dictionary. :param options: the options to fix :type options: dict :return: the (potentially) fixed options :rtype: dict """ options = super(Lin...
[ "def", "fix_config", "(", "self", ",", "options", ")", ":", "options", "=", "super", "(", "LinePlot", ",", "self", ")", ".", "fix_config", "(", "options", ")", "opt", "=", "\"attributes\"", "if", "opt", "not", "in", "options", ":", "options", "[", "opt...
Fixes the options, if necessary. I.e., it adds all required elements to the dictionary. :param options: the options to fix :type options: dict :return: the (potentially) fixed options :rtype: dict
[ "Fixes", "the", "options", "if", "necessary", ".", "I", ".", "e", ".", "it", "adds", "all", "required", "elements", "to", "the", "dictionary", "." ]
train
https://github.com/fracpete/python-weka-wrapper3/blob/d850ab1bdb25fbd5a8d86e99f34a397975425838/python/weka/flow/sink.py#L475-L522