bigml-nodered
Version:
BigML bindings for Nodered
221 lines (198 loc) • 8.56 kB
HTML
<style>
.bigml_node_label { fill: white; }
#palette-BigML .palette_node { color: white; }
#red-ui-palette-BigML .red-ui-palette-label { color: white; }
</style>
<script type="text/javascript">
RED.nodes.registerType('execution', {
category: 'BigML',
color: '#454957',
defaults: {"default_numeric_value":{"value":"none"},"tags":{"value":""},"name":{"value":"execution","required":true},"outputs":{"value":""},"reify":{"value":false},"creation_defaults":{"value":""},"inputs":{"value":""},"category":{"value":0},"webhook":{"value":""},"description":{"value":""},"input_maps":{"value":""},"scripts":{"value":""}},
inputs:1,
outputs:1,
inputLabels: '[script,arguments]',
outputLabels: 'execution',
icon: 'icon_execution.png',
label: function() {
return this.name || 'Execution';
},
labelStyle: function() {
return this.name?"bigml_node_label":"";
},
});
</script>
<script type="text/x-red" data-template-name="execution">
<div class="form-row">
<label for="node-input-name">
<i class="icon-tag"></i> Name
</label>
<input type=text id=node-input-name value='execution'>
</div>
<div class="form-row">
<label for="node-input-description">
<i class="icon-tag"></i> Description
</label>
<input type=text id=node-input-description >
</div>
<div class="form-row">
<label for="node-input-creation_defaults">
<i class="icon-tag"></i> Creation defaults
</label>
<input type=text id=node-input-creation_defaults placeholder='{ "source": {
"project": "project/54d9553bf0a5ea5fc0000016"
},
"ensemble": {
"number_of_models": 100, "sample_rate": 0.9 }}' >
</div>
<div class="form-row">
<label for="node-input-default_numeric_value">
<i class="icon-tag"></i> Default numeric value
</label>
<select id=node-input-default_numeric_value value='none'><option value=none>None</option> <option value=mean>Mean</option> <option value=median>Median</option> <option value=minimum>Minimum</option> <option value=maximum>Maximum</option> <option value=zero>Zero</option></select>
</div>
<div class="form-row">
<label for="node-input-input_maps">
<i class="icon-tag"></i> Input maps
</label>
<input type=text id=node-input-input_maps placeholder='{ "script/57361a3a10cb86ed59000152":
[["a", 10], ["b", 20]],
"script/552328ae10cb8619aa00000f" : [
["name", "Traffic data"], ["x", 20]]}' >
</div>
<div class="form-row">
<label for="node-input-inputs">
<i class="icon-tag"></i> Inputs
</label>
<input type=text id=node-input-inputs placeholder='[{"name": "remote_uri", "type": "string"},
{"name": "timeout", "type": "number",
"default": 10000, "description": "Timeout in ms"}]' >
</div>
<div class="form-row">
<label for="node-input-outputs">
<i class="icon-tag"></i> Outputs
</label>
<input type=text id=node-input-outputs placeholder='[{"name":"normalized-dataset","type":"dataset-id"},
{"name":"n","type":"number",
"description": "Number of anomalies"}]' >
</div>
<div class="form-row">
<label for="node-input-scripts">
<i class="icon-tag"></i> Scripts
</label>
<input type=text id=node-input-scripts placeholder='["script/57361a3a10cb86ed59000152", "script/552328ae10cb8619aa00000f"]' >
</div>
<div class="form-row">
<label for="node-input-tags">
<i class="icon-tag"></i> Tags
</label>
<input type=text id=node-input-tags placeholder='["A tag", "Another Tag"]' >
</div>
<div class="form-row">
<label for="node-input-category">
<i class="icon-tag"></i> Category
</label>
<select id=node-input-category value='0'><option value=5>5</option> <option value=Healthcare>Healthcare</option></select>
</div>
<div class="form-row">
<label for="node-input-webhook">
<i class="icon-tag"></i> Webhook
</label>
<input type=text id=node-input-webhook >
</div>
<div class="form-row">
<label for="node-input-reify">
<i class="icon-tag"></i> Reify
</label>
<input type=checkbox id=node-input-reify value='false'>
</div>
</script>
<script type="text/html" data-help-name="execution">
<p>Create BigML Execution.</p>
<h3>Details</h3>
<p>This node support all inputs defined in
<a href='https://bigml.com/api/executions' target=blank>BigML REST
API</a>. By default, it expects to receive
a <code>[script,arguments]</code> input (see below for more details) and
it will output the <code>execution</code> field of the created
resource.
</p>
<p>However, you can override default inputs and outputs by defining
the node port label so they match the desired input or output as
specified below.</p>
<p>Only when the node is used with the <code>reify</code> option
enabled, it will actually hit BigML and do its work there. This
generally means some resources will be created and sent through as
node outputs.</p>
<p>When the node is used with the <code>reify</code>option disabled,
it will generate WhizzML code and send it through to the next node
in the flow without hitting BigML. All WhizzML code created by this
node (and others) when not in <code>reify</code> mode is accumulated
and executed as a single WhizzML script by the first
downstream <code>reified</code> node.</p>
<h3>Inputs</h3>
<dl class="message-properties">
<dt>Name
<span class="property-type">:text</span>
</dt>
<dd>A name for this node.</dd>
<dt>Description
<span class="property-type">:text</span>
</dt>
<dd></dd>
<dt>Creation defaults
<span class="property-type">:json</span>
</dt>
<dd>A dictionary whose keys are resource type names (dataset, model, prediction, etc.) with a map of values for the corresponding defaults which will be used if the input values are not explicitly provided.</dd>
<dt>Default numeric value
<span class="property-type">:select</span>
</dt>
<dd>Substitute missing numeric values across all the numeric fields in the dataset.</dd>
<dt>Input maps
<span class="property-type">:json</span>
</dt>
<dd>A dictionary whose key is script/id and value is inputs below.</dd>
<dt>Inputs
<span class="property-type">:json</span>
</dt>
<dd>A list of inputs of the script with their name, type and optional default value and description.</dd>
<dt>Outputs
<span class="property-type">:json</span>
</dt>
<dd>A list of variables with their name, type, and optional description, defined in the source code of script, that will conform the outputs of execution.</dd>
<dt>Scripts
<span class="property-type">:json</span>
</dt>
<dd>A list of valid script identifiers to be executed sequentially.</dd>
<dt>Tags
<span class="property-type">:text</span>
</dt>
<dd>A list of tags to identify the resource.</dd>
<dt>Category
<span class="property-type">:select</span>
</dt>
<dd></dd>
<dt>Webhook
<span class="property-type">:text</span>
</dt>
<dd>A webhook url and an optional secret phrase.</dd>
<dt>Reify
<span class="property-type">:boolean</span>
</dt>
<dd>Execute the WhizzML code generated at this (and upstream) node(s). You need to enable this option if you want to get a result from your flow that you can pass to a non-BigML node.</dd>
</dl>
<h3>Outputs</h3>
<ol class="node-ports">
<dl class="message-properties">
<dt>payload <span class="property-type">string or
JSON</span></dt>
<dd>the <code>execution</code> of the created
BigML entity.</dd>
<dt>whizzml <span class="property-type">string</dt>
<dd>(only for <code>reified</code> nodes) the
generated WhizzML code which is fed into the next
node.
<dt>wzStack <span class="property-type">object</dt>
<dd>(only for <code>reified</code> nodes) private.
</dl>
</ol>
</script>