Upload
skillvv
View
28
Download
3
Embed Size (px)
DESCRIPTION
som 2014 assign
Citation preview
(www.islab.ntua.gr)
2014
2: - , - (Self Organizing Maps SOMs) Kohonen. - (SOM), , , - . , SOM ( ).
1. SOM
, - - - . SOM . , (.. ), ( Manhattan). , ( ) Kohonen SOM. - - (ordering) (tuning), , .
(somCreate.m somTrainParameters.m). , . D ,
function somCreate(minMax,gridSize) % SOM minMax Dx2 , . gridSize .
2
global . neuronsPerRow ( ) - . neuronsPerColumn ( ) - . . IW / SOM NxD, . : size rand distances NxN , , . : gridtop, hextop, randtop, hexagonaltopology ( ) boxdist, dist, linkdist, mandist ( )
function somTrainParameters(setOrderLR,setOrderSteps,setTuneLR) % % SOM setOrderLR ordering . setOrderSteps ordering . setTuneLR tuning . global . maxNeighborDist . : max ceil tuneND tuning , 1. orderLR ordering , 0.9. orderSteps ordering , 1000. tuneLR tuning , 0.01.
3
function [output] = somOutput(pattern) % SOM pattern Dx1 , D. output Nx1 SOM, SOM 0 1. SOM, 1. : negdist compet
function [a] = somActivation(pattern,neighborDist) % SOM pattern Dx1 , D. neighborDist ( SOM) . a Nx1 SOM. SOM : 1, ( neighborDist) 1 ( 0.5) 0. : somOutput find
function somUpdate(pattern,learningRate,neighborDist) % / SOM pattern Dx1 , D. learningRate SOM. neighborDist ( SOM) . / ( ) SOM Kohonen. Kohonen : wi = ai(x-wi) i SOM, wi i, x , ai i . : somActivation
P
4
function somTrain(patterns) % SOM patterns DxP SOM (training set). SOM , (), () / SOM Kohonen (). . , ordering tuning, . ordering orderSteps . , ( maxNeighborDist) () tuneND. , orderLR () tuneLR. tuning , ordering ( 2 5). tuneND. tuneLR, tuneLR . : size linspace somUpdate
2. SOM
2. SOM, , - . , , / . , ( ) .
m-files CrossData.m ExpData.m . , plot2DSomData.m ( ) ( ). SO , scripts . SOM . SOM ( )
5
.
2. SOM ( ) (clustering). clustering () . .
SOM, , . , ( /). , SOM , . , , , .
/ SOM (unified distance matrix U-matrix). () . , .
: U-matrix SOM 7x4.
m-file GroupData.m , . 1 2.
, - . SOM U-matrix somShow.m. , U-matrix :
6
( U-matrix) .
K .
.
. : . , ( ) / ( ) .
2. SOM . , , SOM . supervised SOM . SOM : T xu xs, xu xs ( ). x = [xu, xs] SOM, supervised . , / xu , SOM. ws . m-file ClassData.m [1, 0] [0, 1] .
- Umatrix. Umatrix Umatrix . , m-file UknownClassData.m ClassData.m. ( ) .
7
3. - (document clustering and visualization)
(1 2), - , . ( ) - , .
: 400 . () . Bag-of-Words, . (and, to, the ) 6025 400 . 6025, . :
service photography utility fun software art imported list apple resource
doc1 2 0 1 0 1 0 2 5 0 4
doc2 1 2 0 1 4 1 1 7 1 1
doc3 0 4 2 0 0 0 0 3 1 1
doc1 5 list, 2 service, photography ... doc2 doc3. , tf-idf (term-frequency / inverse-document-frequency), ( .. ) (.. doc1 15 doc3 11). i j tf:
( , )( , )
( , )i
f i jtf i j
f i j
, , ( list ). i idf :
( ) logi
Nidf i
df
: , dfi o i,
tf.
8
:
service photography utility fun software art imported list apple resource
tf(doc1) 0.133 0.000 0.067 0.000 0.067 0.000 0.133 0.333 0.000 0.267
tf(doc2) 0.053 0.105 0.000 0.053 0.211 0.053 0.053 0.368 0.053 0.053
tf(doc3) 0.000 0.364 0.182 0.000 0.000 0.000 0.000 0.273 0.091 0.091
idf 0.176 0.176 0.176 0.477 0.176 0.477 0.176 0.000 0.176 0.000
, i j :
( , ) ( , ) ( )w i j tf i j idf i
:
service photography utility fun software art imported list apple resource
w(doc1) 0.023 0.000 0.012 0.000 0.012 0.000 0.023 0.000 0.000 0.000 w(doc2) 0.009 0.019 0.000 0.025 0.037 0.025 0.009 0.000 0.009 0.000 w(doc3) 0.000 0.064 0.032 0.000 0.000 0.000 0.000 0.000 0.016 0.000
NewsGroup.mat : f ( 400x6025) 6025 400 ( ), terms 6025 , titles 400 . :
3. tfidf.m (tfidf) 400 NewsGroup.
3. , - 400 . somShow.m U-matrix. ;
3. SOM : i.
. ii. 2 ( terms)
( ). : positions scatter, text MATLAB ( ).
4.
site http://mycourses.ntua.gr/courses/ECE1078/.
9
2 ( 1.1.26, ) email [email protected].