Skip to content
Snippets Groups Projects
Commit 9fb05005 authored by bjje's avatar bjje
Browse files

Updated structure of lecture plan and file names (needs to be double checked)

parent f24db235
No related branches found
No related tags found
No related merge requests found
Showing
with 39 additions and 20 deletions
%% exercise 3.1.2 %% exercise 1.6.2
cdir = fileparts(mfilename('fullpath')); cdir = fileparts(mfilename('fullpath'));
[A, D] = tmg(fullfile(cdir,'../Data/textDocs.txt')); [A, D] = tmg(fullfile(cdir,'../Data/textDocs.txt'));
X = full(A)'; X = full(A)';
......
%% exercise 3.1.3 cdir = fileparts(mfilename('fullpath')); TMGOpts.stoplist = fullfile(cdir,'../Data/stopWords.txt'); [A, D] = tmg(fullfile(cdir,'../Data/textDocs.txt'), TMGOpts); X = full(A)'; attributeNames = cellstr(D); %% Display the result display(attributeNames); display(X); %% exercise 1.6.3
\ No newline at end of file cdir = fileparts(mfilename('fullpath'));
TMGOpts.stoplist = fullfile(cdir,'../Data/stopWords.txt');
[A, D] = tmg(fullfile(cdir,'../Data/textDocs.txt'), TMGOpts);
X = full(A)';
attributeNames = cellstr(D);
%% Display the result
display(attributeNames);
display(X);
%% exercise 3.1.4 cdir = fileparts(mfilename('fullpath')); TMGOpts.stoplist = '../Data/stopWords.txt'; TMGOpts.stemming = 1; [A, D] = tmg(fullfile(cdir,'../Data/textDocs.txt'), TMGOpts); X = full(A)'; attributeNames = cellstr(D); %% Display the result display(attributeNames); display(X); %% exercise 1.6.4
\ No newline at end of file cdir = fileparts(mfilename('fullpath'));
TMGOpts.stoplist = '../Data/stopWords.txt';
TMGOpts.stemming = 1;
[A, D] = tmg(fullfile(cdir,'../Data/textDocs.txt'), TMGOpts);
X = full(A)';
attributeNames = cellstr(D);
%% Display the result
display(attributeNames);
display(X);
%% exercise 3.1.5 %% exercise 1.6.5
% Query vector % Query vector
q = [0; 0; 0; 0; 0; 0; 0; 1; 0; 0; 0; 0; 1; 1; 0; 0; 0]'; q = [0; 0; 0; 0; 0; 0; 0; 1; 0; 0; 0; 0; 1; 1; 0; 0; 0]';
......
% exercise 3.2.1 % exercise 2.1.1
x = [-0.68; -2.11; 2.39; 0.26; 1.46; 1.33; 1.03; -0.41; -0.33; 0.47]; x = [-0.68; -2.11; 2.39; 0.26; 1.46; 1.33; 1.03; -0.41; -0.33; 0.47];
......
% exercise 3.3.1 % exercise 2.2.1
% Image to use as query % Image to use as query
i = 1; i = 1;
......
% exercise 3.3.2 % exercise 2.2.2
% Generate two data objects with M random attributes % Generate two data objects with M random attributes
M = 5; M = 5;
......
% exercise 4.2.1 % exercise 2.3.1
% Disable xlsread warning % Disable xlsread warning
warning('off', 'MATLAB:xlsread:ActiveX'); warning('off', 'MATLAB:xlsread:ActiveX');
......
% exercise 4.2.2 % exercise 2.3.2
mfig('Histogram for attributes'); clf; mfig('Histogram for attributes'); clf;
for m = 1:M for m = 1:M
......
% exercise 4.2.3 % exercise 2.3.3
%% Boxplot of each attribute %% Boxplot of each attribute
mfig('Boxplot'); clf; mfig('Boxplot'); clf;
......
% exercise 4.2.4 % exercise 2.3.4
%% Boxplot of each attribute for each class %% Boxplot of each attribute for each class
mfig('Boxplot per class'); clf; mfig('Boxplot per class'); clf;
......
% exercise 4.2.5 % exercise 2.3.5
mfig('Matrix of scatter plots'); clf; mfig('Matrix of scatter plots'); clf;
for m1 = 1:M for m1 = 1:M
......
% exercise 4.2.6 % exercise 2.3.6
ind = [1 2 3]; % Indices of the variables to plot ind = [1 2 3]; % Indices of the variables to plot
mfig('3D scatter plot'); clf; hold all; mfig('3D scatter plot'); clf; hold all;
......
% exercise 4.2.7 % exercise 2.3.7
mfig('Data matrix (standardized)'); clf; mfig('Data matrix (standardized)'); clf;
imagesc(zscore(X)); imagesc(zscore(X));
......
% exercise 4.3.1 % exercise 2.4.1
% Load the data % Load the data
cdir = fileparts(mfilename('fullpath')); cdir = fileparts(mfilename('fullpath'));
......
% exercise 4.3.2 % exercise 2.4.2
% Load Matlab data file and extract variables of interest % Load Matlab data file and extract variables of interest
mat_data = load('../Data/wine.mat') mat_data = load('../Data/wine.mat')
......
%% exercise 2.1.1 %% exercise 3.1.1
% Load the data into Matlab % Load the data into Matlab
cdir = fileparts(mfilename('fullpath')); cdir = fileparts(mfilename('fullpath'));
[NUMERIC, TXT, RAW] = xlsread(fullfile(cdir,'../Data/nanonose.xls')); [NUMERIC, TXT, RAW] = xlsread(fullfile(cdir,'../Data/nanonose.xls'));
......
%% exercise 2.1.2 %% exercise 3.1.2
% Data attributes to be plotted % Data attributes to be plotted
i = 1; i = 1;
j = 2; j = 2;
......
%% exercise 2.1.3 %% exercise 3.1.3
% Subtract the mean from the data % Subtract the mean from the data
Y = bsxfun(@minus, X, mean(X)); Y = bsxfun(@minus, X, mean(X));
......
%% exercise 2.1.4 %% exercise 3.1.4
% Index of the principal components % Index of the principal components
i = 1; i = 1;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment