Decision Tree Regression in MATLAB
HTML-код
- Опубликовано: 5 фев 2025
- Dataset:
x =
10×3 table
Position Level Salary
___________________ _____ _______
'Business Analyst' 1 45000
'Junior Consultant' 2 50000
'Senior Consultant' 3 60000
'Manager' 4 80000
'Country Manager' 5 110000
'Region Manager' 6 150000
'Partner' 7 200000
'Senior Partner' 8 300000
'C-level' 9 500000
'CEO' 10 1000000
Prerequisite:
www.mathworks....
Code:
clc
clear all
close all
warning off
format long
x=readtable('Position_Salaries.csv');
x.Position=[];
plot(x.Level,x.Salary,'r.','MarkerSize',20);
hold on;
model=fitrtree(x,'Salary~Level','MinParentSize',1);
zs=predict(model,6.5)
ms=min(x.Level):0.01:max(x.Level);
zs=predict(model,ms');
plot(ms,zs);
grid on;
view(model,'Mode','graph');
Learn Machine Learning and Data Science using MATLAB:
• Importing Dataset | MA...
#MachineLearning #MATLAB #DataScience
God bless you
thanks a lot for the video , but I have a code and I want to minimize error in it can you help me in it ?
hagar hossam