Mavzu: Logistik regressiya tushunchasi va ularni mashinali o’qitishda qo’llanilishi


Download 1.98 Mb.
Sana16.06.2023
Hajmi1.98 Mb.
#1495341
Bog'liq
4-lab



Mavzu: Logistik regressiya tushunchasi va ularni mashinali
o’qitishda qo’llanilishi.
Biz bu laboratoriya topshirig’ini Mathlab dasturida tayyor kutubxonalardan foydalanib vazifani bajaramiz. Men bu vazifani talabalar sessiya imtixonini topshirdimi yoki yo’qmi shu haqda tayyorladim. Ya’ni bizga ma’lumki talaba sessiya imtixoniga kirishi uchun avval fandan kamida 60 bal va sessiya imtixonida ham kamida 60 ball olsa u sessiyani topshirgan hisoblanadi. Men bu laboratoriya ishini 15 ta talaba misolida ishladim. Unda amallarni ketma – ket bajaramiz.

Matlab dasturini ishga tushiramiz. (1-rasm)

1-rasm
Logistik regressiya papkasini yo’lini ko’rsatamiz. (2-rasm)

Papkani ko’rsatganimizda quyidagi ko’rinishda bo’ladi. (3-rasm)

Logistic-Reggression papkasidan Main.m va plotdata.m fayllaridan foydalanamiz. (4-rasm)

Data fayli qiymatlarini kamaytiramiz. (5-rasm)

Grafik natijalarini hosil qilish uchun sichqonchaning o’ng tugmasini bosamiz. Evaluste Selection buyrug’idan foylanamamiz. (6-rasm)

6-rasm
Misolimiz natijasi quyidagi grafik ko’rinishida bo’ladi. (7-rasm)

7-rasm
Imtihondan o’tolmagan talabalarning belgisining rangini o’zgartirishimiz mumkin.
MarkerFaceColorni blue(ko’k) rangga o’zgartiramiz. (8-rasm)

8-rasm
ILOVA
Dasturning kodi: Plot data qismi
function plotData(X, y)
%PLOTDATA Plots the data points X and y into a new figure % PLOTDATA(x,y) plots the data points with + for the positive examples
% and o for the negative examples. X is assumed to be a Mx2 matrix.
% Create New Figure figure; hold on;
% Find Indices of Positive and Negative Examples pos = find(y==1); neg = find(y == 0);
% Plot Examples
plot(X(pos, 1), X(pos, 2), 'k+', 'LineWidth', 2, 'MarkerSize',
7);
plot(X(neg, 1), X(neg, 2), 'ko', 'MarkerFaceColor', 'b',
'MarkerSize', 7);
hold off; end
Main qismi
%% Initialization clear; close all; clc
%% Load Data
% The first two columns contains the exam scores and the third column
% contains the label.
data = load('Data.txt');
X = data(:, [1, 2]); y = data(:, 3);
%% ==================== Part 1: Plotting ==================== % We start the exercise by first plotting the data to understand the
% the problem we are working with.
fprintf(['Plotting data with + indicating (y = 1) examples and o
' ...
'indicating (y = 0) examples.\n']);
plotData(X, y);
% Put some labels hold on;
% Labels and Legend xlabel('Exam 1 score') ylabel('Exam 2 score')
% Specified in plot order legend('Admitted', 'Not admitted') hold off;
FOYDALANILGAN ADABIYOTLAR:

  1. MATLAB 7.*/R2006/R2007 o’quv qo’llanma. M.2008.

  2. Mathematica. Wolfram, Stephen, 1959.

  3. Dyakonov V. P., Abramyenkova I. V., Kruglov V. V. MATLAB 5 s pakyetami rasshiryeniy. – M.: Nolidj, 2001.

  4. Dyakonov V. P. MATLAB 6.5 SP1/7 + Simulink 5/6 v. Obrabotka signalov I proyektirovaniye filtrov. – M.: Solon_R, 2005.

  5. Dyakonov V. P. MATLAB 6.5 SP1/7 + Simulink 5/6 v. Rabota s izobrajye_ niyami i vidyeopotokami. – M.: Solon_R, 2005.

Download 1.98 Mb.

Do'stlaringiz bilan baham:




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling