bigml-nodered
Version:
BigML bindings for Nodered
281 lines (252 loc) • 11.3 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('optiml', {
category: 'BigML',
color: '#454957',
defaults: {"objective_field":{"value":""},"weight_field":{"value":""},"tags":{"value":""},"test_dataset":{"value":""},"name":{"value":"optiml","required":true},"reify":{"value":false},"model_types":{"value":"[\"model\", \"ensemble\", \"logisticregression\", \"deepnet\"]"},"excluded_fields":{"value":""},"creation_defaults":{"value":""},"number_of_model_candidates":{"value":128},"metric":{"value":null},"metric_class":{"value":""},"category":{"value":0},"webhook":{"value":""},"max_training_time":{"value":1800},"objective_weights":{"value":""},"description":{"value":""},"input_fields":{"value":""}},
inputs:1,
outputs:1,
inputLabels: 'dataset',
outputLabels: 'optiml',
icon: 'icon_optiml.png',
label: function() {
return this.name || 'OptiML';
},
labelStyle: function() {
return this.name?"bigml_node_label":"";
},
});
</script>
<script type="text/x-red" data-template-name="optiml">
<div class="form-row">
<label for="node-input-name">
<i class="icon-tag"></i> Name
</label>
<input type=text id=node-input-name value='optiml'>
</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='{ "all": {
"name" : "Optimized Model"
},
"all_models": {
"sample_rate": 0.5,
"missing_numerics": false }}' >
</div>
<div class="form-row">
<label for="node-input-excluded_fields">
<i class="icon-tag"></i> Excluded fields
</label>
<input type=text id=node-input-excluded_fields placeholder='["000000", "000002"]' >
</div>
<div class="form-row">
<label for="node-input-input_fields">
<i class="icon-tag"></i> Input fields
</label>
<input type=text id=node-input-input_fields placeholder='["000000", "000003"]' >
</div>
<div class="form-row">
<label for="node-input-max_training_time">
<i class="icon-tag"></i> Max training time
</label>
<input type=number id=node-input-max_training_time value='1800'>
</div>
<div class="form-row">
<label for="node-input-metric">
<i class="icon-tag"></i> Metric
</label>
<select id=node-input-metric ><option value=accuracy>Accuracy</option> <option value=area_under_pr_curve>Area_under_pr_curve</option> <option value=area_under_roc_curve>Area_under_roc_curve</option> <option value=f_measure>F_measure</option> <option value=kendalls_tau_b>Kendalls_tau_b</option> <option value=ks_statistic>Ks_statistic</option> <option value=max_phi>Max_phi</option> <option value=phi_coefficient>Phi_coefficient</option> <option value=precision>Precision</option> <option value=recall>Recall</option> <option value=spearmans_rho>Spearmans_rho</option></select>
</div>
<div class="form-row">
<label for="node-input-metric_class">
<i class="icon-tag"></i> Metric class
</label>
<input type=text id=node-input-metric_class placeholder='Yes' >
</div>
<div class="form-row">
<label for="node-input-model_types">
<i class="icon-tag"></i> Model types
</label>
<input type=text id=node-input-model_types value='["model", "ensemble", "logisticregression", "deepnet"]'>
</div>
<div class="form-row">
<label for="node-input-number_of_model_candidates">
<i class="icon-tag"></i> Number of model candidates
</label>
<input type=number id=node-input-number_of_model_candidates value='128'>
</div>
<div class="form-row">
<label for="node-input-objective_field">
<i class="icon-tag"></i> Objective field
</label>
<input type=text id=node-input-objective_field placeholder='{"id": "000003"}' >
</div>
<div class="form-row">
<label for="node-input-objective_weights">
<i class="icon-tag"></i> Objective weights
</label>
<input type=text id=node-input-objective_weights placeholder='[["Iris-versicolor", 2], ["Iris-virginica", 1], ["Iris-setosa", 1]]]' >
</div>
<div class="form-row">
<label for="node-input-test_dataset">
<i class="icon-tag"></i> Test dataset
</label>
<input type=text id=node-input-test_dataset placeholder='dataset/5af266884e1727be82000000' >
</div>
<div class="form-row">
<label for="node-input-weight_field">
<i class="icon-tag"></i> Weight field
</label>
<input type=text id=node-input-weight_field >
</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="optiml">
<p>Create BigML OptiML.</p>
<h3>Details</h3>
<p>This node support all inputs defined in
<a href='https://bigml.com/api/optimls' target=blank>BigML REST
API</a>. By default, it expects to receive
a <code>dataset</code> input (see below for more details) and
it will output the <code>optiml</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">:text</span>
</dt>
<dd>A map of default parameters to be used for the created resource.</dd>
<dt>Excluded fields
<span class="property-type">:text</span>
</dt>
<dd>Specifies the fields that won't be included in the dataset.</dd>
<dt>Input fields
<span class="property-type">:text</span>
</dt>
<dd>Specifies the fields to be included in the dataset.</dd>
<dt>Max training time
<span class="property-type">:number</span>
</dt>
<dd>The maximum training time allowed for the optimization, in seconds, as a strictly positive integer. Applicable only when optimize is set to true.</dd>
<dt>Metric
<span class="property-type">:select</span>
</dt>
<dd>The metric used to evaluate models used.</dd>
<dt>Metric class
<span class="property-type">:text</span>
</dt>
<dd>A particular class for which the metric should be taken for classification problems</dd>
<dt>Model types
<span class="property-type">:text</span>
</dt>
<dd>A list of the types of model to create during the search.</dd>
<dt>Number of model candidates
<span class="property-type">:number</span>
</dt>
<dd>The number of model candidates evaluated over the course of the optimization. Applicable only when optimize is set to true.</dd>
<dt>Objective field
<span class="property-type">:text</span>
</dt>
<dd>Specifies the default objective field.</dd>
<dt>Objective weights
<span class="property-type">:text</span>
</dt>
<dd>A list of category and weight pairs. One per objective class.</dd>
<dt>Test dataset
<span class="property-type">:text</span>
</dt>
<dd>A valid dataset/id to test the models. If not provided, test datasets are created from the training dataset</dd>
<dt>Weight field
<span class="property-type">:text</span>
</dt>
<dd>Any numeric field with no negative or missing values is valid as a weight field. Each instance will be weighted individually according to the weight field's value.</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>optiml</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>