Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Carlos-Francisco Méndez-Cruz
/
lcg-faaa
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
Carlos-Francisco Méndez-Cruz
2018-10-04 22:07:10 -0500
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
f1c1a26aa3ca8ccc5bd95d5dfc583851c3683ca7
f1c1a26a
1 parent
5b5b8482
LSA soft clustering
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
agrupamiento-datos-categoricos/lsa-soft-clustering.py
agrupamiento-datos-categoricos/lsa-soft-clustering.py
View file @
f1c1a26
...
...
@@ -112,12 +112,12 @@ with open("vectors_file.txt", "w") as f:
p
=
[
dict
(
pertenence
)[
x
]
if
x
in
dict
(
pertenence
)
else
0.0
for
x
in
range
(
n_topics
)]
f
.
write
(
"{}
\t
{}"
.
format
(
""
.
join
(
sentence
.
split
(
"
\t
"
)[
0
]
.
split
()),
""
.
join
(
str
(
p
)[
1
:]
.
strip
(
"]"
)
.
split
(
","
))))
"{}
\t
{}
\n
"
.
format
(
""
.
join
(
sentence
.
split
(
"
\t
"
)[
0
]
.
split
()),
""
.
join
(
str
(
p
)[
1
:]
.
strip
(
"]"
)
.
split
(
","
))))
else
:
if
n
<
n_docs
:
pertenence
=
[
dict
(
pertenence
)[
x
]
if
x
in
dict
(
pertenence
)
else
0.0
for
x
in
range
(
n_topics
)]
f
.
write
(
"
%
s
\t\t
%
s"
%
(
pertenence
,
sentence
))
f
.
write
(
"
%
s
\t\t
%
s
\n
"
%
(
pertenence
,
sentence
))
n
+=
1
else
:
break
...
...
Please
register
or
login
to post a comment