Skip to content
Felix
  • Topics
    • My List
    • Felix Guide
    • Asset Management
    • Coding and Data Analysis
      • Data Analysis and Visualization
      • Financial Data Tools
      • Python
      • SQL
    • Credit
      • Credit Analysis
      • Restructuring
    • Financial Literacy Essentials
      • Financial Data Tools
      • Financial Math
      • Foundations of Accounting
    • Industry Specific
      • Banks
      • Chemicals
      • Consumer
      • ESG
      • Insurance
      • Oil and Gas
      • Pharmaceuticals
      • Project Finance
      • Real Estate
      • Renewable Energy
      • Technology
      • Telecoms
    • Introductory Courses
    • Investment Banking
      • Accounting
      • Financial Modeling
      • M&A and Divestitures
      • Private Debt
      • Private Equity
      • Valuation
      • Venture Capital
    • Markets
      • Economics
      • Equity Markets and Derivatives
      • Fixed Income and Derivatives
      • Introduction to Markets
      • Options and Structured Products
      • Other Capital Markets
      • Securities Services
    • Microsoft Office
      • Excel
      • PowerPoint
      • Word & Outlook
    • Professional Skills
      • Career Development
      • Expert Interviews
      • Interview Skills
    • Risk Management
    • Transaction Banking
    • Felix Live
  • Pathways
    • Investment Banking
    • Asset Management
    • Equity Research
    • Sales and Trading
    • Commercial Banking
    • Engineering
    • Operations
    • Private Equity
    • Credit Analysis
    • Restructuring
    • Venture Capital
    • CFA Institute
  • Certified Courses
  • Ask An Instructor
  • Support
  • Log in
  • Topics
    • My List
    • Felix Guide
    • Asset Management
    • Coding and Data Analysis
      • Data Analysis and Visualization
      • Financial Data Tools
      • Python
      • SQL
    • Credit
      • Credit Analysis
      • Restructuring
    • Financial Literacy Essentials
      • Financial Data Tools
      • Financial Math
      • Foundations of Accounting
    • Industry Specific
      • Banks
      • Chemicals
      • Consumer
      • ESG
      • Insurance
      • Oil and Gas
      • Pharmaceuticals
      • Project Finance
      • Real Estate
      • Renewable Energy
      • Technology
      • Telecoms
    • Introductory Courses
    • Investment Banking
      • Accounting
      • Financial Modeling
      • M&A and Divestitures
      • Private Debt
      • Private Equity
      • Valuation
      • Venture Capital
    • Markets
      • Economics
      • Equity Markets and Derivatives
      • Fixed Income and Derivatives
      • Introduction to Markets
      • Options and Structured Products
      • Other Capital Markets
      • Securities Services
    • Microsoft Office
      • Excel
      • PowerPoint
      • Word & Outlook
    • Professional Skills
      • Career Development
      • Expert Interviews
      • Interview Skills
    • Risk Management
    • Transaction Banking
    • Felix Live
  • Pathways
    • Investment Banking
    • Asset Management
    • Equity Research
    • Sales and Trading
    • Commercial Banking
    • Engineering
    • Operations
    • Private Equity
    • Credit Analysis
    • Restructuring
    • Venture Capital
    • CFA Institute
  • Certified Courses
Felix
  • Data
    • Company Analytics
    • My Filing Annotations
    • Market & Industry Data
    • United States
    • Relative Valuation
    • Discount Rate
    • Building Forecasts
    • Capital Structure Analysis
    • Europe
    • Relative Valuation
    • Discount Rate
    • Building Forecasts
    • Capital Structure Analysis
  • Models
  • Account
    • Edit my profile
    • My List
    • Restart Homepage Tour
    • Restart Company Analytics Tour
    • Restart Filings Tour
  • Log in
  • Ask An Instructor
    • Email Our Experts
    • Felix User Guide
    • Contact Support

Regression Algorithms in Python

Explore characteristics of Regression Problems, overfitting, Regularized Regression Models, like Lasso, Ridge, Elastic Net, and Decision Tree Ensemble Models, like Random Forest, Gradient Boosting.

Unlock Your Certificate   
 
0% Complete

5 Lessons (25m)

Show lesson playlist
  • Description & Objectives

  • 1. Regression Algorithms Learning Objectives

    00:39
  • 2. What are Regression Algorithms

    03:09
  • 3. Real Relationships & Overfitting

    08:31
  • 4. Regularization

    06:53
  • 5. Decision Trees & Ensemble Methods

    04:32

Prev: Data Cleaning and Exploration in Python Next: Liquidity Regressors in Python

