信用評分卡-邏輯迴歸git
Logistic regression for happiness- by Roopampromise
A few years ago, my wife and I took a couple of weeks’ vacation to England and Scotland. Just before boarding the British Airway’s plane, an air-hostess informed us that we were upgraded to business class. Jolly good! What a wonderful start to the vacation. Once we got onto to the plane, we got another tempting offer for a further upgrade to the first class. However, this time, there was a catch – just one seat was available. Now that is a shame, of course, we could not take this offer. The business class seats were fabulous before the first class offer came – by the way, all free upgrades. This is the situation behavioral economist describe as relativity & anchoring – in plain English comparison. Anchoring or comparison is at the root of pricing strategies in business and also to all the human sorrow. However, eventually the vacation mood took over and we enjoyed the business class thoroughly. Humans are phenomenally good at adjusting to the situation in the end and enjoy it as well. You will find some of the happiest faces with people in the most difficult situations. Here is a quote by Henry Miller 「I have no money, no resources, no hopes. I am the happiest man alive」. Human behavior is full of anomaly – full of puzzles. The following is an example to strengthen this thesis.app
幾年前,我和妻子在英格蘭和蘇格蘭度過了幾個星期的假期。就在登上英國航空公司的飛機以前,一名空姐告訴咱們,咱們已升級爲商務艙。快樂!度假真是一個美好的開始。一旦咱們登上飛機,咱們又得到了另外一個誘人的提議,能夠進一步升級到頭等艙。然而,這一次,有一個問題 - 只有一個座位可用。固然,這是一種恥辱,咱們沒法接受這個提議。在提供頭等艙優惠以前,商務艙座位很是棒 - 順便說一下,全部免費升級。這是行爲經濟學家描述爲相對論和錨定的狀況 - 用簡單的英語比較。錨定或比較是企業訂價策略的根源,也是全部人類悲傷的根源。然而,最終度假心情接管了,咱們完全享受了商務艙。人類在適應最終狀況方面很是擅長並享受它。在最困難的狀況下,你會發現一些最快樂的面孔。如下是亨利米勒的一句話:「我沒有錢,沒有資源,沒有但願。我是最幸福的人「。人類的行爲充滿了異常 - 充滿了謎題。如下是增強本論文的一個例子dom
列儂,麥卡特尼,哈里森和貝斯特是這個星球上最着名的樂隊 - 甲殼蟲樂隊的成員。 好的,我知道你發現了這個錯誤。 到如今爲止,你必須說出正確的名字:John Lennon,Paul McCartney,George Harrison和Ringo Starr,而不是Pete Best。 實際上,Ringo Starr是Pete Best的替代品,Pete Best是甲殼蟲樂隊的原始常規鼓手。 皮特必定是被摧毀了,看到他的夥伴們在落後的時候冉冉升起。 錯了,在Google上搜索他 - 他是全部人中最快樂的披頭士樂隊。 如今這是違反直覺的,我想咱們不知道是什麼讓咱們開心。ide
正如在前一篇文章中所承諾的那樣,在本文中,我將嘗試使用邏輯迴歸來探索幸福 - 這種技術普遍用於記分卡開發。函數
Source: flicker.com工具
Lennon, McCartney, Harrison, and Best are the members of the most famous band ever on the planet – the Beatles. Ok, I know you have spotted the error. By now your must have uttered out the right names: John Lennon, Paul McCartney, George Harrison and Ringo Starr not Pete Best. Actually, Ringo Starr was the replacement for Pete Best, the original regular drummer for the Beatles. Pete must have been devastated seeing his partners rising to glory while he was left behind. Wrong, search for him on Google – he is the happiest Beatle of all. Now that is counter intuitive, I guess we do not have a clue what makes us happy.oop
As promised in a previous article, in this article I will attempt to explore happiness using logistic regression – the technique extensively used in scorecard development.優化
我是一位完全的經驗主義者 - 支持基於事實的管理。 所以,讓我設計一個快速而骯髒的實驗*來生成數據來評估幸福感。 咱們的想法是肯定影響咱們總體幸福感的因素/變量。 讓我列出一個生活在城市中的工做成年人的表明性因素列表:
I am a thorough empiricist – a proponent of fact-based management. Hence, let me design a quick and dirty experiment* to generate data to evaluate happiness. The idea is to identify the factors / variables that influence our overall happiness. Let me present a representative list of factors for a working adult living in a city:
Now, throw in some other factors to the above list such as – random act of kindness or an unplanned visit to a friend. As you could see, the above list can easily be expanded (recall the article on variable selection- article 3). This is a representative list and you will have to create your own to figure out factors that influence your level of happiness.
The second part of the experiment is to collect data. This is like maintaining a diary only this one will be in Microsoft Excel. Every night before sleeping, you could assess your day and fill up numbers in the Spreadsheet along with your overall level of happiness for the day (as shown in the figure below).
*I am calling this a quick and dirty experiment for the following reasons (1) It’s not a well thought out experiment but is created more to illustrate how logistic regression works (2) the observer and the observed are same in this experiment which might create a challenge for objective measurement.
After a couple of years of data collection, you will have enough observations to create a model – a logistic regression model in this case. We are trying to model feeling of happiness (column B) with other columns (C to I) in the above data set. If we plot B on the Y-axis and the additive combination of C to I (we’ll call it Z) on the X-axis it will look something like the plot shown below.
The idea behind logistic regression is to optimize Z in such a way that we get the best possible distinction between happy and sad faces, as achieved in the plot above. This is a curve-fitting problem with sigmoid function (the curve in violet) as the choice of function.
I would recommend using dates of observations (column A) in our model; this might give an interesting influence of seasons on our mood.
邏輯迴歸背後的想法是以這樣的方式優化Z,使得咱們在快樂和悲傷面孔之間獲得最佳區分,如上圖所示。 這是一個曲線擬合問題,其中sigmoid函數(紫色曲線)做爲函數的選擇。
我建議在咱們的模型中使用觀察日期(A欄); 這可能會給季節帶來有趣的影響。
This is exactly what we do in case of analytical scorecards such as credit scorecards, behavioral scorecards, fraud scorecards or buying propensity models. Just replace happy and sad faces with …
• Good and Bad borrowers
• Fraud and genuine cases
• Buyers and non-buyers
…. for the respective cases and you have the model. If you remember in the previous article (4), I have shown a simple credit scorecard model: Credit Score = Age + Loan to Value Ratio (LTV) + Instalment (EMI) to Income Ratio (IIR)A straightforward transformation of the sigmoid function will help us arrive at the above equation of the line. This is the final link to arrive at the desired scorecard.
The Swordsmith – by Roopam
I loved the movie Kill-Bill, both parts. In the first part, I enjoyed when Uma Thurman’s character went to Japan to get a sword from Hattori Hanzō, the legendary swordsmith. After learning about her motive, he agrees to make his finest sword for her. Then Quentin Tarantino, director of the movie, briefly showed the process of making the sword. Hattori Hanzō transformed a regular piece of iron to the fabulous sword – what a craftsman. This is fairly similar to how analysts perform transformation of the sigmoid function to the linear equation. The difference is that analysts use mathematical tools rather than hammers and are not as legendary as Hattori Hanzō.
我喜歡電影Kill-Bill這兩部分。 在第一部分中,當Uma Thurman的角色去日本從傳說中的劍士HattoriHanzō手中拿劍時,我很享受。 在瞭解了她的動機以後,他贊成爲她作出最好的劍。 而後電影導演昆汀·塔倫蒂諾(Quentin Tarantino)簡要介紹了製做劍的過程。 HattoriHanzō將一塊普通的鐵片變成了神話般的劍 - 這真是一個工匠。 這與分析師如何將S形函數轉換爲線性方程很是類似。 不一樣之處在於,分析師使用數學工具而不是錘子,並不像HattoriHanzō那樣具備傳奇色彩。
Reject inference is a distinguishing aspect about credit or application scorecards which is different from all other classification models. For the application scorecards, the development sample is biased because of the absence of performance for rejected loans. Reject inference is a way to rectify this shortcoming and removing the bias from the sample. We will discuss reject inference in detail in some later article on YOU CANalytics.
拒絕推斷是信用或應用記分卡的一個顯着方面,它與全部其餘分類模型不一樣。 對於應用記分卡,因爲拒絕貸款缺少績效,開發樣本存在誤差。 拒絕推斷是一種糾正這一缺點並消除樣本誤差的方法。 咱們將在後面有關您的CANalytics的文章中詳細討論拒絕推斷。
Now that we have our scorecard ready the next task is to validate the predictive power of the scorecard. This is precisely what we will do in the next article. See you soon.
https://study.163.com/course/courseMain.htm?courseId=1005988013&share=2&shareId=400000000398149(博主錄製,2K超清分辨率)