Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
NWD
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
OpenSource
NWD
Commits
bb561517
Commit
bb561517
authored
Sep 6, 2014
by
Andrew Cohen
Browse files
Options
Downloads
Patches
Plain Diff
updates for NWDmin
parent
f99db594
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
GetDistances.m
+7
-1
7 additions, 1 deletion
GetDistances.m
NWD.m
+12
-9
12 additions, 9 deletions
NWD.m
results.txt
+15
-105
15 additions, 105 deletions
results.txt
with
34 additions
and
115 deletions
GetDistances.m
+
7
−
1
View file @
bb561517
...
...
@@ -44,6 +44,10 @@ for i=1:length(words)
% w2=w2(1:NW);
% w2x=w2x(1:NW);
% NWD1x(i)=NWD(w1x)-NWD(w1x,1);
% NWD1(i)=NWD(w1)-NWD(w1,1);
% NWD2x(i)=NWD(w2x)-NWD(w2x,1);
% NWD2(i)=NWD(w2)-NWD(w2,1);
NWD1x
(
i
)
=
NWD
(
w1x
);
NWD1
(
i
)
=
NWD
(
w1
);
NWD2x
(
i
)
=
NWD
(
w2x
);
...
...
@@ -53,7 +57,9 @@ for i=1:length(words)
% d2(i)=(NWD2x(i)-NWD2(i))./max(abs(NWD2x(i)),abs(NWD2(i)));;
d1
(
i
)
=
(
NWD1x
(
i
)
-
NWD1
(
i
));
d2
(
i
)
=
(
NWD2x
(
i
)
-
NWD2
(
i
));
if
isnan
(
d2
(
i
))
d2
(
i
)
=
Inf
;
end
if
d1
(
i
)
<
d2
(
i
)
% if abs(d1(i))<abs(d2(i))
fprintf
(
'1,'
);
...
...
This diff is collapsed.
Click to expand it.
NWD.m
+
12
−
9
View file @
bb561517
function
[
nwd
rgCache
]
=
NWD
(
words
,
varargin
)
if
nargin
<
2
bNWDmin
=
0
;
else
bNWDmin
=
varargin
{
1
};
end
fX
=
GetCount
(
words
);
fw
=
[];
...
...
@@ -12,16 +17,14 @@ for i=1:length(words)
fexclude
(
i
)
=
GetCount
(
ww
);
end
% nwd=(fX-min(fw))/max(fexclude);
% nwd = ( fX - max(fw) ) / ( sum(fw) - max(fw));
% nwd= ( sum(fw) - fX ) / ( sum(fw) - max(fw) );
% N=length(words);
% denom=sum(fw);
% nwd=(N/(N-1))*(fX/denom-1/N);
% nwd=(fX/denom);
N
=
GetCount
({
'N'
});
if
bNWDmin
nwd
=
(
log2
(
min
(
fw
))
-
log2
(
fX
))
/
(
log2
(
N
)
-
log2
(
min
(
fw
)));
% from xx.pdf
else
nwd
=
(
log2
(
max
(
fw
))
-
log2
(
fX
))
/
(
log2
(
N
)
-
log2
(
min
(
fw
)));
% III.3 from arxiv
end
% normalize for cardinality
nwd
=
nwd
/(
length
(
words
)
-
1
);
% nwd=(log2(max(fw))-log2(fX))/( log2(N)-log2(max(fexclude)) );
This diff is collapsed.
Click to expand it.
results.txt
+
15
−
105
View file @
bb561517
% below with normalizatino
-------------------------
GetDistances::(multiples) NW=5
2014 8 12 14 18 2.463
red,orange,yellow,green,blue,indigo,lion,tiger,bear,monkey,zebra,elephant,aardvark,lamb,fox,ape,dog,nQueryCount=394, nCacheCount=898
[6 0;0 11]
-------------------------
GetDistances::(pairs)
2014 8 12 14 19 11.238
red,orange,yellow,green,blue,indigo,lion,tiger,bear,monkey,zebra,elephant,aardvark,lamb,fox,ape,dog,kGap=2
nQueryCount=136, nCacheCount=680
nCorrect=17
-------------------------
GetDistances::(multiples) NW=5
2014 8 12 14 22 21.367
red,orange,yellow,green,blue,indigo,violet,purple,cyan,white,square,circle,rectangle,ellipse,triangle,rhombus,nQueryCount=342, nCacheCount=810
[10 0;0 6]
-------------------------
GetDistances::(pairs)
2014 8 12 14 23 16.088
red,orange,yellow,green,blue,indigo,violet,purple,cyan,white,square,circle,rectangle,ellipse,triangle,rhombus,kGap=2
nQueryCount=105, nCacheCount=615
nCorrect=16
-------------------------
GetDistances::(multiples) NW=5
2014 8 12 14 25 20.728
Barack Obama,Hillary Clinton,John Edwards,Joe Biden,Chris Dodd,Mike Gravel,John McCain,Mitt Romney,Mike Huckabee,Ron Paul,Fred Thompson,Alan Keyes,nQueryCount=198, nCacheCount=474
[6 0;0 6]
-------------------------
GetDistances::(pairs)
2014 8 12 14 26 2.281
Barack Obama,Hillary Clinton,John Edwards,Joe Biden,Chris Dodd,Mike Gravel,John McCain,Mitt Romney,Mike Huckabee,Ron Paul,Fred Thompson,Alan Keyes,kGap=2
nQueryCount=66, nCacheCount=330
nCorrect=7
%below without normalization
-------------------------
GetDistances::(multiples) NW=5
2014
8
12
14
35
5.9
38
red,orange,yellow,green,blue,indigo,lion,tiger,bear,monkey,zebra,elephant,aardvark,lamb,fox,ape,dog,nQueryCount=
394
, nCacheCount=
898
2014
9
5
22
18
10.4
38
red,orange,yellow,green,blue,indigo,lion,tiger,bear,monkey,zebra,elephant,aardvark,lamb,fox,ape,dog,nQueryCount=
0
, nCacheCount=
1292
[6 0;0 11]
-------------------------
GetDistances::(pairs)
2014 8 12 14 36 17.183
red,orange,yellow,green,blue,indigo,lion,tiger,bear,monkey,zebra,elephant,aardvark,lamb,fox,ape,dog,kGap=2
nQueryCount=136, nCacheCount=680
nCorrect=17
-------------------------
GetDistances::(multiples) NW=5
2014
8
12
14
39
3
2.895
red,orange,yellow,green,blue,indigo,violet,purple,cyan,white,square,circle,rectangle,ellipse,triangle,rhombus,nQueryCount=3
4
2, nCacheCount=8
10
2014
9
5
22
21
3
1.57
red,orange,yellow,green,blue,indigo,violet,purple,cyan,white,square,circle,rectangle,ellipse,triangle,rhombus,nQueryCount=32
0
, nCacheCount=8
32
[10 0;0 6]
-------------------------
GetDistances::(pairs)
2014 8 12 14 40 25.069
red,orange,yellow,green,blue,indigo,violet,purple,cyan,white,square,circle,rectangle,ellipse,triangle,rhombus,kGap=1
nQueryCount=105, nCacheCount=615
nCorrect=16
-------------------------
GetDistances::(multiples) NW=5
2014
8
12
14
42
3
0.5
33
2014
9
5
22
23
5
0.5
69
Barack Obama,Hillary Clinton,John Edwards,Joe Biden,Chris Dodd,Mike Gravel,John McCain,Mitt Romney,Mike Huckabee,Ron Paul,Fred Thompson,Alan Keyes,nQueryCount=198, nCacheCount=474
[6 0;0 6]
...
...
@@ -92,7 +26,7 @@ Barack Obama,Hillary Clinton,John Edwards,Joe Biden,Chris Dodd,Mike Gravel,John
-------------------------
GetDistances::(pairs)
2014
8
12
14
4
3
12.117
2014
9
5
22
2
4
38.426
Barack Obama,Hillary Clinton,John Edwards,Joe Biden,Chris Dodd,Mike Gravel,John McCain,Mitt Romney,Mike Huckabee,Ron Paul,Fred Thompson,Alan Keyes,kGap=2
nQueryCount=66, nCacheCount=330
nCorrect=7
...
...
@@ -100,7 +34,7 @@ nCorrect=7
-------------------------
GetDistances::(multiples) NW=5
2014
8
13
11
57
7.35
3
2014
9
5
22
29
12.91
3
red,orange,yellow,green,blue,indigo,lion,tiger,bear,monkey,zebra,elephant,aardvark,lamb,fox,ape,dog,nQueryCount=0, nCacheCount=1292
[6 0;0 11]
...
...
@@ -108,31 +42,7 @@ red,orange,yellow,green,blue,indigo,lion,tiger,bear,monkey,zebra,elephant,aardva
-------------------------
GetDistances::(pairs)
2014 8 13 11 57 9.352
red,orange,yellow,green,blue,indigo,lion,tiger,bear,monkey,zebra,elephant,aardvark,lamb,fox,ape,dog,kGap=2
nQueryCount=0, nCacheCount=816
nCorrect=17
-------------------------
GetDistances::(multiples) NW=5
2014 8 13 11 57 9.427
red,orange,yellow,green,blue,indigo,violet,purple,cyan,white,square,circle,rectangle,ellipse,triangle,rhombus,nQueryCount=0, nCacheCount=1152
[10 0;0 6]
-------------------------
GetDistances::(multiples) NW=5
2014 8 13 12 2 16.924
red,orange,yellow,green,blue,indigo,lion,tiger,bear,monkey,zebra,elephant,aardvark,lamb,fox,ape,dog,nQueryCount=394, nCacheCount=898
[6 0;0 11]
-------------------------
GetDistances::(pairs)
2014 8 13 12 3 31.293
2014 9 5 22 30 36.213
red,orange,yellow,green,blue,indigo,lion,tiger,bear,monkey,zebra,elephant,aardvark,lamb,fox,ape,dog,kGap=2
nQueryCount=136, nCacheCount=680
nCorrect=17
...
...
@@ -140,15 +50,15 @@ nCorrect=17
-------------------------
GetDistances::(multiples) NW=5
2014
8
13
1
2
6
44.511
red,orange,yellow,green,blue,indigo,violet,purple,cyan,white,square,circle,rectangle,ellipse,triangle,rhombus,nQueryCount=
342
, nCacheCount=
810
2014
9
5
2
2
30
36.384
red,orange,yellow,green,blue,indigo,violet,purple,cyan,white,square,circle,rectangle,ellipse,triangle,rhombus,nQueryCount=
0
, nCacheCount=
1152
[10 0;0 6]
-------------------------
GetDistances::(pairs)
2014
8
13
12
7
3
9.17
2014
9
5
22
31
3
8.331
red,orange,yellow,green,blue,indigo,violet,purple,cyan,white,square,circle,rectangle,ellipse,triangle,rhombus,kGap=1
nQueryCount=105, nCacheCount=615
nCorrect=16
...
...
@@ -156,15 +66,15 @@ nCorrect=16
-------------------------
GetDistances::(multiples) NW=5
2014
8
13
1
2
9
46.467
Barack Obama,Hillary Clinton,John Edwards,Joe Biden,Chris Dodd,Mike Gravel,John McCain,Mitt Romney,Mike Huckabee,Ron Paul,Fred Thompson,Alan Keyes,nQueryCount=
198
, nCacheCount=
474
2014
9
5
2
2
31
38.411
Barack Obama,Hillary Clinton,John Edwards,Joe Biden,Chris Dodd,Mike Gravel,John McCain,Mitt Romney,Mike Huckabee,Ron Paul,Fred Thompson,Alan Keyes,nQueryCount=
0
, nCacheCount=
672
[6 0;0 6]
-------------------------
GetDistances::(pairs)
2014
8
13
1
2 1
0
28.391
2014
9
5
2
2
3
1
40.923
Barack Obama,Hillary Clinton,John Edwards,Joe Biden,Chris Dodd,Mike Gravel,John McCain,Mitt Romney,Mike Huckabee,Ron Paul,Fred Thompson,Alan Keyes,kGap=2
nQueryCount=
66
, nCacheCount=3
30
nQueryCount=
0
, nCacheCount=3
96
nCorrect=7
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
sign in
to comment