Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
E
exa_news_classificator
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Vasyl Bodnaruk
exa_news_classificator
Commits
0e68f99e
Commit
0e68f99e
authored
Aug 22, 2017
by
Tags
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Method Cross validation
parent
5dd6300d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
4 deletions
+2
-4
news_classify_tag.py
news_classify_tag.py
+2
-4
No files found.
news_classify_tag.py
View file @
0e68f99e
...
...
@@ -329,10 +329,8 @@ def cross_validation():
sql
=
" SELECT tag_id FROM wp_esi_tag_news WHERE news_id ="
+
str
(
id_news
)
results
=
tags_classif
.
db
.
query
(
sql
)
tags_in_article
=
{
tag
for
(
tag
,
)
in
tags_classif
.
db
.
store_result
()
.
fetch_row
(
maxrows
=
0
)}
print
(
rez_accordance
,
tags_in_article
,
len
(
rez_accordance
&
tags_in_article
))
tags_in_article
=
{
int
(
tag
)
for
(
tag
,
)
in
tags_classif
.
db
.
store_result
()
.
fetch_row
(
maxrows
=
0
)}
if
len
(
rez_accordance
&
tags_in_article
)
!=
0
:
total_score
+=
1
else
:
print
(
"
\n
#"
,
str
(
i
))
...
...
@@ -341,7 +339,7 @@ def cross_validation():
print
(
set
(
rez_accordance
))
print
(
"User classified tags for news:"
,
set
(
tags_in_article
))
print
(
"
\n\n
The Model was tasted on "
,
len
(
news_results
),
" news. "
)
print
(
"
The total result is:"
,
total_score
/
len
(
news_results
))
print
(
"The total result is:"
,
total_score
/
len
(
news_results
))
# exit(0)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment