Using the python bindings and its local model object to predict from a csv file.
Usage:
cat input.csv | python act_model.js > predictions.csv
user_id | gender | age_range | occupation | zipcode | movie_id | title | genres | rating | |
---|---|---|---|---|---|---|---|---|---|
1 | Female | Under 18 | K-12 student | 48067 | 1193 | One Flew Over the Cuckoo's Nest (1975) | Drama | 5 | |
1 | Female | Under 18 | K-12 student | 48067 | 661 | James and the Giant Peach (1996) | Animation$Children's$Musical | 3 | |
1 | Female | Under 18 | K-12 student | 48067 | 914 | My Fair Lady (1964) | Musical$Romance | 3 | |
1 | Female | Under 18 | K-12 student | 48067 | 3408 | Erin Brockovich (2000) | Drama | 4 | |
1 | Female | Under 18 | K-12 student | 48067 | 2355 | Bug's Life, A (1998) | Animation$Children's$Comedy | 5 | |
1 | Female | Under 18 | K-12 student | 48067 | 1197 | Princess Bride, The (1987) | Action$Adventure$Comedy$Romance | 3 | |
1 | Female | Under 18 | K-12 student | 48067 | 1287 | Ben-Hur (1959) | Action$Adventure$Drama | 5 | |
1 | Female | Under 18 | K-12 student | 48067 | 2804 | Christmas Story, A (1983) | Comedy$Drama | 5 | |
1 | Female | Under 18 | K-12 student | 48067 | 594 | Snow White and the Seven Dwarfs (1937) | Animation$Children's$Musical | 4 |
user_id | gender | age_range | occupation | zipcode | movie_id | title | genres | rating | |
---|---|---|---|---|---|---|---|---|---|
1 | Female | Under 18 | K-12 student | 48067 | 1193 | One Flew Over the Cuckoo's Nest (1975) | Drama | 5 | |
1 | Female | Under 18 | K-12 student | 48067 | 661 | James and the Giant Peach (1996) | Animation$Children's$Musical | 3 | |
1 | Female | Under 18 | K-12 student | 48067 | 914 | My Fair Lady (1964) | Musical$Romance | 3 | |
1 | Female | Under 18 | K-12 student | 48067 | 3408 | Erin Brockovich (2000) | Drama | 4 | |
1 | Female | Under 18 | K-12 student | 48067 | 2355 | Bug's Life, A (1998) | Animation$Children's$Comedy | 5 | |
1 | Female | Under 18 | K-12 student | 48067 | 1197 | Princess Bride, The (1987) | Action$Adventure$Comedy$Romance | 3 | |
1 | Female | Under 18 | K-12 student | 48067 | 1287 | Ben-Hur (1959) | Action$Adventure$Drama | 5 | |
1 | Female | Under 18 | K-12 student | 48067 | 2804 | Christmas Story, A (1983) | Comedy$Drama | 5 | |
1 | Female | Under 18 | K-12 student | 48067 | 594 | Snow White and the Seven Dwarfs (1937) | Animation$Children's$Musical | 4 |
{"inputs": [{"type": "number", | |
"name": "a", | |
"default": 1}, | |
{"type": "number", | |
"name": "b", | |
"default": 1}], | |
"outputs": [{"type": "number", | |
"name": "sum"}]} |
{"inputs": [{"type": "numeric", | |
"name": "a"}, | |
{"type": "numeric", | |
"name": "b"}], | |
"outputs": [{"type": "numeric", | |
"name": "sum"}]} |
;; Creating two scripts to be run together in the same execution | |
;; The scripts share no data and are not related, so they can be executed in parallel | |
;; the parameter for the execution is a list of maps describing each script | |
;; and its inputs | |
;; creating the first script to add two numbers | |
(define script1 (create-script {"source_code" "(+ a b)" | |
"name" "Sum script" | |
"inputs" [{"type" "number" "name" "a"} | |
{"type" "number" "name" "b"}]})) |
;; Creating and executing dependent scripts in a pipeline | |
;; script2 uses the output of an execution of script1 directly as input | |
;; and multiplies it by another input. | |
;; As one script uses the execution of the previous script, they will be executed | |
;; in a sequence | |
;; creating a first script that adds two numbers | |
(define script1 (create-script {"source_code" "(define sum (+ a b))" | |
"name" "Sum script" | |
"inputs" [{"type" "number" "name" "a"} |
;; Creating and executing dependent scripts. | |
;; script2 uses the output of an execution of script1 to multiply it by a number | |
;; As one script uses the execution of the previous script, they will be executed | |
;; in a sequence | |
;; creating the first script to add two numbers | |
(define script1 (create-script {"source_code" "(define sum (+ a b))" | |
"name" "Sum script" | |
"inputs" [{"type" "number" "name" "a"} | |
{"type" "number" "name" "b"}] |
{"name": "Move from projects to project", | |
"description": "Moves the non-script resources from a list of existing projects to a single destination project", | |
"inputs": [ | |
{ | |
"default": "", | |
"description": "Destination project ID", | |
"name": "destination", | |
"type": "project-id" | |
}, | |
{ |
{ | |
"name": "Pick random row in group", | |
"description": "Selects one of the rows (at random) from the ones grouped by a list of fields", | |
"inputs": [ | |
{ | |
"name": "dataset-id", | |
"type": "dataset-id", | |
"description": "The original dataset id to be filtered" | |
}, | |
{ |