Regularization

  • Notes
  • Questions
  • Transcript
  • 06:53

How regularization works in machine learning.

Downloads

No associated resources to download.

Glossary

Python Regression algorithms Regularization
Back to top
Financial Edge Training

© Financial Edge Training 2025

Topics
Introduction to Finance Accounting Financial Modeling Valuation M&A and Divestitures Private Equity
Venture Capital Project Finance Credit Analysis Transaction Banking Restructuring Capital Markets
Asset Management Risk Management Economics Data Science and System
Request New Content
System Account User Guide Privacy Policy Terms & Conditions Log in
Transcript

Now let's talk about how you prevent overfitting with a tool called regularization. Because machine learning models tend to overfit, an important part of your design process is preventing overfitting. One cause of overfitting is poor feature selection. To explain, consider this example where weight in pounds is your target variable, and you're predicting based on someone's height. It's clear that there's a positive relationship between height and weight. Based on this data, you can make a reasonable prediction of a person's weight just by knowing their height. There's an obvious strong real relationship. However, height is not the only input feature that could explain weight. What other real relationships could explain weight variation between observations? In addition to knowing a person's height, if you could also know maybe their occupation and their sex, you could further increase the accuracy of your weight prediction because you're identifying other real relationships between other features and your target variable. So obviously, a limited number of additional features can add useful complexity to your model so that the complexity of your model matches the complexity of the real relationships you're trying to represent leading to a good fit. On the other hand, too many features, especially features that don't describe a significant relationship, can create excess complexity that leads to overfitting and bad predictions. Look at the data that you have right here. What does someone's hometown, their hour of birth and the number of hairs on their head have to do with their weight? Nothing. However, if you don't place limits on your machine learning models, they will seek out relationships where relationships don't really exist. They're going to look at these random pieces of data and they're going to try to match it to the random fluctuation in your target variable. For example, a model could take the data above and make predictions on the basis of someone's hour of birth. We did it right here. Look at it. So what happens when this model starts to evaluate new observations? Well, they were born at 8:00 AM then they must weigh 175 pounds, or they were born at 8:00 PM they must weigh 262 pounds. If you apply this model to the training data, you actually have 100% accuracy. But how accurate do you think the new predictions will be? Probably no different than a random guess because the model is making predictions on the basis of a relationship that doesn't actually exist, that is overfitting. So what is regularization and why does it matter? Regularization is a form of automatic feature selection that dampens the effect of insignificant features, thus reducing overfitting. To understand regularization, you first need to understand the idea of a cost function, which is the way that you choose to quantify your model's error. Machine learning algorithms are iterative, meaning that they begin with a poor model and cycle through a process to optimize it. During this process in order to determine if a change to the model is an improvement, the machine learning algorithm requires some measure of success. Since you're using the model to make predictions, the most successful model will make the most accurate predictions. That is to say the best model will make predictions with the least error. The way that you measure error is your cost function, and the objective of any machine learning algorithm is to minimize its cost function. For example, the linear regression that you see right here chooses 11.3 as the coefficient and negative 635.8 as the intercept. Because these values minimized its cost function, which is to say that it minimized its error. As a tip, the cost function can also be called the loss function or the error function. So if you see either of those phrases, it's indicating the same idea. The chart you see here visualizes the error of the height versus weight regression on the prior page. The most commonly used cost function is called the sum of squared errors. To calculate the sum of squared errors, you just measure the error of each prediction like you see in these red lines. Then you square those error values and finally use some all of the squared values. The result of this cost function is that extreme errors are more heavily penalized because their values are squared. So how does regularization come into play and what does it have to do with the cost function? The basic cost function, penalizes error, and the objective of the machine learning model is to minimize that penalty. Regularization adds a new penalty to the cost function that penalizes model coefficients. The larger the coefficient, which is to say the more influence a feature has on the model, then the larger the penalty. Now, in order to minimize the cost function, your machine learning model must balance two competing objectives, minimizing the error on one hand and minimizing coefficients on the other. And this means that the algorithm is incentivized to create a model that maximizes accuracy to minimize your error, while also minimizing complexity by minimizing the coefficients. So let's look back at this example. A non-regular unconstrained algorithm would find a way to incorporate useless variables like hometown, hour of birth, and hairs on somebody's head. A regularized algorithm would either drastically reduce the coefficients of those features, thus reducing their influence on the final model, or it would drive their coefficients to zero and eliminate them from the model altogether. So you can imagine how useful this will be in preventing overfitting. When you're designing your algorithms, you have the ability to tune the strength of the regularization penalty factor. A small penalty factor means that the model will prioritize error minimization, and a large penalty factor means that the model will prioritize complexity minimization. So you're kind of on the seesaw of finding the right balance between accuracy and avoiding overfitting. There are two types of regularization penalties. L1 regularization penalizes the absolute size of model coefficients and L2 regularization penalizes the squared size of model coefficients. As a tip, a regularized algorithm with an L1 penalty will result in a smaller number of larger coefficients, meaning a smaller number of highly influential features. On the other hand, a regularized algorithm with an L2 penalty will result in a larger number of smaller coefficients, meaning a larger number of less influential features, rather than randomly choosing L1 or L2 regularization and then guessing the optimal strength of the chosen penalty factor. Later in the course, you're going to learn how to create alternative models that compete against each other. To find the model with the best performance through trial and error, you're going to use three types of regularized linear regression algorithms in this course. First, the lasso regressor, which is regularized with the L1 penalty factor. Then the ridge regressor, which is regularized with the L2 penalty factor. And finally, the elastic net, which is regularized with a blend of both penalty factors. And we're gonna look at how you find the optimal blend using the elastic net.

