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

Liquidity Regressors in Python

Practice splitting data into training and testing sets, constructing model pipelines, and performing hyperparameter tuning. As well as cross-validating alternative models to find the top performer

Unlock Your Certificate   
 
0% Complete

30 Lessons (55m)

Show lesson playlist
  • Description & Objectives

  • 1. Liquidity Regressor Learning Objectives

    00:21
  • 2. Case Study Overview

    03:01
  • 3. Importing Data Workout

    01:09
  • 4. Metadata

    01:09
  • 5. Metadata Workout

    00:35
  • 6. Splitting Your Data

    01:57
  • 7. Splitting Your Data Workout

    02:04
  • 8. Train Test Split

    02:46
  • 9. Unpacking Lists

    01:51
  • 10. Unpacking Lists Workout

    01:24
  • 11. Progress Checkpoint

    00:13
  • 12. Model Pipelines

    04:38
  • 13. Model Pipelines Workout

    01:59
  • 14. Progress Checkpoint 1

    00:44
  • 15. Hyperparameter Tuning

    04:32
  • 16. Hyperparameter Grid Workout 1

    02:21
  • 17. Hyperparameter Grid Workout 2

    02:27
  • 18. Aggregating Hyperparameter Grids

    00:50
  • 19. Progress Checkpoint 2

    00:42
  • 20. Cross Validation

    02:06
  • 21. Creating Untrained Models

    02:13
  • 22. Creating Untrained Models Workout

    03:49
  • 23. Training and Tuning Models

    00:55
  • 24. Training and Tuning Models Workout

    02:29
  • 25. Model Evaluation

    02:02
  • 26. Model Evaluation Workout

    03:00
  • 27. Progress Checkpoint 3

    00:31
  • 28. Visualizing Model Predictions

    01:22
  • 29. Visualizing Model Predictions Workout

    01:04
  • 30. Using Your Model

    00:57

Prev: Regression Algorithms in Python Next: Classification Algorithms

Creating Untrained Models Workout

  • Notes
  • Questions
  • Transcript
  • 03:49

Practice cross-validation in machine learning.

Downloads

No associated resources to download.

Glossary

cross-validation Machine Learning Overfitting Python
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

In your Jupyter notebook, complete the following steps. First, create an empty dictionary named models. Second, you're gonna create a for loop that says, for every key in pipelines dot keys, add a new item to models. The items key in models should be the same as the key in pipelines. And the items value should be the untrained model created with the gridsearchcv function, as you saw with lasso demonstrated just a second ago. Finally, once you execute that for loop correctly, display all of the keys in models. As a tip, remember that for loops begin in the format for a variable in an Iterable object, and then you can refer back to that variable at any point during the loop, even as the key to another existing dictionary.

First, you created hyper parameter grids, a dictionary containing all of the hyper parameters for all 5 of your model classes. Then you should have run the code that you see right here, which is already in your Jupyter Notebook. And when you ran that code, you should see the output below the cell right here.

You also should have imported the gridsearchcv function, which is our cross validation function. Then you saw how we created this untrained lasso model using the gridsearchcv function, and that the arguments are first the pipeline for that model, and then the hyperparameter grid for the model. And finally, the number of folds that we want to use for cross validation. And you also saw that you have this pipeline keys Iterable object containing the keys of all the items in that dictionary, and you saw that you have the same thing for your hyperparameter grid and that the keys for these two dictionaries match. So now we're going to do the exercise. We start by initializing this empty dictionary called models using just empty curly braces. Then we're going to create a for loop, and the for loop says for each key in the pipeline keys Iterable object. So for lasso, ridge, enet, RF, and GB, I want you to create a new item in the models dictionary. And the name of that item is going to be the key that we get from this Iterable object pipeline key. So it's gonna iterate through each of those, and it's gonna create a new item in models with the same name that you see in this iterable right here. It's gonna copy it and create a new item. Then the value that's associated with that key in the dictionary is the gridsearchcv function, and the arguments are going to be go back to pipelines and use key. So this is actually the value associated with pipelines and that key. So this is the same as if we wrote out pipelines and then in the square brackets lasso. And we know that the value of that is our lasso pipeline. But because we use this key variable, it's going to iterate through each of these objects and give us the pipeline for all 5 of those models. Then for the second argument, it's gonna grab the hyperparameter grid for that key, and we want all of these to have 5 fold cross validation. So it's gonna cycle through all of the keys in pipelines, lasso, ridge, elastic net, random forrest and gradient booster. It's gonna create a new item for each of those keys, and then the value is going to be the grid search function with the pipeline for the correct key and then the hyperparameter for the correct key. And so when we execute that, it's going to create and fill our new models dictionary, and we can validate that this was done correctly by displaying the models keys output. And you'll see that those match exactly the pipeline keys and the hyperparameter keys.

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.