-
Notifications
You must be signed in to change notification settings - Fork 0
/
visua_2.m
52 lines (41 loc) · 927 Bytes
/
visua_2.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
%Author: Andrea Sessa
%Email: [email protected]
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%This script extract and visualize the important characteristics
%of the SDSS spectra dataset
%% Workspace preparation
clear all;
close all;
clc;
%% Dataset loading
load spectraInputs.mat
load spectraOutputs.mat
load spectraWavelenght.mat
t = t';
[N,M] = size(s);
%Normalization
norm = zscore(s);
%Shuffling
indx = randperm(N);
t = t(indx);
s = s(indx,:);
%To remove
t(t == 9) = 7;
t(t == 0) = 3;
%% Plot sample spectrum
figure()
for ii=[2,3,4,6]
e = find(t == ii,1);
plot(w',s(e,:)+20*ii)
hold on
%text(6600,20*ii+30,labels(:,ii+1))
hold on
end
xlabel('Wavelength(angstrom)')
ylabel('Flux')
%% Plot classes distribution
figure()
histogram(t)
ax = gca;
lab = {'star', 'abs galaxy', 'galaxy', 'em. galaxy', 'narrow QSO', 'broad QSO', 'Late star'};
set(gca,'XLim',[0 8],'XTick',1:7,'XTickLabel',lab)