{
  "id": 327116,
  "title": "Normalized Gini Coefficient (G). Default Rate (D).",
  "url": "/competitions/amex-default-prediction/discussion/327116",
  "author_name": "",
  "post_date": "2022-05-25T17:12:13.065389200Z",
  "votes": 94,
  "comment_count": 21,
  "views": 0,
  "content": "<h1>The Gini Coefficient</h1>\n<p>\"The Gini coefficient is a statistic which measures the ability of a scorecard or a characteristic to rank order risk. A Gini value of 0% means that the characteristic cannot distinguish good from bad cases.\"</p>\n<p>\"A  typical credit scorecard has a Gini coefficient of 40-60%. Behaviour scorecards have values of 70-80%. A very powerful characteristic can have a Gini coefficient of 25%.\"</p>\n<p>\"To calculate Gini values, assume that one has good and bad accounts rank ordered by score with the score sufficiently finely graded such as that there is only one case per score. The essential notion is that of a “flip”. A flip is a transposition of consecutive good and bad accounts.\"</p>\n<p>\"The Gini coefficient is the percentage of flips required to reach the rank ordering from a random assignment of goods and bads by score (i.e. with Gini = 0).\"</p>\n<p><a href=\"http://www.rhinorisk.com/Publications/Gini%20Coefficients.pdf\" target=\"_blank\">http://www.rhinorisk.com/Publications/Gini%20Coefficients.pdf</a> </p>\n<h1>What Is the Default Rate?</h1>\n<p>By Julia Kagan, Reviewed by Julius Mansa</p>\n<p>\"The default rate is the percentage of all outstanding loans that a lender has written off as unpaid after a prolonged period of missed payments. The term default rate–also called penalty rate–may also refer to the higher interest rate imposed on a borrower who has missed regular payments on a loan.\"</p>\n<p>\"An individual loan is typically declared in default if payment is 270 days late. Defaulted loans are typically written off from an issuer’s financial statements and transferred to a collection agency.\"</p>\n<p>\"The default rate of banks' loan portfolios, in addition to other indicators–such as the unemployment rate, the rate of inflation, the consumer confidence index, the level of personal bankruptcy filings, and stock market returns, among others–is sometimes used as an overall indicator of economic health.\"</p>\n<p><a href=\"https://www.investopedia.com/terms/d/defaultrate.asp#:~:text=The%20default%20rate%20is%20the,regular%20payments%20on%20a%20loan\" target=\"_blank\">https://www.investopedia.com/terms/d/defaultrate.asp#:~:text=The%20default%20rate%20is%20the,regular%20payments%20on%20a%20loan</a>.</p>\n<h1>The Default Rate Formula</h1>\n<p>\"The default rate is the rate of all loans issued by a lender or financial institution that is left unpaid by the borrower and declared to be in default.\"</p>\n<p>\"The lending institution will write off the entire value of defaulted loans, removing them from the books altogether. The default rate is important for institutions to reassess their risk from borrowers and is also an important representation of economic conditions.\"</p>\n<p>Default Rate = Number of Defaulted Loans/Total Number of Loans X 100</p>\n<h1>Period Until Default After Last Payment</h1>\n<p>Credit Card: 180 days</p>\n<p>Mortgage: 30 days</p>\n<p>Student Loan: 270 days</p>\n<h1>Routinely Missed Payments</h1>\n<p>\"Lending institutions may implement consequences for borrowers with routinely missed or late payments.\"</p>\n<p>\"One strategy a lender may implement is to increase the interest rate on the borrower’s remaining loan after delinquency. The substantially higher interest rate is referred to as the penalty rate. The lender may decide to lower the penalty rate if the borrower successfully makes on-time payments.\"</p>\n<p>\"Another strategy allows the lending institution to take hold of personal assets after a defaulted loan. Personal assets may include property, wages, retirement savings, or investments. For example, upon taking ownership of a property, the bank may recover some of its losses on the loan. Through the process of foreclosure, the bank can sell the property.\"</p>\n<p><a href=\"https://corporatefinanceinstitute.com/resources/knowledge/credit/default-rate/\" target=\"_blank\">https://corporatefinanceinstitute.com/resources/knowledge/credit/default-rate/</a></p>\n<h1>Default Risk Model</h1>\n<p>\"Benchmarking Deutsche Bundesbank’s Default Risk Model, the KMV Private Firm Model and Common Financial Ratios for<br>\nGerman Corporations\"</p>\n<p>Authors: Stefan Blochwitz,  Thilo Liebig,  Mikael Nyberg</p>\n<p>\"By comparing Gini curves and Gini coefficients that are determined on the same underlying dataset, the authors assessed the discriminative power of Deutsche Bundesbank’s Default Risk Model, KMV’s Private Firm Model and common financial ratios for<br>\nGerman corporations.\"</p>\n<p>\"While the purpose of the Bundesbank Default Risk Model is to decide whether a collateral is eligible for refinancing purposes, the model does this by assessing the creditworthiness of the individual borrowing company. Likewise, the goal of KMV’s Private Firm Model is to determine probabilities of default. However in both cases a best possible discriminative power is desirable.\"</p>\n<p>\"In this paper the authors showed that both the statistical model (discriminant analysis) that is the first step in the<br>\nBundesbank’s system and the structural model of KMV (Private Firm Model) provided powerful approaches to credit analysis with similar results. \"</p>\n<p>\"When incorporating additional information gained from other sources than the financial statements and<br>\nmarket trends, power of discrimination can further be improved as demonstrated by an expert system that is the second step of the Deutsche Bundesbank’s system.\"</p>\n<p>\"The focus of the paper is that of testing the performance of the models not to compare the model approaches in detail. The model construction and features are briefly described rather than exhaustively analysed.\"</p>\n<p><a href=\"https://www.bis.org/bcbs/events/oslo/liebigblo.pdf\" target=\"_blank\">https://www.bis.org/bcbs/events/oslo/liebigblo.pdf</a></p>\n<h1>Calculating the normalized Gini index</h1>\n<p>This function calculates the Gini index of a classification rule outputting probabilities. It is a classical metric in the context of Credit Scoring. It is equal to 2 times the AUC (Area Under ROC Curve) minus 1.</p>\n<p><a href=\"https://rdrr.io/cran/glmdisc/man/normalizedGini.html\" target=\"_blank\">https://rdrr.io/cran/glmdisc/man/normalizedGini.html</a><br>\n<a href=\"https://search.r-project.org/CRAN/refmans/glmdisc/html/normalizedGini.html\" target=\"_blank\">https://search.r-project.org/CRAN/refmans/glmdisc/html/normalizedGini.html</a></p>\n<h1>Is Gini a merely reformulation of AUC?</h1>\n<p>gini=2×AUC−1<br>\n\"A random prediction will yield a Gini score of 0 as opposed to the AUC which will be 0.5.\"</p>\n<p>\"You cannot calculate AUC for a continuous target. However, they also use normalized Gini in regression tasks, like predicting insurance losses.\"</p>\n<p><a href=\"https://stats.stackexchange.com/questions/306287/why-use-normalized-gini-score-instead-of-auc-as-evaluation\" target=\"_blank\">https://stats.stackexchange.com/questions/306287/why-use-normalized-gini-score-instead-of-auc-as-evaluation</a></p>\n<h1>The Normalized Gini Coefficient</h1>\n<p>\"The Normalized Gini coefficient is how far away we are with our sorted actual values from a random state measured in number of swaps\"</p>\n<p><a href=\"https://theblog.github.io/post/gini-coefficient-intuitive-explanation/#:~:text=The%20Normalized%20Gini%20coefficient%20is,could%20give%20you%20a%20better\" target=\"_blank\">https://theblog.github.io/post/gini-coefficient-intuitive-explanation/#:~:text=The%20Normalized%20Gini%20coefficient%20is,could%20give%20you%20a%20better</a></p>\n<h1>How to calculate Normalized Gini Coefficient in tensorflow</h1>\n<p>Answered by Maxim Oct 31, 2017 at 16:42</p>\n<p>def gini_tf(actual, pred):<br>\n  assert (len(actual) == len(pred))<br>\n  n = int(actual.get_shape()[-1])<br>\n  indices = tf.reverse(tf.nn.top_k(pred, k=n)[1], axis=0)<br>\n  a_s = tf.gather(actual, indices)<br>\n  a_c = tf.cumsum(a_s)<br>\n  giniSum = tf.reduce_sum(a_c) / tf.reduce_sum(a_s)<br>\n  giniSum -= (n + 1) / 2.<br>\n  return giniSum / n</p>\n<p><a href=\"https://stackoverflow.com/questions/46858373/how-to-calculate-normalized-gini-coefficient-in-tensorflow\" target=\"_blank\">https://stackoverflow.com/questions/46858373/how-to-calculate-normalized-gini-coefficient-in-tensorflow</a></p>\n<h1>Or</h1>\n<p>Answered by Anton Poznyakovskiy - Nov 15, 2017 at 19:09</p>\n<p>def gini(actual, pred):<br>\n    n = tf.shape(actual)[1]<br>\n    indices = tf.reverse(tf.nn.top_k(pred, k=n)[1], axis=[1])[0]<br>\n    a_s = tf.gather(tf.transpose(actual), tf.transpose(indices))<br>\n    a_c = tf.cumsum(a_s)<br>\n    giniSum = tf.reduce_sum(a_c) / tf.reduce_sum(a_s)<br>\n    giniSum = tf.subtract(giniSum, tf.divide(tf.to_float(n + 1), tf.constant(2.)))<br>\n    return giniSum / tf.to_float(n)</p>\n<p>def gini_normalized(a, p):<br>\n    return gini(a, p) / gini(a, a)</p>\n<p><a href=\"https://stackoverflow.com/questions/46858373/how-to-calculate-normalized-gini-coefficient-in-tensorflow\" target=\"_blank\">https://stackoverflow.com/questions/46858373/how-to-calculate-normalized-gini-coefficient-in-tensorflow</a></p>\n<h1>Why use Normalized Gini Score instead of AUC as evaluation?</h1>\n<p>\"The Kaggle website used to have this answer: \"There is a maximum achievable area for a \"perfect\" model since not all of the positive examples occur immediately. They use the normalized Gini coefficient by dividing the Gini coefficient of your model by the Gini coefficient of the perfect model.\" but it is not available anymore. webcache.googleusercontent.com/… – \"</p>\n<p>By Sextus Empiricus - Oct 10, 2017 at 1:01 </p>\n<p><a href=\"https://stats.stackexchange.com/questions/306287/why-use-normalized-gini-score-instead-of-auc-as-evaluation\" target=\"_blank\">https://stats.stackexchange.com/questions/306287/why-use-normalized-gini-score-instead-of-auc-as-evaluation</a></p>\n<h1>Intuitive Explanation of the Gini Coefficient</h1>\n<p><a href=\"https://theblog.github.io/post/gini-coefficient-intuitive-explanation/\" target=\"_blank\">https://theblog.github.io/post/gini-coefficient-intuitive-explanation/</a></p>\n<h1>A Kaggler Explanation for Gini Coefficient</h1>\n<p>Gini Coefficient - An Intuitive Explanation</p>\n<p><a href=\"https://www.kaggle.com/code/batzner/gini-coefficient-an-intuitive-explanation/notebook\" target=\"_blank\">https://www.kaggle.com/code/batzner/gini-coefficient-an-intuitive-explanation/notebook</a></p>\n<h1>Kaggle Competition evaluated using the Normalized Gini Coefficient.</h1>\n<p>Porto Seguro’s Safe Driver Prediction</p>\n<p><a href=\"https://www.kaggle.com/competitions/porto-seguro-safe-driver-prediction/overview/evaluation\" target=\"_blank\">https://www.kaggle.com/competitions/porto-seguro-safe-driver-prediction/overview/evaluation</a></p>\n<h1>Good luck creating a better customer experience for Amex cardholders</h1>\n<p>Predict if a customer will default in the future. <br>\nIt's a HUUUUUUUGE Dataset. But you all love it that way. Don't you Kagglers?</p>",
  "messages": [
    {
      "id": "1801388",
      "postDate": "05/25/2022 17:12:13",
      "content": "<h1>The Gini Coefficient</h1>\n<p>\"The Gini coefficient is a statistic which measures the ability of a scorecard or a characteristic to rank order risk. A Gini value of 0% means that the characteristic cannot distinguish good from bad cases.\"</p>\n<p>\"A  typical credit scorecard has a Gini coefficient of 40-60%. Behaviour scorecards have values of 70-80%. A very powerful characteristic can have a Gini coefficient of 25%.\"</p>\n<p>\"To calculate Gini values, assume that one has good and bad accounts rank ordered by score with the score sufficiently finely graded such as that there is only one case per score. The essential notion is that of a “flip”. A flip is a transposition of consecutive good and bad accounts.\"</p>\n<p>\"The Gini coefficient is the percentage of flips required to reach the rank ordering from a random assignment of goods and bads by score (i.e. with Gini = 0).\"</p>\n<p><a href=\"http://www.rhinorisk.com/Publications/Gini%20Coefficients.pdf\" target=\"_blank\">http://www.rhinorisk.com/Publications/Gini%20Coefficients.pdf</a> </p>\n<h1>What Is the Default Rate?</h1>\n<p>By Julia Kagan, Reviewed by Julius Mansa</p>\n<p>\"The default rate is the percentage of all outstanding loans that a lender has written off as unpaid after a prolonged period of missed payments. The term default rate–also called penalty rate–may also refer to the higher interest rate imposed on a borrower who has missed regular payments on a loan.\"</p>\n<p>\"An individual loan is typically declared in default if payment is 270 days late. Defaulted loans are typically written off from an issuer’s financial statements and transferred to a collection agency.\"</p>\n<p>\"The default rate of banks' loan portfolios, in addition to other indicators–such as the unemployment rate, the rate of inflation, the consumer confidence index, the level of personal bankruptcy filings, and stock market returns, among others–is sometimes used as an overall indicator of economic health.\"</p>\n<p><a href=\"https://www.investopedia.com/terms/d/defaultrate.asp#:~:text=The%20default%20rate%20is%20the,regular%20payments%20on%20a%20loan\" target=\"_blank\">https://www.investopedia.com/terms/d/defaultrate.asp#:~:text=The%20default%20rate%20is%20the,regular%20payments%20on%20a%20loan</a>.</p>\n<h1>The Default Rate Formula</h1>\n<p>\"The default rate is the rate of all loans issued by a lender or financial institution that is left unpaid by the borrower and declared to be in default.\"</p>\n<p>\"The lending institution will write off the entire value of defaulted loans, removing them from the books altogether. The default rate is important for institutions to reassess their risk from borrowers and is also an important representation of economic conditions.\"</p>\n<p>Default Rate = Number of Defaulted Loans/Total Number of Loans X 100</p>\n<h1>Period Until Default After Last Payment</h1>\n<p>Credit Card: 180 days</p>\n<p>Mortgage: 30 days</p>\n<p>Student Loan: 270 days</p>\n<h1>Routinely Missed Payments</h1>\n<p>\"Lending institutions may implement consequences for borrowers with routinely missed or late payments.\"</p>\n<p>\"One strategy a lender may implement is to increase the interest rate on the borrower’s remaining loan after delinquency. The substantially higher interest rate is referred to as the penalty rate. The lender may decide to lower the penalty rate if the borrower successfully makes on-time payments.\"</p>\n<p>\"Another strategy allows the lending institution to take hold of personal assets after a defaulted loan. Personal assets may include property, wages, retirement savings, or investments. For example, upon taking ownership of a property, the bank may recover some of its losses on the loan. Through the process of foreclosure, the bank can sell the property.\"</p>\n<p><a href=\"https://corporatefinanceinstitute.com/resources/knowledge/credit/default-rate/\" target=\"_blank\">https://corporatefinanceinstitute.com/resources/knowledge/credit/default-rate/</a></p>\n<h1>Default Risk Model</h1>\n<p>\"Benchmarking Deutsche Bundesbank’s Default Risk Model, the KMV Private Firm Model and Common Financial Ratios for<br>\nGerman Corporations\"</p>\n<p>Authors: Stefan Blochwitz,  Thilo Liebig,  Mikael Nyberg</p>\n<p>\"By comparing Gini curves and Gini coefficients that are determined on the same underlying dataset, the authors assessed the discriminative power of Deutsche Bundesbank’s Default Risk Model, KMV’s Private Firm Model and common financial ratios for<br>\nGerman corporations.\"</p>\n<p>\"While the purpose of the Bundesbank Default Risk Model is to decide whether a collateral is eligible for refinancing purposes, the model does this by assessing the creditworthiness of the individual borrowing company. Likewise, the goal of KMV’s Private Firm Model is to determine probabilities of default. However in both cases a best possible discriminative power is desirable.\"</p>\n<p>\"In this paper the authors showed that both the statistical model (discriminant analysis) that is the first step in the<br>\nBundesbank’s system and the structural model of KMV (Private Firm Model) provided powerful approaches to credit analysis with similar results. \"</p>\n<p>\"When incorporating additional information gained from other sources than the financial statements and<br>\nmarket trends, power of discrimination can further be improved as demonstrated by an expert system that is the second step of the Deutsche Bundesbank’s system.\"</p>\n<p>\"The focus of the paper is that of testing the performance of the models not to compare the model approaches in detail. The model construction and features are briefly described rather than exhaustively analysed.\"</p>\n<p><a href=\"https://www.bis.org/bcbs/events/oslo/liebigblo.pdf\" target=\"_blank\">https://www.bis.org/bcbs/events/oslo/liebigblo.pdf</a></p>\n<h1>Calculating the normalized Gini index</h1>\n<p>This function calculates the Gini index of a classification rule outputting probabilities. It is a classical metric in the context of Credit Scoring. It is equal to 2 times the AUC (Area Under ROC Curve) minus 1.</p>\n<p><a href=\"https://rdrr.io/cran/glmdisc/man/normalizedGini.html\" target=\"_blank\">https://rdrr.io/cran/glmdisc/man/normalizedGini.html</a><br>\n<a href=\"https://search.r-project.org/CRAN/refmans/glmdisc/html/normalizedGini.html\" target=\"_blank\">https://search.r-project.org/CRAN/refmans/glmdisc/html/normalizedGini.html</a></p>\n<h1>Is Gini a merely reformulation of AUC?</h1>\n<p>gini=2×AUC−1<br>\n\"A random prediction will yield a Gini score of 0 as opposed to the AUC which will be 0.5.\"</p>\n<p>\"You cannot calculate AUC for a continuous target. However, they also use normalized Gini in regression tasks, like predicting insurance losses.\"</p>\n<p><a href=\"https://stats.stackexchange.com/questions/306287/why-use-normalized-gini-score-instead-of-auc-as-evaluation\" target=\"_blank\">https://stats.stackexchange.com/questions/306287/why-use-normalized-gini-score-instead-of-auc-as-evaluation</a></p>\n<h1>The Normalized Gini Coefficient</h1>\n<p>\"The Normalized Gini coefficient is how far away we are with our sorted actual values from a random state measured in number of swaps\"</p>\n<p><a href=\"https://theblog.github.io/post/gini-coefficient-intuitive-explanation/#:~:text=The%20Normalized%20Gini%20coefficient%20is,could%20give%20you%20a%20better\" target=\"_blank\">https://theblog.github.io/post/gini-coefficient-intuitive-explanation/#:~:text=The%20Normalized%20Gini%20coefficient%20is,could%20give%20you%20a%20better</a></p>\n<h1>How to calculate Normalized Gini Coefficient in tensorflow</h1>\n<p>Answered by Maxim Oct 31, 2017 at 16:42</p>\n<p>def gini_tf(actual, pred):<br>\n  assert (len(actual) == len(pred))<br>\n  n = int(actual.get_shape()[-1])<br>\n  indices = tf.reverse(tf.nn.top_k(pred, k=n)[1], axis=0)<br>\n  a_s = tf.gather(actual, indices)<br>\n  a_c = tf.cumsum(a_s)<br>\n  giniSum = tf.reduce_sum(a_c) / tf.reduce_sum(a_s)<br>\n  giniSum -= (n + 1) / 2.<br>\n  return giniSum / n</p>\n<p><a href=\"https://stackoverflow.com/questions/46858373/how-to-calculate-normalized-gini-coefficient-in-tensorflow\" target=\"_blank\">https://stackoverflow.com/questions/46858373/how-to-calculate-normalized-gini-coefficient-in-tensorflow</a></p>\n<h1>Or</h1>\n<p>Answered by Anton Poznyakovskiy - Nov 15, 2017 at 19:09</p>\n<p>def gini(actual, pred):<br>\n    n = tf.shape(actual)[1]<br>\n    indices = tf.reverse(tf.nn.top_k(pred, k=n)[1], axis=[1])[0]<br>\n    a_s = tf.gather(tf.transpose(actual), tf.transpose(indices))<br>\n    a_c = tf.cumsum(a_s)<br>\n    giniSum = tf.reduce_sum(a_c) / tf.reduce_sum(a_s)<br>\n    giniSum = tf.subtract(giniSum, tf.divide(tf.to_float(n + 1), tf.constant(2.)))<br>\n    return giniSum / tf.to_float(n)</p>\n<p>def gini_normalized(a, p):<br>\n    return gini(a, p) / gini(a, a)</p>\n<p><a href=\"https://stackoverflow.com/questions/46858373/how-to-calculate-normalized-gini-coefficient-in-tensorflow\" target=\"_blank\">https://stackoverflow.com/questions/46858373/how-to-calculate-normalized-gini-coefficient-in-tensorflow</a></p>\n<h1>Why use Normalized Gini Score instead of AUC as evaluation?</h1>\n<p>\"The Kaggle website used to have this answer: \"There is a maximum achievable area for a \"perfect\" model since not all of the positive examples occur immediately. They use the normalized Gini coefficient by dividing the Gini coefficient of your model by the Gini coefficient of the perfect model.\" but it is not available anymore. webcache.googleusercontent.com/… – \"</p>\n<p>By Sextus Empiricus - Oct 10, 2017 at 1:01 </p>\n<p><a href=\"https://stats.stackexchange.com/questions/306287/why-use-normalized-gini-score-instead-of-auc-as-evaluation\" target=\"_blank\">https://stats.stackexchange.com/questions/306287/why-use-normalized-gini-score-instead-of-auc-as-evaluation</a></p>\n<h1>Intuitive Explanation of the Gini Coefficient</h1>\n<p><a href=\"https://theblog.github.io/post/gini-coefficient-intuitive-explanation/\" target=\"_blank\">https://theblog.github.io/post/gini-coefficient-intuitive-explanation/</a></p>\n<h1>A Kaggler Explanation for Gini Coefficient</h1>\n<p>Gini Coefficient - An Intuitive Explanation</p>\n<p><a href=\"https://www.kaggle.com/code/batzner/gini-coefficient-an-intuitive-explanation/notebook\" target=\"_blank\">https://www.kaggle.com/code/batzner/gini-coefficient-an-intuitive-explanation/notebook</a></p>\n<h1>Kaggle Competition evaluated using the Normalized Gini Coefficient.</h1>\n<p>Porto Seguro’s Safe Driver Prediction</p>\n<p><a href=\"https://www.kaggle.com/competitions/porto-seguro-safe-driver-prediction/overview/evaluation\" target=\"_blank\">https://www.kaggle.com/competitions/porto-seguro-safe-driver-prediction/overview/evaluation</a></p>\n<h1>Good luck creating a better customer experience for Amex cardholders</h1>\n<p>Predict if a customer will default in the future. <br>\nIt's a HUUUUUUUGE Dataset. But you all love it that way. Don't you Kagglers?</p>",
      "rawMarkdown": "#The Gini Coefficient\n\n\"The Gini coefficient is a statistic which measures the ability of a scorecard or a characteristic to rank order risk. A Gini value of 0% means that the characteristic cannot distinguish good from bad cases.\"\n\n\"A  typical credit scorecard has a Gini coefficient of 40-60%. Behaviour scorecards have values of 70-80%. A very powerful characteristic can have a Gini coefficient of 25%.\"\n\n\"To calculate Gini values, assume that one has good and bad accounts rank ordered by score with the score sufficiently finely graded such as that there is only one case per score. The essential notion is that of a “flip”. A flip is a transposition of consecutive good and bad accounts.\"\n\n\"The Gini coefficient is the percentage of flips required to reach the rank ordering from a random assignment of goods and bads by score (i.e. with Gini = 0).\"\n\nhttp://www.rhinorisk.com/Publications/Gini%20Coefficients.pdf \n\n#What Is the Default Rate?\n\nBy Julia Kagan, Reviewed by Julius Mansa\n\n\"The default rate is the percentage of all outstanding loans that a lender has written off as unpaid after a prolonged period of missed payments. The term default rate–also called penalty rate–may also refer to the higher interest rate imposed on a borrower who has missed regular payments on a loan.\"\n\n\"An individual loan is typically declared in default if payment is 270 days late. Defaulted loans are typically written off from an issuer’s financial statements and transferred to a collection agency.\"\n\n\"The default rate of banks' loan portfolios, in addition to other indicators–such as the unemployment rate, the rate of inflation, the consumer confidence index, the level of personal bankruptcy filings, and stock market returns, among others–is sometimes used as an overall indicator of economic health.\"\n\nhttps://www.investopedia.com/terms/d/defaultrate.asp#:~:text=The%20default%20rate%20is%20the,regular%20payments%20on%20a%20loan.\n\n#The Default Rate Formula\n\n\"The default rate is the rate of all loans issued by a lender or financial institution that is left unpaid by the borrower and declared to be in default.\"\n\n\"The lending institution will write off the entire value of defaulted loans, removing them from the books altogether. The default rate is important for institutions to reassess their risk from borrowers and is also an important representation of economic conditions.\"\n\nDefault Rate = Number of Defaulted Loans/Total Number of Loans X 100\n\n#Period Until Default After Last Payment\n\nCredit Card: 180 days\n\nMortgage: 30 days\n\nStudent Loan: 270 days\n\n#Routinely Missed Payments\n\n\"Lending institutions may implement consequences for borrowers with routinely missed or late payments.\"\n\n\"One strategy a lender may implement is to increase the interest rate on the borrower’s remaining loan after delinquency. The substantially higher interest rate is referred to as the penalty rate. The lender may decide to lower the penalty rate if the borrower successfully makes on-time payments.\"\n\n\"Another strategy allows the lending institution to take hold of personal assets after a defaulted loan. Personal assets may include property, wages, retirement savings, or investments. For example, upon taking ownership of a property, the bank may recover some of its losses on the loan. Through the process of foreclosure, the bank can sell the property.\"\n\nhttps://corporatefinanceinstitute.com/resources/knowledge/credit/default-rate/\n\n#Default Risk Model\n\n\"Benchmarking Deutsche Bundesbank’s Default Risk Model, the KMV Private Firm Model and Common Financial Ratios for\nGerman Corporations\"\n\nAuthors: Stefan Blochwitz,  Thilo Liebig,  Mikael Nyberg\n\n\"By comparing Gini curves and Gini coefficients that are determined on the same underlying dataset, the authors assessed the discriminative power of Deutsche Bundesbank’s Default Risk Model, KMV’s Private Firm Model and common financial ratios for\nGerman corporations.\"\n\n\"While the purpose of the Bundesbank Default Risk Model is to decide whether a collateral is eligible for refinancing purposes, the model does this by assessing the creditworthiness of the individual borrowing company. Likewise, the goal of KMV’s Private Firm Model is to determine probabilities of default. However in both cases a best possible discriminative power is desirable.\"\n\n\"In this paper the authors showed that both the statistical model (discriminant analysis) that is the first step in the\nBundesbank’s system and the structural model of KMV (Private Firm Model) provided powerful approaches to credit analysis with similar results. \"\n\n\"When incorporating additional information gained from other sources than the financial statements and\nmarket trends, power of discrimination can further be improved as demonstrated by an expert system that is the second step of the Deutsche Bundesbank’s system.\"\n\n\"The focus of the paper is that of testing the performance of the models not to compare the model approaches in detail. The model construction and features are briefly described rather than exhaustively analysed.\"\n\nhttps://www.bis.org/bcbs/events/oslo/liebigblo.pdf\n\n\n#Calculating the normalized Gini index\n\nThis function calculates the Gini index of a classification rule outputting probabilities. It is a classical metric in the context of Credit Scoring. It is equal to 2 times the AUC (Area Under ROC Curve) minus 1.\n\nhttps://rdrr.io/cran/glmdisc/man/normalizedGini.html\nhttps://search.r-project.org/CRAN/refmans/glmdisc/html/normalizedGini.html\n\n#Is Gini a merely reformulation of AUC?\n\ngini=2×AUC−1\n\"A random prediction will yield a Gini score of 0 as opposed to the AUC which will be 0.5.\"\n\n\"You cannot calculate AUC for a continuous target. However, they also use normalized Gini in regression tasks, like predicting insurance losses.\"\n\nhttps://stats.stackexchange.com/questions/306287/why-use-normalized-gini-score-instead-of-auc-as-evaluation\n\n\n#The Normalized Gini Coefficient\n\n\"The Normalized Gini coefficient is how far away we are with our sorted actual values from a random state measured in number of swaps\"\n\nhttps://theblog.github.io/post/gini-coefficient-intuitive-explanation/#:~:text=The%20Normalized%20Gini%20coefficient%20is,could%20give%20you%20a%20better\n\n#How to calculate Normalized Gini Coefficient in tensorflow\n\nAnswered by Maxim Oct 31, 2017 at 16:42\n\ndef gini_tf(actual, pred):\n  assert (len(actual) == len(pred))\n  n = int(actual.get_shape()[-1])\n  indices = tf.reverse(tf.nn.top_k(pred, k=n)[1], axis=0)\n  a_s = tf.gather(actual, indices)\n  a_c = tf.cumsum(a_s)\n  giniSum = tf.reduce_sum(a_c) / tf.reduce_sum(a_s)\n  giniSum -= (n + 1) / 2.\n  return giniSum / n\n\nhttps://stackoverflow.com/questions/46858373/how-to-calculate-normalized-gini-coefficient-in-tensorflow\n\n#Or\n\nAnswered by Anton Poznyakovskiy - Nov 15, 2017 at 19:09\n\ndef gini(actual, pred):\n    n = tf.shape(actual)[1]\n    indices = tf.reverse(tf.nn.top_k(pred, k=n)[1], axis=[1])[0]\n    a_s = tf.gather(tf.transpose(actual), tf.transpose(indices))\n    a_c = tf.cumsum(a_s)\n    giniSum = tf.reduce_sum(a_c) / tf.reduce_sum(a_s)\n    giniSum = tf.subtract(giniSum, tf.divide(tf.to_float(n + 1), tf.constant(2.)))\n    return giniSum / tf.to_float(n)\n\ndef gini_normalized(a, p):\n    return gini(a, p) / gini(a, a)\n\nhttps://stackoverflow.com/questions/46858373/how-to-calculate-normalized-gini-coefficient-in-tensorflow\n\n\n#Why use Normalized Gini Score instead of AUC as evaluation?\n\n\"The Kaggle website used to have this answer: \"There is a maximum achievable area for a \"perfect\" model since not all of the positive examples occur immediately. They use the normalized Gini coefficient by dividing the Gini coefficient of your model by the Gini coefficient of the perfect model.\" but it is not available anymore. webcache.googleusercontent.com/… – \"\n\nBy Sextus Empiricus - Oct 10, 2017 at 1:01 \n\nhttps://stats.stackexchange.com/questions/306287/why-use-normalized-gini-score-instead-of-auc-as-evaluation\n\n#Intuitive Explanation of the Gini Coefficient\n\nhttps://theblog.github.io/post/gini-coefficient-intuitive-explanation/\n\n#A Kaggler Explanation for Gini Coefficient\n\nGini Coefficient - An Intuitive Explanation\n\nhttps://www.kaggle.com/code/batzner/gini-coefficient-an-intuitive-explanation/notebook\n\n#Kaggle Competition evaluated using the Normalized Gini Coefficient.\n\nPorto Seguro’s Safe Driver Prediction\n\nhttps://www.kaggle.com/competitions/porto-seguro-safe-driver-prediction/overview/evaluation\n\n#Good luck creating a better customer experience for Amex cardholders  \n\nPredict if a customer will default in the future. \nIt's a HUUUUUUUGE Dataset. But you all love it that way. Don't you Kagglers?",
      "votes": null
    },
    {
      "id": "1802461",
      "postDate": "05/26/2022 18:39:28",
      "content": "<p>Really interesting <a href=\"https://www.kaggle.com/mpwolke\" target=\"_blank\">@mpwolke</a> thanks for sharing 🌺🌺</p>",
      "rawMarkdown": "Really interesting @mpwolke thanks for sharing 🌺🌺",
      "votes": null
    },
    {
      "id": "1802484",
      "postDate": "05/26/2022 19:18:33",
      "content": "<p>Thank you for your wonderful support Ms. Nancy.</p>",
      "rawMarkdown": "Thank you for your wonderful support Ms. Nancy.",
      "votes": null
    },
    {
      "id": "1802883",
      "postDate": "05/27/2022 09:13:04",
      "content": "<p>Thanks very much, <a href=\"https://www.kaggle.com/mpwolke\" target=\"_blank\">@mpwolke</a> for putting this wonderful resource list together. Really great insights on the wide range of metrics involved in this challenge. 😊</p>",
      "rawMarkdown": "Thanks very much, @mpwolke for putting this wonderful resource list together. Really great insights on the wide range of metrics involved in this challenge. 😊",
      "votes": null
    },
    {
      "id": "1803184",
      "postDate": "05/27/2022 14:40:13",
      "content": "<p>Interesting metric and a well-articulated explanation!</p>",
      "rawMarkdown": "Interesting metric and a well-articulated explanation!",
      "votes": null
    },
    {
      "id": "1803398",
      "postDate": "05/27/2022 18:56:16",
      "content": "<p>Thank you Rahul for reading it.</p>",
      "rawMarkdown": "Thank you Rahul for reading it.",
      "votes": null
    },
    {
      "id": "1803415",
      "postDate": "05/27/2022 19:21:57",
      "content": "<p>Great post! Lots of learning! Thanks for sharing! <a href=\"https://www.kaggle.com/mpwolke\" target=\"_blank\">@mpwolke</a> </p>",
      "rawMarkdown": "Great post! Lots of learning! Thanks for sharing! @mpwolke",
      "votes": null
    },
    {
      "id": "1803494",
      "postDate": "05/27/2022 21:42:11",
      "content": "<p>Thanks for all of this useful information and congratulations on the well deserved GM title 🙂</p>",
      "rawMarkdown": "Thanks for all of this useful information and congratulations on the well deserved GM title 🙂",
      "votes": null
    },
    {
      "id": "1803556",
      "postDate": "05/28/2022 00:06:09",
      "content": "<p>Thank you dear Adam for supporting my work many times. I hope you are doing great on your new job.</p>",
      "rawMarkdown": "Thank you dear Adam for supporting my work many times. I hope you are doing great on your new job.",
      "votes": null
    },
    {
      "id": "1803557",
      "postDate": "05/28/2022 00:08:53",
      "content": "<p>Thank you again Chayan for your nice words.</p>",
      "rawMarkdown": "Thank you again Chayan for your nice words.",
      "votes": null
    },
    {
      "id": "1803558",
      "postDate": "05/28/2022 00:11:07",
      "content": "<p>I made my best to do this \"Home work\". And  it payed off since I got Kaggle community approval for what I've written. <br>\nThank you James for your kind comment and support James.</p>",
      "rawMarkdown": "I made my best to do this \"Home work\". And  it payed off since I got Kaggle community approval for what I've written. \nThank you James for your kind comment and support James.",
      "votes": null
    },
    {
      "id": "1803846",
      "postDate": "05/28/2022 08:33:15",
      "content": "<p>That's great to hear that you are gaining support for posting resources like this. Keep up the great work. I am aiming to do something similar for this project as well. Any tips or tricks would be greatly appreciated 😊</p>",
      "rawMarkdown": "That's great to hear that you are gaining support for posting resources like this. Keep up the great work. I am aiming to do something similar for this project as well. Any tips or tricks would be greatly appreciated 😊",
      "votes": null
    },
    {
      "id": "1803849",
      "postDate": "05/28/2022 08:39:24",
      "content": "<p>You Are always welcome 😊</p>",
      "rawMarkdown": "You Are always welcome 😊",
      "votes": null
    },
    {
      "id": "1805180",
      "postDate": "05/29/2022 21:48:07",
      "content": "<p>Thank you so much for your significant support <a href=\"https://www.kaggle.com/abuzerbinrasool\" target=\"_blank\">@abuzerbinrasool</a>   Abuzer</p>",
      "rawMarkdown": "Thank you so much for your significant support @abuzerbinrasool   Abuzer",
      "votes": null
    },
    {
      "id": "1812561",
      "postDate": "06/06/2022 02:34:22",
      "content": "<p>Awesome explanation. Thanks for sharing!</p>",
      "rawMarkdown": "Awesome explanation. Thanks for sharing!",
      "votes": null
    },
    {
      "id": "1813051",
      "postDate": "06/06/2022 13:38:16",
      "content": "<p>Thank you so much for your appreciation Johnny <a href=\"https://www.kaggle.com/johnnywangzy\" target=\"_blank\">@johnnywangzy</a> </p>",
      "rawMarkdown": "Thank you so much for your appreciation Johnny @johnnywangzy",
      "votes": null
    },
    {
      "id": "1821031",
      "postDate": "06/15/2022 07:46:06",
      "content": "<p><a href=\"https://www.kaggle.com/mpwolke\" target=\"_blank\">@mpwolke</a> Thanks for this.</p>\n<p>I also found this video from Khan Academy which made understanding Gini Coefficient and Lorenz curve so much easier.</p>\n<p><a href=\"https://www.youtube.com/watch?v=y8y-gaNbe4U&amp;t=336s\" target=\"_blank\">https://www.youtube.com/watch?v=y8y-gaNbe4U&amp;t=336s</a></p>",
      "rawMarkdown": "mpwolke Thanks for this.\n\nI also found this video from Khan Academy which made understanding Gini Coefficient and Lorenz curve so much easier.\n\nhttps://www.youtube.com/watch?v=y8y-gaNbe4U&t=336s",
      "votes": null
    },
    {
      "id": "1821372",
      "postDate": "06/15/2022 13:33:30",
      "content": "<p>Thank you <a href=\"https://www.kaggle.com/rafatsiddiqui\" target=\"_blank\">@rafatsiddiqui</a>  for the Khan Academy tip and your support too.</p>",
      "rawMarkdown": "Thank you @rafatsiddiqui  for the Khan Academy tip and your support too.",
      "votes": null
    },
    {
      "id": "1883810",
      "postDate": "08/04/2022 05:47:27",
      "content": "<p>This a great research. This save a lot time. I tried to find the first point meaning by myself and I just got confused. Thx.</p>",
      "rawMarkdown": "This a great research. This save a lot time. I tried to find the first point meaning by myself and I just got confused. Thx.",
      "votes": null
    },
    {
      "id": "1884364",
      "postDate": "08/04/2022 11:51:55",
      "content": "<p>Thank you Israel. I'm learning too.</p>",
      "rawMarkdown": "Thank you Israel. I'm learning too.",
      "votes": null
    },
    {
      "id": "1948516",
      "postDate": "09/21/2022 06:11:16",
      "content": "<p>Great resourse to understand gini coefficient. I bookmarked this as reference for future competitions!</p>",
      "rawMarkdown": "Great resourse to understand gini coefficient. I bookmarked this as reference for future competitions!",
      "votes": null
    },
    {
      "id": "1948888",
      "postDate": "09/21/2022 11:50:32",
      "content": "<p>Grazie per il vostro commento P. Maldini.</p>",
      "rawMarkdown": "Grazie per il vostro commento P. Maldini.",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 1802461,
      "author_name": "nancyalaswad90",
      "author_url": "",
      "post_date": "05/26/2022 18:39:28",
      "content": "<p>Really interesting <a href=\"https://www.kaggle.com/mpwolke\" target=\"_blank\">@mpwolke</a> thanks for sharing 🌺🌺</p>",
      "votes": null,
      "replies": [
        {
          "id": 1802484,
          "author_name": "mpwolke",
          "author_url": "",
          "post_date": "05/26/2022 19:18:33",
          "content": "<p>Thank you for your wonderful support Ms. Nancy.</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 1803849,
          "author_name": "nancyalaswad90",
          "author_url": "",
          "post_date": "05/28/2022 08:39:24",
          "content": "<p>You Are always welcome 😊</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 1802883,
      "author_name": "datajmcn",
      "author_url": "",
      "post_date": "05/27/2022 09:13:04",
      "content": "<p>Thanks very much, <a href=\"https://www.kaggle.com/mpwolke\" target=\"_blank\">@mpwolke</a> for putting this wonderful resource list together. Really great insights on the wide range of metrics involved in this challenge. 😊</p>",
      "votes": null,
      "replies": [
        {
          "id": 1803558,
          "author_name": "mpwolke",
          "author_url": "",
          "post_date": "05/28/2022 00:11:07",
          "content": "<p>I made my best to do this \"Home work\". And  it payed off since I got Kaggle community approval for what I've written. <br>\nThank you James for your kind comment and support James.</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 1803846,
          "author_name": "datajmcn",
          "author_url": "",
          "post_date": "05/28/2022 08:33:15",
          "content": "<p>That's great to hear that you are gaining support for posting resources like this. Keep up the great work. I am aiming to do something similar for this project as well. Any tips or tricks would be greatly appreciated 😊</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 1803184,
      "author_name": "rahulkotru",
      "author_url": "",
      "post_date": "05/27/2022 14:40:13",
      "content": "<p>Interesting metric and a well-articulated explanation!</p>",
      "votes": null,
      "replies": [
        {
          "id": 1803398,
          "author_name": "mpwolke",
          "author_url": "",
          "post_date": "05/27/2022 18:56:16",
          "content": "<p>Thank you Rahul for reading it.</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 1803415,
      "author_name": "onedatareader",
      "author_url": "",
      "post_date": "05/27/2022 19:21:57",
      "content": "<p>Great post! Lots of learning! Thanks for sharing! <a href=\"https://www.kaggle.com/mpwolke\" target=\"_blank\">@mpwolke</a> </p>",
      "votes": null,
      "replies": [
        {
          "id": 1803557,
          "author_name": "mpwolke",
          "author_url": "",
          "post_date": "05/28/2022 00:08:53",
          "content": "<p>Thank you again Chayan for your nice words.</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 1803494,
      "author_name": "adamwurdits",
      "author_url": "",
      "post_date": "05/27/2022 21:42:11",
      "content": "<p>Thanks for all of this useful information and congratulations on the well deserved GM title 🙂</p>",
      "votes": null,
      "replies": [
        {
          "id": 1803556,
          "author_name": "mpwolke",
          "author_url": "",
          "post_date": "05/28/2022 00:06:09",
          "content": "<p>Thank you dear Adam for supporting my work many times. I hope you are doing great on your new job.</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 1812561,
      "author_name": "johnnywangzy",
      "author_url": "",
      "post_date": "06/06/2022 02:34:22",
      "content": "<p>Awesome explanation. Thanks for sharing!</p>",
      "votes": null,
      "replies": [
        {
          "id": 1813051,
          "author_name": "mpwolke",
          "author_url": "",
          "post_date": "06/06/2022 13:38:16",
          "content": "<p>Thank you so much for your appreciation Johnny <a href=\"https://www.kaggle.com/johnnywangzy\" target=\"_blank\">@johnnywangzy</a> </p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 1821031,
      "author_name": "rafatsiddiqui",
      "author_url": "",
      "post_date": "06/15/2022 07:46:06",
      "content": "<p><a href=\"https://www.kaggle.com/mpwolke\" target=\"_blank\">@mpwolke</a> Thanks for this.</p>\n<p>I also found this video from Khan Academy which made understanding Gini Coefficient and Lorenz curve so much easier.</p>\n<p><a href=\"https://www.youtube.com/watch?v=y8y-gaNbe4U&amp;t=336s\" target=\"_blank\">https://www.youtube.com/watch?v=y8y-gaNbe4U&amp;t=336s</a></p>",
      "votes": null,
      "replies": [
        {
          "id": 1821372,
          "author_name": "mpwolke",
          "author_url": "",
          "post_date": "06/15/2022 13:33:30",
          "content": "<p>Thank you <a href=\"https://www.kaggle.com/rafatsiddiqui\" target=\"_blank\">@rafatsiddiqui</a>  for the Khan Academy tip and your support too.</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 1883810,
      "author_name": "israra",
      "author_url": "",
      "post_date": "08/04/2022 05:47:27",
      "content": "<p>This a great research. This save a lot time. I tried to find the first point meaning by myself and I just got confused. Thx.</p>",
      "votes": null,
      "replies": [
        {
          "id": 1884364,
          "author_name": "mpwolke",
          "author_url": "",
          "post_date": "08/04/2022 11:51:55",
          "content": "<p>Thank you Israel. I'm learning too.</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 1948516,
      "author_name": "pietromaldini1",
      "author_url": "",
      "post_date": "09/21/2022 06:11:16",
      "content": "<p>Great resourse to understand gini coefficient. I bookmarked this as reference for future competitions!</p>",
      "votes": null,
      "replies": [
        {
          "id": 1948888,
          "author_name": "mpwolke",
          "author_url": "",
          "post_date": "09/21/2022 11:50:32",
          "content": "<p>Grazie per il vostro commento P. Maldini.</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 1805180,
      "author_name": "mpwolke",
      "author_url": "",
      "post_date": "05/29/2022 21:48:07",
      "content": "<p>Thank you so much for your significant support <a href=\"https://www.kaggle.com/abuzerbinrasool\" target=\"_blank\">@abuzerbinrasool</a>   Abuzer</p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "1801388": "#The Gini Coefficient\n\n\"The Gini coefficient is a statistic which measures the ability of a scorecard or a characteristic to rank order risk. A Gini value of 0% means that the characteristic cannot distinguish good from bad cases.\"\n\n\"A  typical credit scorecard has a Gini coefficient of 40-60%. Behaviour scorecards have values of 70-80%. A very powerful characteristic can have a Gini coefficient of 25%.\"\n\n\"To calculate Gini values, assume that one has good and bad accounts rank ordered by score with the score sufficiently finely graded such as that there is only one case per score. The essential notion is that of a “flip”. A flip is a transposition of consecutive good and bad accounts.\"\n\n\"The Gini coefficient is the percentage of flips required to reach the rank ordering from a random assignment of goods and bads by score (i.e. with Gini = 0).\"\n\nhttp://www.rhinorisk.com/Publications/Gini%20Coefficients.pdf \n\n#What Is the Default Rate?\n\nBy Julia Kagan, Reviewed by Julius Mansa\n\n\"The default rate is the percentage of all outstanding loans that a lender has written off as unpaid after a prolonged period of missed payments. The term default rate–also called penalty rate–may also refer to the higher interest rate imposed on a borrower who has missed regular payments on a loan.\"\n\n\"An individual loan is typically declared in default if payment is 270 days late. Defaulted loans are typically written off from an issuer’s financial statements and transferred to a collection agency.\"\n\n\"The default rate of banks' loan portfolios, in addition to other indicators–such as the unemployment rate, the rate of inflation, the consumer confidence index, the level of personal bankruptcy filings, and stock market returns, among others–is sometimes used as an overall indicator of economic health.\"\n\nhttps://www.investopedia.com/terms/d/defaultrate.asp#:~:text=The%20default%20rate%20is%20the,regular%20payments%20on%20a%20loan.\n\n#The Default Rate Formula\n\n\"The default rate is the rate of all loans issued by a lender or financial institution that is left unpaid by the borrower and declared to be in default.\"\n\n\"The lending institution will write off the entire value of defaulted loans, removing them from the books altogether. The default rate is important for institutions to reassess their risk from borrowers and is also an important representation of economic conditions.\"\n\nDefault Rate = Number of Defaulted Loans/Total Number of Loans X 100\n\n#Period Until Default After Last Payment\n\nCredit Card: 180 days\n\nMortgage: 30 days\n\nStudent Loan: 270 days\n\n#Routinely Missed Payments\n\n\"Lending institutions may implement consequences for borrowers with routinely missed or late payments.\"\n\n\"One strategy a lender may implement is to increase the interest rate on the borrower’s remaining loan after delinquency. The substantially higher interest rate is referred to as the penalty rate. The lender may decide to lower the penalty rate if the borrower successfully makes on-time payments.\"\n\n\"Another strategy allows the lending institution to take hold of personal assets after a defaulted loan. Personal assets may include property, wages, retirement savings, or investments. For example, upon taking ownership of a property, the bank may recover some of its losses on the loan. Through the process of foreclosure, the bank can sell the property.\"\n\nhttps://corporatefinanceinstitute.com/resources/knowledge/credit/default-rate/\n\n#Default Risk Model\n\n\"Benchmarking Deutsche Bundesbank’s Default Risk Model, the KMV Private Firm Model and Common Financial Ratios for\nGerman Corporations\"\n\nAuthors: Stefan Blochwitz,  Thilo Liebig,  Mikael Nyberg\n\n\"By comparing Gini curves and Gini coefficients that are determined on the same underlying dataset, the authors assessed the discriminative power of Deutsche Bundesbank’s Default Risk Model, KMV’s Private Firm Model and common financial ratios for\nGerman corporations.\"\n\n\"While the purpose of the Bundesbank Default Risk Model is to decide whether a collateral is eligible for refinancing purposes, the model does this by assessing the creditworthiness of the individual borrowing company. Likewise, the goal of KMV’s Private Firm Model is to determine probabilities of default. However in both cases a best possible discriminative power is desirable.\"\n\n\"In this paper the authors showed that both the statistical model (discriminant analysis) that is the first step in the\nBundesbank’s system and the structural model of KMV (Private Firm Model) provided powerful approaches to credit analysis with similar results. \"\n\n\"When incorporating additional information gained from other sources than the financial statements and\nmarket trends, power of discrimination can further be improved as demonstrated by an expert system that is the second step of the Deutsche Bundesbank’s system.\"\n\n\"The focus of the paper is that of testing the performance of the models not to compare the model approaches in detail. The model construction and features are briefly described rather than exhaustively analysed.\"\n\nhttps://www.bis.org/bcbs/events/oslo/liebigblo.pdf\n\n\n#Calculating the normalized Gini index\n\nThis function calculates the Gini index of a classification rule outputting probabilities. It is a classical metric in the context of Credit Scoring. It is equal to 2 times the AUC (Area Under ROC Curve) minus 1.\n\nhttps://rdrr.io/cran/glmdisc/man/normalizedGini.html\nhttps://search.r-project.org/CRAN/refmans/glmdisc/html/normalizedGini.html\n\n#Is Gini a merely reformulation of AUC?\n\ngini=2×AUC−1\n\"A random prediction will yield a Gini score of 0 as opposed to the AUC which will be 0.5.\"\n\n\"You cannot calculate AUC for a continuous target. However, they also use normalized Gini in regression tasks, like predicting insurance losses.\"\n\nhttps://stats.stackexchange.com/questions/306287/why-use-normalized-gini-score-instead-of-auc-as-evaluation\n\n\n#The Normalized Gini Coefficient\n\n\"The Normalized Gini coefficient is how far away we are with our sorted actual values from a random state measured in number of swaps\"\n\nhttps://theblog.github.io/post/gini-coefficient-intuitive-explanation/#:~:text=The%20Normalized%20Gini%20coefficient%20is,could%20give%20you%20a%20better\n\n#How to calculate Normalized Gini Coefficient in tensorflow\n\nAnswered by Maxim Oct 31, 2017 at 16:42\n\ndef gini_tf(actual, pred):\n  assert (len(actual) == len(pred))\n  n = int(actual.get_shape()[-1])\n  indices = tf.reverse(tf.nn.top_k(pred, k=n)[1], axis=0)\n  a_s = tf.gather(actual, indices)\n  a_c = tf.cumsum(a_s)\n  giniSum = tf.reduce_sum(a_c) / tf.reduce_sum(a_s)\n  giniSum -= (n + 1) / 2.\n  return giniSum / n\n\nhttps://stackoverflow.com/questions/46858373/how-to-calculate-normalized-gini-coefficient-in-tensorflow\n\n#Or\n\nAnswered by Anton Poznyakovskiy - Nov 15, 2017 at 19:09\n\ndef gini(actual, pred):\n    n = tf.shape(actual)[1]\n    indices = tf.reverse(tf.nn.top_k(pred, k=n)[1], axis=[1])[0]\n    a_s = tf.gather(tf.transpose(actual), tf.transpose(indices))\n    a_c = tf.cumsum(a_s)\n    giniSum = tf.reduce_sum(a_c) / tf.reduce_sum(a_s)\n    giniSum = tf.subtract(giniSum, tf.divide(tf.to_float(n + 1), tf.constant(2.)))\n    return giniSum / tf.to_float(n)\n\ndef gini_normalized(a, p):\n    return gini(a, p) / gini(a, a)\n\nhttps://stackoverflow.com/questions/46858373/how-to-calculate-normalized-gini-coefficient-in-tensorflow\n\n\n#Why use Normalized Gini Score instead of AUC as evaluation?\n\n\"The Kaggle website used to have this answer: \"There is a maximum achievable area for a \"perfect\" model since not all of the positive examples occur immediately. They use the normalized Gini coefficient by dividing the Gini coefficient of your model by the Gini coefficient of the perfect model.\" but it is not available anymore. webcache.googleusercontent.com/… – \"\n\nBy Sextus Empiricus - Oct 10, 2017 at 1:01 \n\nhttps://stats.stackexchange.com/questions/306287/why-use-normalized-gini-score-instead-of-auc-as-evaluation\n\n#Intuitive Explanation of the Gini Coefficient\n\nhttps://theblog.github.io/post/gini-coefficient-intuitive-explanation/\n\n#A Kaggler Explanation for Gini Coefficient\n\nGini Coefficient - An Intuitive Explanation\n\nhttps://www.kaggle.com/code/batzner/gini-coefficient-an-intuitive-explanation/notebook\n\n#Kaggle Competition evaluated using the Normalized Gini Coefficient.\n\nPorto Seguro’s Safe Driver Prediction\n\nhttps://www.kaggle.com/competitions/porto-seguro-safe-driver-prediction/overview/evaluation\n\n#Good luck creating a better customer experience for Amex cardholders  \n\nPredict if a customer will default in the future. \nIt's a HUUUUUUUGE Dataset. But you all love it that way. Don't you Kagglers?",
    "1802461": "Really interesting @mpwolke thanks for sharing 🌺🌺",
    "1802484": "Thank you for your wonderful support Ms. Nancy.",
    "1802883": "Thanks very much, @mpwolke for putting this wonderful resource list together. Really great insights on the wide range of metrics involved in this challenge. 😊",
    "1803184": "Interesting metric and a well-articulated explanation!",
    "1803398": "Thank you Rahul for reading it.",
    "1803415": "Great post! Lots of learning! Thanks for sharing! @mpwolke",
    "1803494": "Thanks for all of this useful information and congratulations on the well deserved GM title 🙂",
    "1803556": "Thank you dear Adam for supporting my work many times. I hope you are doing great on your new job.",
    "1803557": "Thank you again Chayan for your nice words.",
    "1803558": "I made my best to do this \"Home work\". And  it payed off since I got Kaggle community approval for what I've written. \nThank you James for your kind comment and support James.",
    "1803846": "That's great to hear that you are gaining support for posting resources like this. Keep up the great work. I am aiming to do something similar for this project as well. Any tips or tricks would be greatly appreciated 😊",
    "1803849": "You Are always welcome 😊",
    "1805180": "Thank you so much for your significant support @abuzerbinrasool   Abuzer",
    "1812561": "Awesome explanation. Thanks for sharing!",
    "1813051": "Thank you so much for your appreciation Johnny @johnnywangzy",
    "1821031": "mpwolke Thanks for this.\n\nI also found this video from Khan Academy which made understanding Gini Coefficient and Lorenz curve so much easier.\n\nhttps://www.youtube.com/watch?v=y8y-gaNbe4U&t=336s",
    "1821372": "Thank you @rafatsiddiqui  for the Khan Academy tip and your support too.",
    "1883810": "This a great research. This save a lot time. I tried to find the first point meaning by myself and I just got confused. Thx.",
    "1884364": "Thank you Israel. I'm learning too.",
    "1948516": "Great resourse to understand gini coefficient. I bookmarked this as reference for future competitions!",
    "1948888": "Grazie per il vostro commento P. Maldini."
  },
  "source": "meta"
}