Creating a new Code Object

Creating a new Code Object using the Rhino FCP UI

Navigate to the Code (formerly Models) Page

Project Dashboard.png

Use the left-hand navigation menu to click the Code menu item

 

Add a New Code Object

Models Main Page.png

Create a new model by clicking on the Create New Code Object button in the top-right corner

 

Enter your  new Code Object details

Create a Model-Python Code Model-Code Snippet.pngCode objects require knowing the number of inputs and outputs from your code. Those inputs and outputs are provided as data schemas. For example, if your code splits 1 dataset into a two datasets (e.g., train/test split), you will have a to have define a code object with 1 input schema and 2 output schemas. For additional robustness, you can specify actual schema that each dataset will use. Note that you can use the same schema in any of the inputs or outputs.

Pro-tip: If you don't need the additional robustness, you have the convenience to

  • [NEW] select "ANY" as input schema, which will allow to re-use this code object across any input dataset schema 
  • let the system figure out the output schemas with Auto-Generated Data Schemas.
Note: Creating code objects with multiple input and/or output datasets is supported in Python, Generalized and Interactive Container Code Objects. NVFlare Code Objects are not supported at this moment, though users can still perform as before learning and inference on data from multiple sites with NVFlare Code Objects. 

Depending on which Code Object you are trying to create, you will be prompted with different fields to complete. Follow the links below to finish the creation of your Code Object:

Creating a new Code Object version using the Rhino FCP UI

To create a new version, make sure you are on the page containing the original object you would like to create a new version of.  In the box where your original object is in the upper right-hand corner, you should see a + New Version button, like the one shown below:

New Version Button.png

Click that button and a new dialog should appear that will allow you to create a new version of your object.

Creating a New Version in Every Interface within the Rhino FCP UI

Below is a GIF showing all the interfaces within the Rhino FCP application where you can create a new Version. It displays the Schemas, Cohorts, and Models pages and the + New Version button you will press to create that new version of the schema, cohort, or model you are looking to create.

new_version.gif

 

 

Creating a new Code Object using the Rhino SDK

Prerequisites

Before starting this process, you should have already:

  1. Created a Project using the Rhino SDK or UI
  2. Created an Input Data Schema using the Rhino SDK or UI
  3. [Optional] Created an Output Data Schema using the Rhino SDK or UI. If you choose not to create an output Data Schema, the system will auto-generate the Data Schema of the output for your Code

 

Import your Python Dependencies

import rhino_health as rh
from rhino_health.lib.endpoints.code.code_objects_dataclass import (
    CodeObject,
    CodeObjectCreateInput,
    CodeTypes,
    CodeRunType
)
import getpass
  

 

Note: Remember to change all lines with CHANGE_ME comments above them in all the blocks below!

 

Log into the Rhino SDK using your FCP Credentials

Your username will be the email address you log into the Rhino FCP platform with. 


print("Logging In")

# CHANGE_ME: MY_USERNAME
my_username = "MY_USERNAME"

session = rh.login(username=my_username, password=getpass.getpass())
print("Logged In")

 

Complete the creation of your Code Object based on the Code Object Type

At this point, you will need the name of your project, your input Data Schema name, and optionally your output Data Schema name.  Depending on the type of Code Object you are looking to create, you may need some additional information.  For more information on how to create each Code Object type using the SDK, please refer to the following sections within each document:

If you have received an error or run into any issues throughout the process, please reach out to support@rhinohealth.com for more assistance.

Was this article helpful?
0 out of 0 found this helpful

Articles in this section