
Course Introduction!!!!
Get code files here!!!
Install and configure Anaconda with Python 3 on Windows 10, including the 64-bit graphical installer and adding Anaconda to the system path, then launch Jupyter Notebook for Python coding.
Download the Linux 64-bit Anaconda installer for Ubuntu, accept the license, and install. Initialize the base environment, verify with conda, and prepare for Jupyter Notebook usage.
Explore python basics in a crash course that covers data types, variables, and core structures, including lists, sets, tuples, dictionaries, booleans, and comparison and logical operators.
Explore Python string fundamentals, including single and double quotes, escaping quotes, raw strings, and string formatting with curly braces to construct and print text for machine learning workflows.
Learn how sets in Python remove duplicates and keep only unique values, defined with curly braces. Converting a list to a set yields non-ordered, non-indexable elements.
Learn boolean data types and comparison operators in Python, including true, false, and greater than. Identify how double equals work for comparison versus assignment, and how None and strings compare.
Explore how logical operators and, or, work with comparison operators to evaluate boolean expressions, and how or yields true when any condition is true, while and requires all conditions.
Learn how to iterate over lists, tuples, sets, and strings using for loops and range, print items and their types, and compare with while loops for cleaner code.
Learn how Python function definitions use def and lambda, contrast return and print, and see lambda with single and multiple parameters for powers and products.
Master numpy basics, including arrays, NaN and infinity handling, and essential statistics like mean and variance. Learn reshaping, ravel and flatten, random numbers, where, concatenate, sorting, and dates.
Learn to work with NumPy arrays in Python: install or import NumPy, create 1D and 2D arrays from lists, inspect shapes, and convert data types between int, float, and string.
Learn to work with np.nan and np.inf in numpy arrays, convert types with astype, locate nan and inf with np.isnan and np.isinf, and replace them with a value.
Master shape, reshape, ravel, and flatten in numpy. Transform a 2d array from 3x2 to 2x3 and to a single row of 6 elements, or into a vector.
Explore numpy array creation with arange, linspace, and logspace, plus zeros and ones, then learn tiling, repeating, and generating random numbers with seeds; finally, compute unique values and their counts.
Explore NumPy where to filter arrays by conditions like greater than ten, use boolean masks, and obtain argmax and argmin indices to locate extremes.
Learn to save and load 2d numpy arrays as text and csv with delimiters, use np.save and np.load, handle loading with loadtxt, and save multiple arrays while noting UTF-8 considerations.
Learn pandas DataFrame and Series by building a dictionary with fruit and vegetables, converting it to a DataFrame, and noting that a Series has column while a DataFrame has columns.
Inspect a data frame using info and describe, verify shape, detect duplicates with duplicated and subset, then append another frame and drop duplicates to restore unique rows.
Learn to view and update data frame columns using df.columns, and rename them with df.rename via a dictionary, transforming names like 'name' and 'team' in pandas.
Learn to detect and count missing values in a data frame with pandas, then handle nulls by dropping rows or columns or imputing with mean, median, or max.
Apply imputation to handle missing data in pandas by filling nulls with zeros or the mean. Learn to fill revenue and meta score columns and verify no null values remain.
Explore how to use lambda functions with pandas to transform metascore values, apply conditional logic row by row, and replace nulls with the mean value.
Learn how to generate linear data with NumPy, then visualize it using matplotlib in a Jupyter notebook, plotting x and y with plt.plot and exploring linspace and randint.
Learn to label axes and add a title to a matplotlib plot, using xlabel, ylabel, and title to clearly describe the x and y axes.
Create scatter plots, bar plots, and hist plots from x and y data with matplotlib. Adjust line width, bar width, and histogram bins, and preview the box plot.
Create side-by-side subplots with plt.subplot(1,2,1) and plt.subplot(1,2,2) for two data series. Embed a nested plot with fig.add_axes and ax references, and label axes and titles.
Learn to customize matplotlib plots by setting x and y limits and tick labels, create subplots, and apply axis labeling for clear linear regression visuals.
Learn to create and customize pie plots with Matplotlib in pyplot, including color mappings, labels, sizes, percentages, shadows, start angles, explode effects, and inline plotting.
Plot a nested pie chart in matplotlib by creating two pie plots for outer and inner rings, customizing colors with the tab20 color map and wedge properties.
Learn to label a pie chart in matplotlib by placing ingredient labels and auto percentages inside slices, then add a legend with a bounding box anchored to the center left.
Plot a bar chart on a polar axis using random radii, angles, and widths. Reproduce the plot with a fixed seed and color bars with a plasma colormap.
Create a line plot on a polar axis with Matplotlib by defining radius and theta, configuring r max, custom r ticks and labels, and enabling the polar grid.
Apply linear regression in Python to predict continuous targets from input features in a supervised learning setup, such as house prices using the Boston housing dataset.
Explore regression examples across stock price prediction, tweet popularity, and house price modeling, using history, features, and external factors to predict continuous outcomes.
Learn the types of linear regression, from simple linear regression with a single input to multiple linear regression with several inputs, and how coefficients and gradient descent shape predictions.
Assess linear regression performance using mean squared error and residuals to compare models. See how training and testing errors reveal a sweet spot for model complexity and overfitting.
Explore scikit-learn, the Python machine learning library built on NumPy and SciPy, for classification, regression, clustering, and dimensionality reduction like PCA, with an emphasis on train-test splits for model evaluation.
Import numpy, pandas, seaborn, and matplotlib; upgrade them with pip; load the Boston dataset; perform a train test split; train a linear regression model and evaluate with MAE and MSE.
Create a correlation matrix and heatmap to quantify relationships between variables in the dataset, highlighting positive and negative correlations and the diagonal value of one.
Apply a train-test split to create training and test sets, then train a linear regression model and generate predictions for evaluation.
Assess a house price prediction model using the R2 score, mean absolute error, mean squared error, and RMSE on test set, then plot true versus predicted prices to inspect accuracy.
Plot a learning curve to show how a linear regression model improves with more training samples, using cross validation and tracking training and test scores.
Plot residuals with the Yellowbrick residual plot to interpret model errors and compare training versus testing R2 scores.
Explore the prediction error plot to compare actual targets with predicted values, interpret the identity and best-fit lines, and diagnose regression models using r-squared and skewness trends.
Apply data pre-processing to ensure linear regression assumptions—linear relation, normally distributed inputs, no collinearity, homoscedastic errors—and use R2 to assess simple versus multiple regression and handle outliers.
Define and evaluate linear model assumptions - linear relationships, normal inputs, no multicollinearity, and homoscedastic residuals - using scatter, residual, Q-Q plots, and correlation matrices; drop correlated features if needed.
Create a reference data set to validate four linear model assumptions by generating normally distributed numbers and a linear y = beta0 + beta1 x, and compare with Boston data.
Assess linear model assumptions for the Boston dataset by visualizing the target against features with a Seaborn dot plot. Reveal nonlinearity and imperfect linear fit, indicating a transformation is needed.
Explore various variable transformations beyond log, including reciprocal, square root, exponential, Box-Cox, and Yeo-Johnson, and apply scikit-learn's power transformation to improve normality in data.
Demonstrate applying reciprocal transformation to the arm variable, compare it with log transformation, and visualize distributions with histograms using the Boston data.
The lecture tests square root and exponential transformations on the average number of rooms per house to achieve a normal distribution for regression, noting that log and inverse transformations fail.
Explore Box-Cox transformation using sklearn's power transformer on a Boston housing variable, addressing 1d vs 2d input and fit/transform workflows, with the Y Johnson transformation next.
Johnson transformation versus Box-Cox is explored to achieve a linear relationship between input and target, with tests for normality and homoscedasticity guiding the best transformation.
Apply a Johnson-based power transformation to achieve normality in regression data, inspect with histograms and Q-Q plots, and assess skewness for variables like crime and Lstat.
Apply a transformation to the crime variable to achieve homoscedasticity, and assess model accuracy via MSE and RMSE on train test split.
Evaluates transformations to address homoscedasticity in a crime variable, tests log and inverse transformations, notes Yeo-Johnson underperforms, compares mean square error, and suggests nonlinear or polynomial regression.
Check multicollinearity by computing a correlation matrix and visualizing a heatmap, then drop highly correlated variables like radius and tax to improve model performance.
Apply standardization and normalization to a Boston dataset using StandardScaler, compare mean squared error with and without pre-processing, and discuss upcoming topics like outlier detection and feature selection.
Explore how linear regression model interpretability reveals how input features influence predictions, using Python libraries like Yellowbrick, lime, and sap explainers to interpret a machine learning black box.
Review pre-processing for linear regression, confirm the linear relationship, normality of input features, multicollinearity, and homoscedasticity, and prep the Boston dataset by adding a price target column.
Explore model interpretability with Yellowbrick and Lime, plot prediction error and residuals for the Boston housing data using linear regression, and assess accuracy with a 20% test split.
Explore lime, a local interpretable, model-agnostic explainer using input features on a trained model treated as a black box. Learn to install lime with pip and use the tabular explainer.
Explore how the dependence plot shows the marginal effect of variables on predicted outcomes and SAP analysis reveals linear or nonlinear relationships with lstat and nitric oxide affecting house prices.
Explain how an individual data point influences a model's prediction using the force plot, showing positive and negative feature contributions, base value, and the final prediction.
Explain how a shap heatmap reveals model interpretability for a linear regression on the Boston housing dataset. Visualize feature importance through SAP values, showing positive and negative impacts on predictions.
Explain machine learning model predictions using SHAP waterfall plots, showing how individual features push the predicted value above the expected value, with features ranked by importance.
Explain feature selection with SHAP by comparing models trained on most versus least important features, and visualize residuals to compare R2 scores, highlighting group effects over individual features.
Learn to check linear model assumptions on a selected feature in Python, using histograms, probability plots, and residual plots to assess normality and skewness.
Plot and assess linear model assumptions using qq plots, probability plots, histograms, and residual plots on a selected feature, test homoscedasticity and linearity, and interpret r-squared and outliers.
Detect outliers in linear regression with box plots and IQR, applying 1.5 times the IQR for normal data and 3 times the IQR for skewed data, noting when outliers matter.
Visualize and diagnose outliers using histograms, qq plots, and box plots on the Boston housing data, then remove outliers and explore transformations to normalize skewed data.
Detect outliers for normal and skewed distributions using the three-sigma rule and the IQR rule, then implement a Python function to compute bounds.
Detect outliers in skewed variables using an iqr-based method that computes q3 minus q1 and applies a distance factor to define lower and upper bounds.
Remove outliers with Windsor from feature-engine, using Gaussian or skewed distributions and a fold of 1.5 or 3, applied to 13 features to create a Boston clean dataset.
Remove outliers and apply Yeo-Johnson power transformations to features, then evaluate a linear regression model with residual plots to boost accuracy; cover scikit-learn pipelines and feature selection.
Review the prior sections on linear regression optimization, data pre-processing, outlier removal with the winsorizer, and power transformer transformations, plus loading the Boston dataset and using interpretability features.
Learn to visualize data with the Lux API alongside pandas, generating automatic, intelligent plots, from correlation scatter plots to distributions and interactive price versus feature comparisons.
Identify the most correlated features with house price using a correlation matrix. Visualize relationships with heatmaps and bar plots, then apply absolute values to pick top features.
Identify the most correlated features with house price by applying an absolute-correlation threshold, select them, and visualize the correlation matrix with a heatmap using the Boston data set.
Evaluate model performance using selected features highly correlated with the target, applying outlier removal and transformations, and compare boolean-configured setups achieving R-squared around 0.52–0.58 on the Boston dataset.
Explore recursive feature elimination, starting with all features and removing the least performing one to optimize a linear regression model using scikit-learn's RFE.
Explore incremental feature selection using incremental RFE to optimize linear regression models, showing how adding features and handling outliers improves R-squared and overall accuracy.
Explore exhaustive feature selection and compare it with recursive feature elimination to identify best feature combinations for linear regression, while noting computational trade-offs and training versus test accuracy.
Unlock the power of machine learning with our comprehensive Python course on linear regression. Learn how to use Python to analyze data and build predictive models. This course is perfect for beginners with little or no programming experience and experienced Python developers looking to expand their skill set.
You'll start with the basics of Python and work your way up to advanced techniques like linear regression, which is a powerful tool for predicting future outcomes based on historical data. Along the way, you'll gain hands-on experience with popular Python libraries such as NumPy, Pandas, and Matplotlib. We will also cover the important aspect of model optimization, interpretability, and feature selection. You will learn how to optimize your model to improve its performance and how to interpret the model results and understand the underlying relationships in your data. We will also discuss feature selection techniques that are used to identify the most essential features that drive the predictions.
By the end of the course, you'll have a solid understanding of how to use Python to build linear regression models and make accurate predictions. You'll also be able to apply your new skills to a wide range of machine learning and data science projects. So, if you're ready to take your Python skills to the next level and start using machine learning to analyze and predict real-world outcomes, this is the course for you!
What is covered in this course?
This course teaches you, step-by-step coding for Linear Regression in Python. The Linear Regression model is one of the widely used in machine learning and it is one the simplest ones, yet there is so much depth that we are going to explore in 14+ hours of videos.
Below are the course contents of this course:
Section 1- Introduction
This section gets you to get started with the setup. Download resources files for code along.
Section 2- Python Crash Course
This section introduces you to the basics of Python programming.
Section 3- Numpy Introduction
This section is optional, you may skip it but I would recommend you to watch it if you are not comfortable with NumPy.
Section 4- Pandas Introduction
This section introduces you to the basic concepts of Pandas. It will help you later in the course to catch up on the coding.
Section 5- Matplotlib Introduction
Do not skip this section. We will be using matplotlib plots extensively in the coming sections. It builds a foundation for a strong visualization of linear regression results.
Section 6- Linear Regression Introduction
We will kick-start our Linear Regression learning. You will learn the basics of linear regression. You will see some examples so that you can understand how Linear Regression works and how to analyze the results.
Section 7- Data Preprocessing for Linear Regression
This section is the most important section. DO NOT SKIP IT. It builds the foundation of data preprocessing for linear regression and other linear machine learning models. You will be learning, what are the techniques which we can use to improve the performance of the model. You will also learn how to check if your data is satisfying the coding of Linear Model Assumptions.
Section 8- Machine Learning Models Interpretability and Explainer
This section teaches you how to open-up any machine learning models. Now you don't need to treat machine learning models as black-box, you will get to learn how to open this box and how to analyze each and every component of machine learning models.
Section 9- Linear Regression Model Optimization
This section extensively uses the knowledge of previous sections so don't skip those. You will learn various techniques to improve model performance. We will show you how to do outliers removal and feature transformations.
Section 10- Feature Selection for Linear Regression
This section teaches you some of the best techniques of feature selection. Feature selection reduces the model complexity and chances of model overfitting. Sometimes the model also gets trained faster but mostly depends on how many features are selected and the types of machine learning models.
Section 11- Ridge & Lasso Regression, ElasticNet, and Nonlinear Regression
This section covers, various types of regression techniques. You will be seeing how to achieve the best accuracy by using the above techniques.
By the end of this course, your confidence will boost in creating and analyzing the Linear Regression model in Python. You'll have a thorough understanding of how to use regression modeling to create predictive models and solve real-world business problems.