diff --git a/demos/boxdrop_structured/cml_sample.json b/demos/boxdrop_structured/cml_sample.json index ab89e95..aaab187 100644 --- a/demos/boxdrop_structured/cml_sample.json +++ b/demos/boxdrop_structured/cml_sample.json @@ -20,7 +20,7 @@ { "operation":"norm", "input":{"data":"$input"}, - "params":{"axis":0}, + "params":{"axis":1}, "output":"mag" }, { @@ -40,7 +40,7 @@ "output":"flat" }, { - "operation":"table2Map", + "operation":"table2map", "input":{ "table":"$flat", "colKeys":["0_0","1_0","2_0","amag_0","0_1","1_1","2_1","amag_1","0_2","1_2","2_2","amag_2"] diff --git a/demos/healthcare_price_example/healtchcare_demo.json b/demos/healthcare_price_example/healtchcare_demo.json index 4436149..c0f4dfc 100644 --- a/demos/healthcare_price_example/healtchcare_demo.json +++ b/demos/healthcare_price_example/healtchcare_demo.json @@ -1,115 +1,91 @@ { - "name":"Healthcare", - "description":"Transforms healthcare mostly catagorical data to useable format", - "version":"0.0.1", - "createdDate":"20190719", - "model":{ - "framework":"Tensorflow", - "tags":"serve", - "signatureDefs":"def_signature" - }, - "input": [ - { - "type": "map", - "label":"dataIn" - } - ], - "structure": [ + "name":"Healthcare", + "description":"Transforms healthcare mostly catagorical data to useable format", + "version":"0.0.1", + "createdDate":"20190719", + "model":{ + "framework":"Tensorflow", + "tags":"serve", + "signatureDefs":"def_signature" + }, +"input": [ + { + "type": "unkown", + "label":"dataIn" + } +], +"structure": [ + { + "operation":"replaceValue", + "input": { - - "operation":"replaceValue", - "input": - { - "data":"$dataIn", - "replaceMap":{"Yes":1,"No":0} - }, - "params":{"col": - [ - "cancer", - "heartdisease", - "cholesterol", - "diabetes", - "highbloodpressure", - "smoker" - ]}, - "output":"datatemp" + "data":"$dataIn", + "replaceMap":{"Yes":1,"No":0} }, + "params":{"col": + [ + "cancer", + "heartdisease", + "cholesterol", + "diabetes", + "highbloodpressure", + "smoker" + ]}, + "output":"datatemp" + }, + { + "operation":"replaceValue", + "input": { - "operation":"replaceValue", - "input": - { - "data":"$dataIn", - "replaceMap":{"Working":1,"NotWorking":0} - }, - "params":{"col":"currentlyworking"}, - "output":"datatemp" + "data":"$datatemp", + "replaceMap":{"Working":1,"NotWorking":0} }, - { - "operation":"normalize", - "input":{ - "data":"$datatemp['age']", - "value":100, - "minvalue":18 - }, - "output":"datatemp['age']" - }, - { - - "operation":"normalize", - "input":{ - "data":"$datatemp['bmi']", - "value":60, - "minvalue":15 - }, - "output":"datatemp['bmi']" + "params":{"col":"currentlyworking"}, + "output":"datatemp" + }, + { + "operation":"normalize", + "input":{ + "data":"$datatemp['age']", + "value":100, + "minvalue":18 }, - { - "operation":"oneHotEncoding", - "input":{"data":"$datatemp"}, - "params":{ - "inputColumns": "maritalstatus", - "keepOrig":false - }, - "output":"datatemp" + "output":"datatemp['age']" + }, + { + "operation":"normalize", + "input":{ + "data":"$datatemp['bmi']", + "value":60, + "minvalue":15 }, - { - "operation":"oneHotEncoding", - "input":{"data":"$datatemp"}, - "params":{ - "inputColumns": "state", - "keepOrig":false - }, - "output":"datatemp" + "output":"datatemp['bmi']" + }, + { + "operation":"oneHotEncoding", + "input":{"data":"$datatemp"}, + "params":{ + "inputColumns": ["maritalstatus", "state", "product", "occupation"], + "keepOrig":false }, - { - "operation":"oneHotEncoding", - "input":{"data":"$datatemp"}, - "params":{ - "inputColumns": "product", - "keepOrig":false - }, - "output":"datatemp" + "output":"datatemp" + }, + { + "operation":"dropCol", + "input" :{ + "data": "$datatemp" }, - { - "operation":"oneHotEncoding", - "input":{"data":"$datatemp"}, - "params":{ - "inputColumns": "occupation", - "keepOrig":false - }, - "output":"datatemp" + "params":{ + "col": ["city","lattitude","longitude","zipcode","year"], + "separateOut":false }, - { - "operation":"dropCol", - "params":{ - "col": ["city","lattitude","longitude","zipcode","year"], - "separateOut":false - }, - "output":"datatemp" - } - ], - "output": { - "type": "map", - "data":{"output":"$datatemp"} - } + "output":"datatemp" + } + ], +"output": { + "type": "map", + "data":{ + "output":"$datatemp" + } } +} \ No newline at end of file diff --git a/demos/imageprocess/cml_sample.json b/demos/imageprocess/cml_sample.json index 7830ec1..f20fa9f 100644 --- a/demos/imageprocess/cml_sample.json +++ b/demos/imageprocess/cml_sample.json @@ -1,51 +1,48 @@ { - "name":"ImageProccessing", - "description":"Converts image to data", - "version":"0.0.1", - "createdDate":"20190709", - "model":{ - "framework":"Tensorflow", - "tags":"serve", - "signatureDefs":"def_signature" - }, - "input": [ - { - "type": "array", - "label":"img" - } - ], - "structure": [ - { + "name":"ImageProccessing", + "description":"Converts image to data", + "version":"0.0.1", + "createdDate":"20190709", + "model":{ + "framework":"Tensorflow", + "tags":"serve", + "signatureDefs":"def_signature" + }, +"input": [ + { + "type": "image", + "label":"img" + } +], +"structure": [ + { - "operation":"resize", - "input":{"img":"$img"}, - "params":{"xsize":256,"ysize":256}, - "output":"rs" + "operation":"resize", + "input":{"img":"$img"}, + "params":{"xsize":256,"ysize":256}, + "output":"rs" + }, + { + "operation":"img2tensor", + "input":{"img":"$rs"}, + "params":{ + "removeAlpha":true, + "includeBatch":true }, + "output":"tensor" + }, + { + "operation":"normalize", + "input": { - "operation":"img2tensor", - "input":{"img":"$rs"}, - "params":{ - "removeAlpha":true, - "includeBatch":true - }, - "output":"tensor" + "data":"$tensor", + "value":256 }, - { - "operation":"normalize", - "input": - { - "data":"$tensor", - "value":256 - }, - "output":"normalized" - } - ], - "output": { - "type": "array", - "data":{ - "name":"inputs", - "data":"$normalized" - } - } + "output":"normalized" + } + ], +"output": { + "type": "array", + "data":"$normalized" +} } diff --git a/versions/0.1.6/schema.json b/versions/0.1.6/schema.json new file mode 100644 index 0000000..8b3c69f --- /dev/null +++ b/versions/0.1.6/schema.json @@ -0,0 +1,247 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": "http://example.com/example.json", + "type": "object", + "title": "The Root Schema", + "description": "Defines CML JSON to transform data.", + "properties": { + "model":{ + "$id": "#/properties/model", + "type": "object", + "title": "The Model Schema", + "description": "A description of model CML JSON will feed to or use of JSON.", + "default": {}, + "examples": [] + }, + "name": { + "$id": "#/properties/name", + "type": "string", + "title": "The Name Schema", + "description": "Name for catalyst-ml JSON object.", + "default": "Name", + "examples": [ + "FinancialStructure" + ] + }, + "description": { + "$id": "#/properties/description", + "type": "string", + "title": "The Description Schema", + "description": "A place to give a description of overall use/purpose of CML JSON object.", + "default": "", + "examples": [ + "Cleaning some financial data" + ] + }, + "version": { + "$id": "#/properties/version", + "type": "string", + "title": "The Version Schema", + "description": "To help track versions of CML Object.", + "default": "0.0.0", + "examples": [ + "0.0.1", + "1.0.1" + ] + }, + "createdDate": { + "$id": "#/properties/createdDate", + "type": "string", + "title": "The Createddate Schema", + "description": "Gives date of when creation or update of CML object.", + "default": "", + "examples": [ + "YYYYMMDD", + "20200101" + ] + }, + "input": { + "$id": "#/properties/input", + "type": "array", + "title": "The Input Schema", + "description": "Describes types properties of input data.", + "default": [], + "items": { + "$id": "#/properties/input/items", + "type": "object", + "title": "The Items Schema", + "description": "Defines a aingle input's meta data.", + "default": {}, + "examples": [ + { + "label": "inputs", + "type": "array" + } + ], + "required": [ + "type", + "label" + ], + "properties": { + "type": { + "$id": "#/properties/input/items/properties/type", + "type": "string", + "title": "The Type Schema", + "description": "Tells what type the input will be.", + "default": "", + "examples": [ + "array", + "map" + ] + }, + "label": { + "$id": "#/properties/input/items/properties/label", + "type": "string", + "title": "The Label Schema", + "description": "Gives a variable name to reference this data in structures or output.", + "default": "", + "examples": [ + "inputs", + "datain" + ] + } + } + } + }, + "structure": { + "$id": "#/properties/structure", + "type": "array", + "title": "The Structure Schema", + "description": "An explanation about the purpose of this instance.", + "default": [], + "items": { + "$id": "#/properties/structure/items", + "type": "object", + "title": "The Items Schema", + "description": "An explanation about the purpose of this instance.", + "default": {}, + "examples": [ + { + "output": "datatemp", + "input": { + "data": "$inputs" + }, + "operation": "concatMap" + }, + { + "output": "datatemp['Age']", + "input": { + "data": "$datatemp['Age']", + "value": 100.0, + "minval": 18.0 + }, + "operation": "normalize" + } + ], + "required": [ + "operation", + "input", + "output" + ], + "properties": { + "operation": { + "$id": "#/properties/structure/items/properties/operation", + "type": "string", + "title": "The Operation Schema", + "description": "Gives Name of Operation to run.", + "default": "", + "examples": [ + "concatMap" + ] + }, + "input": { + "$id": "#/properties/structure/items/properties/input", + "type": "object", + "title": "The Input Schema", + "description": "An explanation about the purpose of this instance.", + "default": {}, + "patternProperties": { + "^.*$": { + "anyOf": [ + {"type": "string"}, + {"type": "null"} + ] + } + }, + "additionalProperties": false, + "examples": [ + { + "data": "$inputs" + } + ] + }, + "params": { + "$id": "#/properties/structure/items/properties/params", + "type": "object", + "title": "The Params Schema", + "description": "Defining Parameters for the operation.", + "default": {}, + "patternProperties": { + "^.*$": { + "anyOf": [ + {"type": "string"}, + {"type": "null"} + ] + } + }, + "additionalProperties": false, + "examples": [ + { + "data": "$inputs" + } + ] + }, + "output": { + "$id": "#/properties/structure/items/properties/output", + "type": "string", + "title": "The Output Schema", + "description": "The label given to the data object being output by the operation so it can be used as a variable in other operations.", + "default": "", + "examples": [ + "datatemp" + ] + } + } + } + }, + "output": { + "$id": "#/properties/output", + "type": "object", + "title": "The Output Schema", + "description": "Defines the output of the cml object.", + "default": {}, + "examples": [ + { + "type": "map", + "data": "$datatab" + } + ], + "required": [ + "type", + "data" + ], + "properties": { + "type": { + "$id": "#/properties/output/properties/type", + "type": "string", + "title": "The Type Schema", + "description": "Describes the root type of the output data.", + "default": "", + "examples": [ + "map" + ] + }, + "data": { + "$id": "#/properties/output/properties/data", + "type": "object", + "title": "The Data Schema", + "description": "Building of output from defined variables.", + "default": {}, + "examples": [ + "$datatab" + ] + } + } + } + } +} \ No newline at end of file