Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
cleaning-portalmec
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Harbor Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Richard Fernando Heise Ferreira
cleaning-portalmec
Commits
6a89961b
Commit
6a89961b
authored
7 years ago
by
Israel Barreto Sant'Anna
Browse files
Options
Downloads
Patches
Plain Diff
Fixed relevance_frequency_rank_global
parent
03ff8760
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/tasks/tag_clustering.rake
+5
-5
5 additions, 5 deletions
lib/tasks/tag_clustering.rake
with
5 additions
and
5 deletions
lib/tasks/tag_clustering.rake
+
5
−
5
View file @
6a89961b
...
@@ -197,10 +197,10 @@ namespace :tag do
...
@@ -197,10 +197,10 @@ namespace :tag do
puts
"
\n
Started Ranking LOs...
\n
"
puts
"
\n
Started Ranking LOs...
\n
"
# ranks each LO
# ranks each LO
# freq = cluster_frequency(close_tags)
# freq
_cluster
= cluster_frequency(close_tags)
LearningObject
.
all
.
each
do
|
lo
|
LearningObject
.
all
.
each
do
|
lo
|
los_ranked
[
lo
.
id
]
=
relevance_frequency_rank
(
lo
,
close_tags
)
los_ranked
[
lo
.
id
]
=
relevance_frequency_rank
(
lo
,
close_tags
)
# los_ranked[lo.id] = relevance_frequency_rank_global(lo, close_tags, freq)
# los_ranked[lo.id] = relevance_frequency_rank_global(lo, close_tags, freq
_cluster
)
# los_ranked[lo.id] = relevance_raw_rank(lo, close_tags)
# los_ranked[lo.id] = relevance_raw_rank(lo, close_tags)
end
end
...
@@ -245,7 +245,7 @@ namespace :tag do
...
@@ -245,7 +245,7 @@ namespace :tag do
def
relevance_frequency_rank_global
(
lo
,
close_tags
,
freq_cluster
)
def
relevance_frequency_rank_global
(
lo
,
close_tags
,
freq_cluster
)
# for each tag in LO that is in the cluster, accumulate it's rank
# for each tag in LO that is in the cluster, accumulate it's rank
rank_sum
=
0
rank_sum
=
1
lo
.
tags
.
each
do
|
t
|
lo
.
tags
.
each
do
|
t
|
close_tags
.
each
do
|
tag
|
close_tags
.
each
do
|
tag
|
if
tag
[
:id
]
==
t
.
id
if
tag
[
:id
]
==
t
.
id
...
@@ -255,11 +255,11 @@ namespace :tag do
...
@@ -255,11 +255,11 @@ namespace :tag do
end
end
wdf
=
0
wdf
=
0
wdf
=
(
Math
.
log2
(
freq
+
1
)
/
(
Math
.
log2
(
lo
.
tags
.
size
)
+
1
))
if
lo
.
tags
.
size
!=
0
wdf
=
(
Math
.
log2
(
rank_sum
)
/
(
Math
.
log2
(
lo
.
tags
.
size
)
+
1
))
if
lo
.
tags
.
size
!=
0
itf
=
Math
.
log2
(
Tag
.
all
.
size
/
freq_cluster
)
+
1
itf
=
Math
.
log2
(
Tag
.
all
.
size
/
freq_cluster
)
+
1
return
wdf
*
itf
*
rank_sum
return
wdf
*
itf
end
end
# returns the rank sum of the tags in the LO
# returns the rank sum of the tags in the LO
...
...
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
register
or
sign in
to comment