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
ef536426
Commit
ef536426
authored
7 years ago
by
bfs15
Browse files
Options
Downloads
Patches
Plain Diff
Now logs
parent
2de637d0
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/tasks/tag_clustering.rake
+12
-5
12 additions, 5 deletions
lib/tasks/tag_clustering.rake
with
12 additions
and
5 deletions
lib/tasks/tag_clustering.rake
+
12
−
5
View file @
ef536426
...
...
@@ -51,7 +51,7 @@ namespace :tag do
end
end
$
pad
=
0.05
$
PAD
=
0.05
# max flow lg distance to consider tag close
$MAX_DIST
=
4
...
...
@@ -168,22 +168,28 @@ namespace :tag do
# normalize, min will always be 0
tags
.
each
do
|
t
|
# increase max by $
pad
so its rank isn't 0
t
[
:rank
]
=
1
-
(
t
[
:rank
]
/
(
max
*
(
1
+
$
pad
)))
# increase max by $
PAD
so its rank isn't 0
t
[
:rank
]
=
1
-
(
t
[
:rank
]
/
(
max
*
(
1
+
$
PAD
)))
end
return
tags
end
def
find_relevant_results
(
tagId
,
tags
)
puts
"
\n
Started Calculating relevant results for tag of Id
#{
tagId
}
\n
"
los_ranked
=
{}
puts
"
\n
Getting tags from the same cluster, only close ones, MAX_DIST =
#{
$MAX_DIST
}
\n
"
puts
"Normalization with padding =
#{
$PAD
}
\n
"
close_tags
=
ranked_close_tags
(
tagId
,
tags
)
p
"============
===
"
p
uts
"============
\n
"
p
"close_tags"
close_tags
.
each
{
|
ct
|
p
Tag
.
find
(
ct
[
:id
]).
name
+
" | "
+
ct
[
:id
].
to_s
+
" | "
+
ct
[
:rank
].
to_s
+
" | "
+
tags
[
ct
[
:id
]][
:rank
].
to_s
}
p
"============
===
"
p
uts
"============
\n
"
puts
"
\n
Started Ranking LOs...
\n
"
# ranks each LO
# freq = cluster_frequency(close_tags)
LearningObject
.
all
.
each
do
|
lo
|
...
...
@@ -192,6 +198,7 @@ namespace :tag do
# los_ranked[lo.id] = relevance_raw_rank(lo, close_tags)
end
puts
"
\n
Sorting LOs...
\n
"
# sorts by its ranking
los_ranked
=
los_ranked
.
sort_by
{
|
id
,
rank
|
rank
}
# get highest ranks
...
...
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