Multiple Linear Regression from Scratch (without using built-in functions)

preview_player
Показать описание
Code:

clc
clear all
close all
warning off
x1=[3 5 6 8 12 14];
x2=[16 10 7 4 3 2];
y=[90 72 54 42 30 12];
n=length(x1);
a=[ones(n,1) x1' x2'];
m=(a'*a);
na=inv(m);
ga=na*a';
b=ga*y';
disp(b)

Prerequisite:
Multiple Linear Regression | MATLAB
Why pinv(a) ?

Learn Complete Machine Learning & Data Science using MATLAB:

Learn Digital Signal Processing using MATLAB:

Learn Complete Image Processing & Computer Vision using MATLAB:

#MATLAB #MachineLearning #DataScience
Рекомендации по теме
welcome to shbcf.ru