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

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.

主站蜘蛛池模板: 阳信县| 孝感市| 襄城县| 西贡区| 乌什县| 疏勒县| 雅江县| 越西县| 南雄市| 德令哈市| 读书| 德庆县| 南宁市| 宜城市| 宝山区| 肃南| 高唐县| 伽师县| 柘荣县| 太白县| 寿光市| 安新县| 大英县| 平潭县| 乌兰浩特市| 南郑县| 舞钢市| 哈密市| 淮安市| 枞阳县| 安徽省| 乳山市| 湘潭市| 黎平县| 加查县| 姚安县| 隆子县| 平果县| 绿春县| 遂宁市| 元氏县|