官术网_书友最值得收藏!

Getting ready

In the previous section, we assigned the same weightage for each class; that is, the categorical cross entropy loss is the same if the magnitude of difference between actual and predicted is the same, irrespective of whether it is for the prediction of a default or not a default.

To understand the scenario further, let's consider the following example:

In the preceding scenario, the cross-entropy loss value is just the same, irrespective of the actual value of default.

However, we know that our objective is to capture as many actual defaulters as possible in the top 10% of predictions when ranked by probability.

Hence, let's go ahead and assign a higher weight of loss (a weight of 100) when the actual value of default is 1 and a lower weightage (a weight of 1) when the actual value of default is 0.

The previous scenario now changes as follows:

 

Now, if we notice the cross entropy loss, it is much higher when the predictions are wrong when the actual value of default is 1 compared to the predictions when the actual value of default is 0.

Now that we have understood the intuition of assigning weightages to classes, let's go ahead and assign weights to output classes in the credit default dataset.

All the steps performed to build the dataset and model remain the same as in the previous section, except for the model-fitting process.

主站蜘蛛池模板: 秭归县| 清远市| 庄浪县| 宣汉县| 邳州市| 陇川县| 五常市| 盘锦市| 措勤县| 竹山县| 崇信县| 昭苏县| 门头沟区| 内黄县| 应城市| 潜江市| 奉节县| 新龙县| 永胜县| 瓮安县| 江安县| 玉门市| 徐州市| 沽源县| 玛纳斯县| 建德市| 南昌市| 宿迁市| 海原县| 泸西县| 云霄县| 栾城县| 庄浪县| 仁布县| 镇赉县| 鲁甸县| 纳雍县| 大城县| 兴安县| 嫩江县| 中方县|