Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View mmerce's full-sized avatar
💭
Maintaining BigML bindings

Mercè Martín-Prats mmerce

💭
Maintaining BigML bindings
View GitHub Profile
@mmerce
mmerce / README.md
Last active October 6, 2017 12:55
Local batch centroid using Python bindings

Python example: local batch centroid

Using the Python bindings and its local cluster object to find the centroids for a CSV file.

Usage:

cat input.csv | python local_batch_centroid.py > centroids.csv
@mmerce
mmerce / unite_datasets.json
Last active August 25, 2017 16:49
Unite datasets
{
"name": "Unite datasets",
"description": "Creating a dataset that contains the data in several datasets tagged with an identifier.",
"inputs": [
{
"name": "tag",
"type": "string",
"description": "tag identifier"
}
],
@mmerce
mmerce / forecast_dataset.json
Last active August 24, 2017 23:18
Creating a dataset containing the forecast prediction
{
"name": "Forecast dataset",
"description": "Creating a dataset that contains the original fields and the forecast prediction for a certain ets-model",
"inputs": [
{
"name": "timeseries-id",
"type": "timeseries-id",
"description": "Select the timeseries"
},
{
@mmerce
mmerce / fields_update.json
Last active May 11, 2017 21:39
Updating fields type with a default type
{
"description": "Script that updates the field types for an existing Source. The `base-type` is assigned to all the fields unless otherwise stated in `explicit-types`.\nThe `explicit-types` argument expects a list of [field, type] pairs like:\n\n[[\"field1\", \"categorical\"], [\"field2\", \"numeric\"]]",
"inputs": [
{
"name": "source-id",
"type": "source-id",
"description": "Select the source to be updated"
},
{
"name": "base-type",
@mmerce
mmerce / iris.csv
Created October 27, 2016 21:25
Limiting parallel creation of resources in a loop with the Python bindings
sepal length sepal width petal length petal width species
5.1 3.5 1.4 0.2 Iris-setosa
4.9 3.0 1.4 0.2 Iris-setosa
4.7 3.2 1.3 0.2 Iris-setosa
4.6 3.1 1.5 0.2 Iris-setosa
5.0 3.6 1.4 0.2 Iris-setosa
5.4 3.9 1.7 0.4 Iris-setosa
4.6 3.4 1.4 0.3 Iris-setosa
5.0 3.4 1.5 0.2 Iris-setosa
4.4 2.9 1.4 0.2 Iris-setosa
@mmerce
mmerce / balanced_smacdown.whizzml
Created October 4, 2016 22:02
restricting SMACdown to use a balanced objective
;; Here's a custom generator for creating BigML ensembles. As
;; "random_candidate_ratio" tends towards 1, the ensemble becomes a
;; bag.
(define (smacdown-ensemble--model-params-generator objective-type)
(lambda ()
(let (max-trees 127
max-nodes 1999
regression (= "numeric" objective-type))
{"random_candidate_ratio" (rand)
"stat_pruning" (if (< (rand) 0.5) false true)
@mmerce
mmerce / README.md
Last active August 25, 2016 16:16
Example of multiple predictions from a test file using the multiple option of Model in the Python bindings

Python example: multiple local predictions

Using the python bindings and its local model object to predict from a CSV file you can create the predictions for test data stored in any local file. In the example, the CSV data is read from stdin and predictions are written in stdout, but this can be easily changed to use any local file.

The command options available are:

-h, --help show the help message and exit --delimiter DELIMITER

@mmerce
mmerce / bigmler.ipynb
Last active November 25, 2015 18:21
PyConES - BIGML command line tool, BigMLer
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mmerce
mmerce / python_bindings.ipynb
Last active November 25, 2015 18:12
PyConES 2015 - BIGML Python bindings
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mmerce
mmerce / evaluation.json
Created September 29, 2015 19:59
Cross-validation for regressions example
{"model": {"mean_squared_error_standard_deviation": 39.620234999999994, "average_mean_squared_error": 225.551395, "mean_absolute_error_standard_deviation": 1.6843499999999993, "r_squared_standard_deviation": 0.13543, "average_mean_absolute_error": 12.1284, "average_r_squared": 0.44447}, "random": {"mean_squared_error_standard_deviation": 218.02284500000002, "average_mean_squared_error": 944.4215550000001, "mean_absolute_error_standard_deviation": 4.773059999999999, "r_squared_standard_deviation": 0.693865, "average_mean_absolute_error": 24.850749999999998, "average_r_squared": -1.335135}, "mean": {"mean_squared_error_standard_deviation": 29.405699999999996, "average_mean_squared_error": 413.17726000000005, "mean_absolute_error_standard_deviation": 0.9322850000000003, "r_squared_standard_deviation": 0.0, "average_mean_absolute_error": 17.066145, "average_r_squared": 0.0}}