docs
installation
This doc will walk you through how to deploy, run, and receive explanations from a model operating on Rezon Cloud! As a prerequisite, you must have the Rezon CLI already installed on your machine. See the installation doc as needed.
Rezon currently supports both the tensorflow and pytorch frameworks. All models can be saved using any of the typical formats like .pt
.h5
etc. For more information on how to properly export your trained model in the correct configuration, view the below links:
Before moving on, we need to create a rezon config file in the root of your project by running the following command:
rezon init
Login or create an account on Rezon so that you can generate an api key for authenticating with Rezon api's through the CLI
rezon.toml
file with your api key and model configuration pathsMake sure the model paths are relative to the root of your project.
[config] api_key = "your_api_key_here" [model] model_type = "tensorflow" // You can also change this to "pytorch" model_path = "/path/to/json_file_model.h5" parameters = ["status", "credit duration", "credit history", "credit purpose", "credit amount", "savings", "employment duration", "installment rate", "personal status", "other debtors", "residence length", "property", "age", "other installment plans", "housing", "number credits", "job quality", "number of people liable", "telephone", "foreign worker"]
Use the below command to send your model up into the cloud so that Rezon has access to your model and can run its transparency algorithm:
rezon deploy
Once everything is finished deploying, you should receive a url similar to https://your-model-name-uc.a.run.app
Use the below command to run your model and receive your first output with explanations!
rezon run --model "your-model-name" --input "[YOUR_INPUT_INSTANCE]"
After invoking your model via the rezon run
command you should receive an output structure similar to the following:
[ { "output": [ 0.5022361874580383 ], "explanation": { "independent_term": [ [ 0.48696327904161185 ] ], "input_contributions": [ [ 0.0, 0.015334691468113589, 0.030305500987169852, 0.005515112254305426, 0.053454344127537065, 0.05505709843031249, 0.029243087425085763, 0.03094038057683645, 0.06161209768423147, 0.08336125656724616, 0.0021160924736673874, 0.10283303145848932, 0.05979473642283799, 0.019074929914776235, 0.038948814533971254, 0.08279316761658234, 0.0403501922095864, 0.05390911866790576, 0.12302118189681167, 0.11233516528453336 ] ], "input_dependencies": [ [ 0.34471481940252136, -0.2797065290597145, 0.2763879048418766, -0.03353209310262556, -0.243753340100885, 0.2008495564982657, 0.08889954410091054, -0.08062229801836501, 0.14047646497468486, 0.16894654103565432, -0.00385977691308387, -0.17051693399512044, 0.0908885701833314, 0.026763762061053527, 0.050745059922933336, -0.1006771241188512, -0.04599950801628408, -0.05784167647747232, 0.12466224725642346, -0.10784243597158227 ] ], "input_values": { "age": 12, "credit amount": 4, "credit duration": 1, "credit history": 2, "credit purpose": 3, "employment duration": 6, "foreign worker": 19, "housing": 14, "installment rate": 7, "job quality": 16, "number credits": 15, "number of people liable": 17, "other debtors": 9, "other installment plans": 13, "personal status": 8, "property": 11, "residence length": 10, "savings": 5, "status": 0, "telephone": 18 }, "linear_function_output": [ 0.50223769187363 ], "neural_network_output": [ 0.5022362470626831 ], "text_explanations": [ [ "For this instance, the output variable depends on: status Average, credit duration Average, credit history Average, credit purpose Average, credit amount Average, savings Average, employment duration Average, installment rate Average, personal status Average, other debtors Average, residence length Average, property Average, age Average, other installment plans Average, housing Average, number credits Average, job quality Average, number of people liable Average, telephone Average, foreign worker Average.", "For this instance, the contributions of the variables are: status Very Low, credit duration Very High, credit history Very High, credit purpose Very High, credit amount Very High, savings Very High, employment duration Very High, installment rate Very High, personal status Very High, other debtors Very High, residence length Very High, property Very High, age Very High, other installment plans Very High, housing Very High, number credits Very High, job quality Very High, number of people liable Very High, telephone Very High, foreign worker Very High.", "Because the input has values of: status Very Low, credit duration Very Low, credit history Very Low, credit purpose Very Low, credit amount Very Low, savings Very Low, employment duration Very Low, installment rate Very Low, personal status Very Low, other debtors Very Low, residence length Very Low, property Very Low, age Very Low, other installment plans Very Low, housing Very Low, number credits Very Low, job quality Very Low, number of people liable Very Low, telephone Very Low, foreign worker Very Low." ] ] } } ]