Creating Custom Fields

Now that our data was processed and an investigations page is open to you, let’s build new fields derived from our data.

Create a new field - "city"

For example, in our data, we are exporting the city and the state of the loan requester, but some city names exist in a couple of states, so we would like to get a new field which is the city and the state.
On the configurations page, search for the "city" field. On the right of the field, click on the "edit field" button.
First, under the "Function" tab, change the "Identity" function to "concat_strings". In the first source, add "state". Now click on "add source" and under "source 2" add "city". Lastly, under "Arguments" add an underscore as a separator.

Once this is defined we can click “add field” and it will be saved to the config.

Create a new field - "credit_label_abs_delta"

Another example for a field we can create is the absolute delta between the label (whether the loan was paid back or not, 1 or 0), and the credit score our model produced. We are sending a "label" field in the "train" and "test" data sets, and for the inference data, we are sending a "loan_paid_back" field in the feedback data. Both fields represent the same "ground truth" data, so we will merge both fields to one "label" field.
To do this, on the configurations page search for the "label" field and click on the edit button on the right. Now under the function tab, next to the source, click on "Add fallback". This feature allows you to state a number of sources for a field, where Mona will search for a value in the first source, and if not found will search for a value in the second source. Now under the first source add "loan_paid_back" and under the second source add "label". Now click on "Save changes".

Now let's use this field to create a delta between the label and the credit_score. The bigger this delta is, the worse our model performed. Again we click on “add field”. Now add a name - we will call this field “credit_label_delta”. Under type, we will choose "numeric". Now under “function” we will choose the “delta” function and add the 2 sources - “label” and “credit_score”. As you can see, on the right, you have an example of how to use each function.

Once this is defined we can click “add field” and it will be saved to the config.

Once we have saved the "credit_label_delta", we will add a new numeric field and call it "credit_label_abs_delta". Now under the function tab, choose "abs_value", and add the "credit_label_delta" field as the source. Again, once this is defined we can click “add field” and it will be saved to the config.

Create a new field - "offered_approved_delta_normalized"

Let's create one more field. We want to have the normalized delta between the "offerd_amount" and the "approved_amount". For this, we will need to create 2 fields with 2 different field build functions.
The first field we will create is the delta between "offerd_amount" and "approved_amount".
Just like the last field we created, we start with clicking on “add field”. Now add a name - we will call this field “offered_approved_delta”. Under type, we will choose "numeric". Now under “function” we will choose the “delta” function and add the 2 sources - “offerd_amount” and “approved_amount”. When all is set we will click on "add field" to save it.

Next, we will use this field to create another field. Click on “add field”. Now add a name - we will call this field “offered_approved_delta_normalized”. Again under type, we will choose "numeric", and under "function" we will choose "divide". Now in sources, we will add "offered_approved_delta" as the first source and "offered_amount" as the second. When all is set we will click on "add field" to save it.

Lastly, since this is a numeric field, we can choose whether we want to add segmentation to it or not. If so, under “segmentation” we can add a new segmentation, and now choose the type - either by "bucket size", by "number of buckets", as a "logarithmic scale", or "discrete". We will choose bucket size and set it as 0.05. Now let’s save the segmentation and now save the field.


Did this page help you?