Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HeroTypes in Representation; DataFrame in _types #157

Merged
Merged
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
fa342a9
added MultiIndex DF support
mk2510 Aug 18, 2020
59a9f8c
beginning with tests
henrifroese Aug 19, 2020
19c52de
implemented correct sparse support
mk2510 Aug 19, 2020
66e566c
Merge branch 'master_upstream' into change_representation_to_multicolumn
mk2510 Aug 21, 2020
41f55a8
added back list() and rm .tolist()
mk2510 Aug 21, 2020
217611a
rm .tolist() and added list()
mk2510 Aug 21, 2020
6a3b56d
Adopted the test to the new dataframes
mk2510 Aug 21, 2020
b8ff561
wrong format
mk2510 Aug 21, 2020
e3af2f9
Address most review comments.
henrifroese Aug 21, 2020
77ad80e
Add more unittests for representation
henrifroese Aug 21, 2020
f7eb7c3
- Update _types.py with DocumentTermDF
henrifroese Aug 22, 2020
4937a4f
Fix DocumentTermDF example DataFrame column names
henrifroese Aug 22, 2020
e2768b5
implemented the suggested changes
mk2510 Sep 4, 2020
b09f624
fixed messy docstring
mk2510 Sep 4, 2020
508c361
fix black issues
mk2510 Sep 4, 2020
75e955f
fix formatting
mk2510 Sep 4, 2020
9ca244d
begin switch away from multiindex
henrifroese Sep 4, 2020
4ebc266
Merge remote-tracking branch 'origin/change_representation_to_multico…
henrifroese Sep 4, 2020
559a7bd
Finish switch from DocumentTermDF to MatrixDF
henrifroese Sep 4, 2020
75a999c
changed Dataframe name from MatrixDF to DataFrame
mk2510 Sep 4, 2020
a38a32b
merge master
henrifroese Sep 12, 2020
c7b0ece
apply stash
henrifroese Sep 12, 2020
4aeec2a
finish switch to DataFrame type
henrifroese Sep 12, 2020
a304413
Merge remote-tracking branch 'origin/Hero_Types_in_Representation' in…
henrifroese Sep 12, 2020
8d49bff
merge remote
henrifroese Sep 12, 2020
85076b8
Remove check for nlevels
henrifroese Sep 12, 2020
91ed11a
incorporate suggested changes
henrifroese Sep 14, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
added back list() and rm .tolist()
  • Loading branch information
mk2510 committed Aug 21, 2020
commit 41f55a8a359f15ce4ba65e1e726b9e0757fc596b
10 changes: 5 additions & 5 deletions texthero/representation.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def _check_is_valid_DocumentTermDF(df: Union[pd.DataFrame, pd.Series]) -> bool:
return isinstance(df, pd.DataFrame) and isinstance(df.columns, pd.MultiIndex)


s = pd.Series(s.values.tolist(), index=s.index)
s = pd.Series(list(s.values), index=s.index)

return s

Expand Down Expand Up @@ -415,7 +415,7 @@ def pca(
else:
values = list(s)

return pd.Series(pca.fit_transform(values).tolist(), index=s.index)
return pd.Series(list(pca.fit_transform(values)), index=s.index)


# FIXME: merge master again
Expand Down Expand Up @@ -489,7 +489,7 @@ def nmf(
else:
s_for_vectorization = list(s)

return pd.Series(nmf.fit_transform(s_for_vectorization).tolist(), index=s.index)
return pd.Series(list(nmf.fit_transform(s_for_vectorization)), index=s.index)


def tsne(
Expand Down Expand Up @@ -589,7 +589,7 @@ def tsne(
else:
s_for_vectorization = list(s)

return pd.Series(tsne.fit_transform(s_for_vectorization).tolist(), index=s.index)
return pd.Series(list(tsne.fit_transform(s_for_vectorization)), index=s.index)


"""
Expand Down Expand Up @@ -963,4 +963,4 @@ def normalize(s: pd.Series, norm="l2") -> pd.Series:
if isDocumentTermDF:
return pd.DataFrame.sparse.from_spmatrix(result, s.index, s.columns)
else:
return pd.Series(result.tolist(), index=s.index)
return pd.Series(list(result), index=s.index)