where
λ is the parameter that controls the relative weight given to the shrinkage versus model fit.
α ̂ and β ̂i are the model parameters.
| Ridge Regression | LASSO |
| The values of α and β can be found analytically | The values of α and β can be found only using numerical methods |
| Tends to reduce the magnitude of the β parameters, making them closer to, but not equal to, zero. | It sets some of the less-important β estimates to zero. |
| Feature | OLS | Ridge, α = 0.1 | Ridge, α = 0.5 | LASSO, α = 0.01 | LASSO, α = 0.1 |
| Intercept | 5.17 | 2.67 | 2.46 | 2.61 | 2.39 |
| USTB1M | -23.22 | -6.55 | -2.00 | -1.13 | 0 |
| USTB3M | 50.64 | 10.00 | 2.45 | 1.35 | 0 |
| USTB6M | -37.64 | -3.82 | -0.51 | 0 | 0 |
| USTB1Y | 11.00 | 0.70 | 0.40 | 0 | 0 |
| USTB5Y | -5.55 | -1.75 | -1.41 | -1.22 | -0.71 |
| USTB10Y | 9.13 | 0.57 | -0.11 | 0 | 0 |
| USTB20Y | -5.88 | -0.08 | 0.36 | 0.14 | 0 |

Building a decision tree requires taking into account a metric known as information gain of a feature. This is a gauge of how much ambiguity is eliminated by learning more about the characteristic. Each node’s characteristic enhances information gain. Entropy and the Gini coefficient are the two metrics for information gain that are most frequently utilized.
where M is the total number of possible outcomes and pi is the probability of that outcome.
| Data point | Dividend | Earnings drop | Large cap | Retail investor | Tech | Data Point | Dividend | Earnings Drop | Large Cap | Retail Investor | Tech |
| 1 | 1 | 0 | 1 | 40 | 1 | 11 | 0 | 0 | 0 | 20 | 1 |
| 2 | 1 | 1 | 1 | 30 | 0 | 12 | 0 | 0 | 1 | 70 | 0 |
| 3 | 1 | 1 | 1 | 20 | 0 | 13 | 1 | 1 | 0 | 30 | 1 |
| 4 | 0 | 0 | 0 | 80 | 1 | 14 | 1 | 0 | 1 | 70 | 0 |
| 5 | 1 | 0 | 1 | 20 | 1 | 15 | 1 | 0 | 1 | 50 | 1 |
| 6 | 0 | 1 | 0 | 30 | 1 | 16 | 1 | 0 | 1 | 60 | 1 |
| 7 | 0 | 1 | 0 | 40 | 0 | 17 | 1 | 1 | 1 | 30 | 0 |
| 8 | 1 | 0 | 1 | 60 | 0 | 18 | 0 | 1 | 0 | 30 | 1 |
| 9 | 1 | 1 | 1 | 20 | 1 | 19 | 0 | 0 | 0 | 40 | 0 |
| 10 | 0 | 1 | 1 | 40 | 0 | 20 | 1 | 1 | 1 | 50 | 0 |
And

-12.24+0.90×Monthly income×1.26×Total savings=0
with the two edges –
-12.24+0.90×Monthly income+1.26×Total savings=1
-12.24+0.90×Monthly income+1.26×Total savings=-1
| Applicant number | Monthly income (USD 000s) | Total savings (USD 000s) | Loan granted? (yes = 1; no = 0) |
| 1 | 2.5 | 5.0 | 0 |
| 2 | 1.8 | 0.5 | 0 |
| 3 | 4.1 | 1.6 | 0 |
| 4 | 0.8 | 2.0 | 0 |
| 5 | 6.2 | 4.0 | 0 |
| 6 | 3.8 | 6.2 | 0 |
| 7 | 2.1 | 9.0 | 1 |
| 8 | 4.6 | 10.0 | 1 |
| 9 | 1.8 | 13.0 | 1 |
| 10 | 5.2 | 8.0 | 1 |
| 11 | 10.5 | 3.0 | 1 |
| 12 | 7.4 | 8.5 | 1 |


and the probability that yj = 0 is (1-Pj).
| Parameter | Definition | Estimate | Standard error |
| Bias term | The intercept | -5.3041 | 1.051 |
| Amount | Total sum borrowed | -0.0001 | 0.000 |
| Term | Length of the loan (months) | 0.0768 | 0.034 |
| Interest rate | APR charged (%) | 0.1147 | 0.045 |
| Instalment | Monthly instalment | 0.0025 | 0.004 |
| Employment history | Length of borrower’s employment history (years) | 0.0428 | 0.059 |
| Homeowner | 1 = owns home; 0 otherwise | 0.1149 | 0.409 |
| Mortgage | 1 = has a mortgage; 0 no mortgage | -0.9410 | 0.435 |
| Income | Annual income (USD) | -0.0001 | 0.000 |
| Delinquent | Number of times borrower has been more than a month behind with payments in the past two years | 0.0985 | 0.113 |
| Bankruptcies | Number of publicly recorded bankruptcies | -0.1825 | 0.361 |
Where, yi is the true observation value, y ̂_i is the predicted value, and ntest is the test sample size.
| Prediction | |||
| Firm will pay dividend | Firm will not pay | ||
| Outcome | Pays dividend | 432 (43.2%) – TP | 168 (16.8%) – FN |
| No dividend | 121 (12.1%) – FP | 279 (27.9%) – TN | |


H1 = ϕ(w111x1 + w112x2 + w113x3 + w1)
H2 = ϕ(w121x1 + w122x2 + w123x3 + w2)
H3 = ϕ(w131x1 + w132x2 + w133x3 + w3)
y=ϕ(w211H1 + w221H2 + w231H3 + w4 )
| Training sample (500 data points) | Validation sample (167 data points) | |||
| Measure | Logistic regression | Neural network | Logistic regression | Neural network |
| Accuracy | 0.842 | 0.842 | 0.713 | 0.701 |
| Precision | 0.656 | 0.750 | 0.600 | 0.541 |
| Recall | 0.236 | 0.169 | 0.283 | 0.377 |

Categorical variables are variables that categorize data based on qualitative features, also known as qualitative variables.
Dummy variables are used to quantify categorical data so it can be incorporated into regression or machine-learning models.
One-hot encoding is a technique to manage naturally unordered categorical data by creating separate dummy variables for each category.
The dummy variable trap occurs when too many dummy variables are included, leading to multicollinearity in the model.
Regularization adds a penalty to the loss function to prevent overfitting and reduce model complexity.
Ridge regression reduces extreme parameters, while LASSO can completely eliminate specific features.
The main regularization techniques are Ridge Regression, LASSO, and Elastic Net.
A decision tree is a machine-learning model that splits data into branches based on feature values to predict outcomes.
Boosting improves performance by focusing on correcting the errors made by previous models in the sequence.
SVMs are used for classification tasks by finding the optimal boundary to separate different classes in the data.