SlideShare a Scribd company logo
Linear Regression Implementation from Scratch
Eng Teong Cheah
Contents
Linear Regression Implementation from Scratch
Linear Regression
Implementation from
Scratch
Linear Regression Implementation from Scratch
Generating Data Sets
Visualize the Second Feature and Label
Reading Data
Print a Small Data Batch
[[ 1.7130351 2.0944266 ] [-1.95122 -1.0635319 ]
[ 0.22546557 0.8499169 ] [-1.6903632 -0.15907401]
[ 0.85316896 1.0389048 ] [-0.17798574 1.410267
[-2.152955 -1.3841926 ] [ 0.8605494 -0.22276537]
[-0.33177793 -0.99060804] [ 2.584889 -1.1416703 ]]
<NDArray 10x2 @cpu(0)>
[ 0.5036066 3.9271483 1.7579273 1.353747 2.3738737 –
4.593405 6.6843915 6.8792953 13.258079 ]
NDArray 10 @cpu(0)>
Initial Model Parameters
Define the Linear Model
Define the Loss function
Define the Optimization Algorithm
Training
Training
Thanks!
Does anyone have any questions?
Twitter: @walkercet
Blog: https://ceteongvanness.wordpress.com
Resources
Dive into Deep Learning

More Related Content

PPT
Chapter 5 Useful Matrices Generators
PDF
58517990 estimating-resi-building
PDF
3 grooves
PDF
Concise Implementation of Linear Regression
DOC
Hw8p5
PPT
Financial Data Mining Talk
PDF
Profiling of Oracle Function Calls
DOCX
Analisis gap dan thurstone
Chapter 5 Useful Matrices Generators
58517990 estimating-resi-building
3 grooves
Concise Implementation of Linear Regression
Hw8p5
Financial Data Mining Talk
Profiling of Oracle Function Calls
Analisis gap dan thurstone

Similar to Linear Regression Implementation From Scratch (20)

PDF
Development of a Reinforcement Learning-Based Optimization Model for Customer...
PDF
6. Vectors – Data Frames
 
ODP
Linux boot-time
PPTX
PROJECT 8th SEM - DEVELOPMENT OF SOME INTEGRATED DECISION-MAKING FRAMEWORK FO...
PPTX
RESPONSE SURFACE METHODOLOGY PRESENTATION.pptx
DOCX
Question1.xlsxAnova ResultsSUMMARY OUTPUTRegression Statistic.docx
PDF
LISA2019 Linux Systems Performance
PDF
DOCX
metadatacoreProperties.xmlModel2015-07-13T030104Zthua3267th.docx
PDF
EKON22 Introduction to Machinelearning
PDF
ECE469 proj2_Lakshmi Yasaswi Kamireddy
PPTX
Debugging linux issues with eBPF
PDF
Sample Calculations for solar rooftop project in India
PDF
ioDrive de benchmarking 2011 1209_zem_distribution
PDF
Design of a Controller for MIMO System by using Approximate Model Matching (A...
DOCX
ECE 468 Lab Project 2
PDF
Aluminum Housing,aluminum Used Marine Gearbox,Angle Bevel Gearbox
KEY
Cassandra Summit 2010 - Operations & Troubleshooting Intro
PDF
Beauty clinic (Business Loan) urdu
PDF
Polardb percona-19
Development of a Reinforcement Learning-Based Optimization Model for Customer...
6. Vectors – Data Frames
 
Linux boot-time
PROJECT 8th SEM - DEVELOPMENT OF SOME INTEGRATED DECISION-MAKING FRAMEWORK FO...
RESPONSE SURFACE METHODOLOGY PRESENTATION.pptx
Question1.xlsxAnova ResultsSUMMARY OUTPUTRegression Statistic.docx
LISA2019 Linux Systems Performance
metadatacoreProperties.xmlModel2015-07-13T030104Zthua3267th.docx
EKON22 Introduction to Machinelearning
ECE469 proj2_Lakshmi Yasaswi Kamireddy
Debugging linux issues with eBPF
Sample Calculations for solar rooftop project in India
ioDrive de benchmarking 2011 1209_zem_distribution
Design of a Controller for MIMO System by using Approximate Model Matching (A...
ECE 468 Lab Project 2
Aluminum Housing,aluminum Used Marine Gearbox,Angle Bevel Gearbox
Cassandra Summit 2010 - Operations & Troubleshooting Intro
Beauty clinic (Business Loan) urdu
Polardb percona-19
Ad

More from Eng Teong Cheah (20)

PDF
Modern Cross-Platform Apps with .NET MAUI
PDF
Efficiently Removing Duplicates from a Sorted Array
PDF
Monitoring Models
PDF
Responsible Machine Learning
PDF
Training Optimal Models
PDF
Deploying Models
PDF
Machine Learning Workflows
PDF
Working with Compute
PDF
Working with Data
PDF
Experiments & TrainingModels
PDF
Automated Machine Learning
PDF
Getting Started with Azure Machine Learning
PDF
Hacking Containers - Container Storage
PDF
Hacking Containers - Looking at Cgroups
PDF
Hacking Containers - Linux Containers
PDF
Data Security - Storage Security
PDF
Application Security- App security
PDF
Application Security - Key Vault
PDF
Compute Security - Container Security
PDF
Compute Security - Host Security
Modern Cross-Platform Apps with .NET MAUI
Efficiently Removing Duplicates from a Sorted Array
Monitoring Models
Responsible Machine Learning
Training Optimal Models
Deploying Models
Machine Learning Workflows
Working with Compute
Working with Data
Experiments & TrainingModels
Automated Machine Learning
Getting Started with Azure Machine Learning
Hacking Containers - Container Storage
Hacking Containers - Looking at Cgroups
Hacking Containers - Linux Containers
Data Security - Storage Security
Application Security- App security
Application Security - Key Vault
Compute Security - Container Security
Compute Security - Host Security
Ad

Recently uploaded (20)

PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
Machine learning based COVID-19 study performance prediction
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
DOCX
The AUB Centre for AI in Media Proposal.docx
PPTX
Cloud computing and distributed systems.
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Encapsulation_ Review paper, used for researhc scholars
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Approach and Philosophy of On baking technology
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PPTX
sap open course for s4hana steps from ECC to s4
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PPTX
Big Data Technologies - Introduction.pptx
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Encapsulation theory and applications.pdf
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Machine learning based COVID-19 study performance prediction
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
The AUB Centre for AI in Media Proposal.docx
Cloud computing and distributed systems.
Dropbox Q2 2025 Financial Results & Investor Presentation
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Encapsulation_ Review paper, used for researhc scholars
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Building Integrated photovoltaic BIPV_UPV.pdf
Approach and Philosophy of On baking technology
Digital-Transformation-Roadmap-for-Companies.pptx
sap open course for s4hana steps from ECC to s4
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Big Data Technologies - Introduction.pptx
20250228 LYD VKU AI Blended-Learning.pptx
Per capita expenditure prediction using model stacking based on satellite ima...
Encapsulation theory and applications.pdf

Linear Regression Implementation From Scratch