Content Requests and Questions

You are trying to access premium learning content.

Discover our full catalogue and purchase a course Access all courses with our premium plans or log in to your account
Help

You need an account to contact support.

Create a free account or log in to an existing one

Sorry, you don't have access to that yet!

You are trying to access premium learning content.

Discover our full catalogue and purchase a course Access all courses with our premium plans or log in to your account

You have reached the limit of annotations (10) under our premium subscription. Upgrade to unlock unlimited annotations.

Find out more about our premium plan

You are trying to access content that requires a free account. Sign up or login in seconds!

Create a free account or log in to an existing one

You are trying to access content that requires a premium plan.

Find out more about our premium plan or log in to your account

Only US listed companies are available under our Free and Boost plans. Upgrade to Pro to access over 7,000 global companies across the US, UK, Canada, France, Italy, Germany, Hong Kong and more.

Find out more about our premium plan or log in to your account

A pro account is required for the Excel Add In

Find out more about our premium plan

Congratulations on completing

This field is hidden when viewing the form
Name(Required)
This field is hidden when viewing the form
Rate this course out of 5, where 5 is excellent and 1 is terrible.
Were the stated learning objectives met?(Required)
Were the stated prerequisite requirements appropriate and sufficient?(Required)
Were the program materials, including the qualified assessment, relevant and did they contribute to the achievement of the learning objectives?(Required)
Was the time allotted to the learning activity appropriate?(Required)
Are you happy for us to use your feedback and details in future marketing?(Required)

Thank you for already submitting feedback for this course.

CPE

What is CPE?

CPE stands for Continuing Professional Education, by completing learning activities you earn CPE credits to retain your professional credentials. CPE is required for Certified Public Accountants (CPAs). Financial Edge Training is registered with the National Association of State Boards of Accountancy (NASBA) as a sponsor of continuing professional education on the National Registry of CPE Sponsors.

What are CPE credits?

For self study programs, 1 CPE credit is awarded for every 50 minutes of elearning content, this includes videos, workouts, tryouts, and exams.

CPE Exams

You must complete the CPE exam within 1 year of accessing a related playlist or course to earn CPE credits. To see how long you have left to complete a CPE exam, hover over the locked CPE credits button.

What if I'm not collecting CPE credits?

CPE exams do not count towards your FE certification. You do not need to complete the CPE exam if you are not collecting CPE credits, but you might find it useful for your own revision.


Further Help
  • Felix How to Guide walks you through the key functions and tools of the learning platform.
  • Playlists & Tryouts: Playlists are a collection of videos that teach you a specific skill and are tested with a tryout at the end. A tryout is a quiz that tests your knowledge and understanding of what you have just learned.
  • Exam: If you are collecting CPE points you must pass the relevant CPE exam within 1 year to receive credits.
  • Glossary: A glossary can be found below each video and provides definitions and explanations for terms and concepts. They are organized alphabetically to make it easy for you to find the term you need.
  • Search function: Use the Felix search function on the homepage to find content related to what you want to learn. Find related video content, lessons, and questions people have asked on the topic.
  • Closed Captions & Transcript: Closed captions and transcripts are available on videos. The video transcript can be found next to the closed captions in the video player. The transcript feature allows you to read the transcript of the video and search for key terms within the transcript.
  • Questions: If you have questions about the course content, you will find a section called Ask a Question underneath each video where you can submit questions to our expert instructor team.