data=readtable('ad_data.csv');
train=readtable('ad_training.csv');
test=readtable('ad_test.csv');
data_val=[data.TV data.Sales];
train_val=[train.TV train.Sales];
test_val=[test.TV test.Sales];
figure
plot(data_val(:,1),data_val(:,2),'ok','LineWidth',0.5)
hold on
plot(train_val(:,1),train_val(:,2),'ob','LineWidth',1.5)
plot(test_val(:,1),test_val(:,2),'or','LineWidth',1.5)
ylabel('Sales (in $1000)')
xlabel('TV advertising (in $1000)')
legend('Data','Train','Test')
