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

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.

主站蜘蛛池模板: 通山县| 阿坝| 临湘市| 隆德县| 巧家县| 娱乐| 广德县| 郎溪县| 松原市| 虹口区| 房山区| 古蔺县| 长葛市| 吉木萨尔县| 上犹县| 如东县| 洛川县| 肇州县| 静海县| 岚皋县| 神木县| 威信县| 福鼎市| 商都县| 灌云县| 滨州市| 页游| 汉源县| 淄博市| 东平县| 驻马店市| 峨边| 涞源县| 比如县| 昌江| 忻城县| 塘沽区| 福清市| 牟定县| 新津县| 麻栗坡县|