bigml-nodered
Version:
BigML bindings for Nodered
397 lines (357 loc) • 15.8 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('logistic-regression', {
category: 'BigML',
color: '#454957',
defaults: {"missing_numerics":{"value":true},"objective_field":{"value":""},"default_numeric_value":{"value":"none"},"range":{"value":0},"normalize":{"value":false},"balance_fields":{"value":false},"replacement":{"value":false},"tags":{"value":""},"compute_status":{"value":false},"eps":{"value":1.0E-4},"optimize":{"value":false},"name":{"value":"logisticregression","required":true},"reify":{"value":false},"seed":{"value":""},"excluded_fields":{"value":""},"field_codings":{"value":""},"balance_objective":{"value":false},"number_of_model_candidates":{"value":128},"fields":{"value":""},"category":{"value":0},"bias":{"value":true},"webhook":{"value":""},"max_training_time":{"value":1800},"objective_weights":{"value":""},"out_of_bag":{"value":false},"c":{"value":1},"description":{"value":""},"sample_rate":{"value":1.0},"input_fields":{"value":""}},
inputs:1,
outputs:1,
inputLabels: 'dataset',
outputLabels: 'logisticregression',
icon: 'icon_logisticregression.png',
label: function() {
return this.name || 'Logistic Regression';
},
labelStyle: function() {
return this.name?"bigml_node_label":"";
},
});
</script>
<script type="text/x-red" data-template-name="logistic-regression">
<div class="form-row">
<label for="node-input-name">
<i class="icon-tag"></i> Name
</label>
<input type=text id=node-input-name value='logisticregression'>
</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-balance_fields">
<i class="icon-tag"></i> Balance fields
</label>
<input type=checkbox id=node-input-balance_fields value='false'>
</div>
<div class="form-row">
<label for="node-input-balance_objective">
<i class="icon-tag"></i> Balance objective
</label>
<input type=checkbox id=node-input-balance_objective value='false'>
</div>
<div class="form-row">
<label for="node-input-bias">
<i class="icon-tag"></i> Bias
</label>
<input type=checkbox id=node-input-bias value='true'>
</div>
<div class="form-row">
<label for="node-input-c">
<i class="icon-tag"></i> c
</label>
<input type=number step=any id=node-input-c value='1'>
</div>
<div class="form-row">
<label for="node-input-compute_status">
<i class="icon-tag"></i> Compute status
</label>
<input type=checkbox id=node-input-compute_status value='false'>
</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-eps">
<i class="icon-tag"></i> Eps
</label>
<input type=number step=any id=node-input-eps value='1.0E-4'>
</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-field_codings">
<i class="icon-tag"></i> Field codings
</label>
<input type=text id=node-input-field_codings placeholder='[{ "field": "workclass", "coding": "other", "coefficients": [[1,2,3,4,5,6,7,8], [-2,0,-2,0,2,0,2,0]]}, {"field": "sex","coding": "contrast","coefficients": [[-0.5, 0.5]] }, {"field": "native-country","coding": "dummy","dummy_class": "United-States"}]' >
</div>
<div class="form-row">
<label for="node-input-fields">
<i class="icon-tag"></i> Fields
</label>
<input type=text id=node-input-fields placeholder='{ "000000": { "name": "length_1", "label": "Length 1", "description": "Length 1 is sepal length"}, "000002": {"name": "length_2"}}' >
</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-missing_numerics">
<i class="icon-tag"></i> Missing numerics
</label>
<input type=checkbox id=node-input-missing_numerics value='true'>
</div>
<div class="form-row">
<label for="node-input-normalize">
<i class="icon-tag"></i> Normalize
</label>
<input type=checkbox id=node-input-normalize value='false'>
</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-optimize">
<i class="icon-tag"></i> Optimize
</label>
<input type=checkbox id=node-input-optimize value='false'>
</div>
<div class="form-row">
<label for="node-input-out_of_bag">
<i class="icon-tag"></i> Out of bag
</label>
<input type=checkbox id=node-input-out_of_bag value='false'>
</div>
<div class="form-row">
<label for="node-input-range">
<i class="icon-tag"></i> Range
</label>
<input type=number id=node-input-range value='0'>
</div>
<div class="form-row">
<label for="node-input-replacement">
<i class="icon-tag"></i> Replacement
</label>
<input type=checkbox id=node-input-replacement value='false'>
</div>
<div class="form-row">
<label for="node-input-sample_rate">
<i class="icon-tag"></i> Sample rate
</label>
<input type=number step=any id=node-input-sample_rate value='1.0'>
</div>
<div class="form-row">
<label for="node-input-seed">
<i class="icon-tag"></i> Seed
</label>
<input type=text id=node-input-seed >
</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="logistic-regression">
<p>Create BigML Logistic Regression.</p>
<h3>Details</h3>
<p>This node support all inputs defined in
<a href='https://bigml.com/api/logistic-regressions' 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>logisticregression</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>Balance fields
<span class="property-type">:boolean</span>
</dt>
<dd>Whether to scale each numeric field such that its values are zero mean with a standard deviation of 1, based on the field summary statistics at training time.</dd>
<dt>Balance objective
<span class="property-type">:boolean</span>
</dt>
<dd>Whether to balance classes proportionally to their category counts or not.</dd>
<dt>Bias
<span class="property-type">:boolean</span>
</dt>
<dd>Whether to include the bias term from the solution.</dd>
<dt>c
<span class="property-type">:float</span>
</dt>
<dd>The inverse of the regularization strength. Must be greater than 0.</dd>
<dt>Compute status
<span class="property-type">:boolean</span>
</dt>
<dd>Whether to compute statistics and significance tests.</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>Eps
<span class="property-type">:float</span>
</dt>
<dd>Stopping criteria for solver.</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>Field codings
<span class="property-type">:text</span>
</dt>
<dd>Coding schemes for categorical fields: dummy, contrast, or other.</dd>
<dt>Fields
<span class="property-type">:text</span>
</dt>
<dd>Updates the names, labels, and descriptions of the fields 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>Missing numerics
<span class="property-type">:boolean</span>
</dt>
<dd>Whether to create an additional binary predictor each numeric field which denotes a missing value.</dd>
<dt>Normalize
<span class="property-type">:boolean</span>
</dt>
<dd>Whether to normalize feature vectors in training and predicting.</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>Optimize
<span class="property-type">:boolean</span>
</dt>
<dd>Whether the model should be built with the automatic optimization.</dd>
<dt>Out of bag
<span class="property-type">:boolean</span>
</dt>
<dd>Setting this parameter to true will return a sequence of the out-of-bag instances instead of the sampled instances.</dd>
<dt>Range
<span class="property-type">:number</span>
</dt>
<dd>The range of successive instances to build the model.</dd>
<dt>Replacement
<span class="property-type">:boolean</span>
</dt>
<dd>Whether sampling should be performed with or without replacement.</dd>
<dt>Sample rate
<span class="property-type">:float</span>
</dt>
<dd>A real number between 0 and 1 specifying the sample rate.</dd>
<dt>Seed
<span class="property-type">:text</span>
</dt>
<dd>A string to be hashed to generate deterministic samples.</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>logisticregression</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>