In: Statistics and Probability
Please fill the blanks:
clearvars
clc
addpath('../Generation')
addpath('../Basic_blocks')
addpath('../Algorithms')
% Loading scenarios
% ===========================
scenario=1;
[data_class set_up]=scenarios_classification(scenario);
% Definition of the problem
%===================================
loss_logistic = --------------------;
loss_logistic_L1 = -----------------;
loss_logistic_L2 = -----------------;
% Different ways to solve theoreticaly
%=========================================
% Solution of the empirical risk using CVX
x_cvx=solver_cvx(-------------------);
x_L1_cvx=solver_cvx(----------------);
x_L2_cvx=solver_cvx(----------------);
% Analytic solution
C=toeplitz(data_class.Var_v1*data_class.Coef_corr_v1.^(0:data_class.M-1));
wij=inv(C)*(data_class.Mean_v1-data_class.Mean_v2);
bij=-.5*wij'*(data_class.Mean_v1+data_class.Mean_v2);
[x_cvx x_L1_cvx x_L2_cvx [wij;bij]]
pause
figure(1),
i1=find(set_up.ytrain(:,1)==1);
i2=find(set_up.ytrain(:,1)==-1);
plot(set_up.Utrain(i1,1),set_up.Utrain(i1,2),'+r'),hold on
plot(set_up.Utrain(i2,1),set_up.Utrain(i2,2),'+b'),
e_cvx=test_phase_class(set_up,'g',x_cvx)
e_L2_cvx=test_phase_class(set_up,'m',x_L2_cvx)
e_theo=test_phase_class(set_up,'k',[wij;bij])
hold off
xlabel('Coefficient 1')
ylabel('Coefficient 2')
legend('Class 1','Class 2','Logistic','Logistic L2','Optimum
Gaussian')
grid
pause
% % We draw the surface
figure(2),S1=plot_surface(set_up,@(N,U,x,y,lambda)
loss_logistic(N,U,x,y,lambda),x_L2_cvx);pause
figure(2),S2=plot_surface(set_up,@(N,U,x,y,lambda)
loss_logistic_L2(N,U,x,y,lambda),x_L2_cvx);
Levels of Measurement
In statistics, there's a variety of ways in which quantities or attributes of objects can be measured and calculated, all of which involve numbers in quantitative data sets. These datasets do not always involve numbers that can be calculated, which is determined by each datasets' level of measurement: