-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* TopBottomR similarity * Update centrality tool * Update ConceptTypicality for new version of fcapsy * Centrality html export * Black formatter
- Loading branch information
1 parent
5c69685
commit 7536c9c
Showing
11 changed files
with
151 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
from .correlation_table import CorrelationTable | ||
from .correlations_box_plot import correlations_boxplots | ||
|
||
__version__ = "0.2.5" | ||
__version__ = "0.2.6" | ||
__author__ = "Tomáš Mikula" | ||
__email__ = "mail@tomasmikula.cz" | ||
__license__ = "MIT license" | ||
__license__ = "MIT license" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
from .centrality import Centrality | ||
from .centrality import Centrality |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
from .mca_concept import MCAConcept | ||
from .mca_concept import MCAConcept |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
from .concept_typicality import ConceptTypicality | ||
from .top_r_similarity import TopRSimilarity | ||
from .top_bottom_r_similarity import TopBottomRSimilarity |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import typing | ||
|
||
import pandas as pd | ||
|
||
from itertools import combinations | ||
|
||
from .top_r_similarity import TopRSimilarity | ||
|
||
|
||
class TopBottomRSimilarity(TopRSimilarity): | ||
@staticmethod | ||
def _init(inst, to_columns): | ||
r_range = range(1, len(inst._source.index)) | ||
|
||
results = [] | ||
|
||
# filtered_columns = filter( | ||
# lambda c: c not in ignore_columns, inst._source.columns | ||
# ) | ||
|
||
columns_tuples, labels = inst._get_column_orders( | ||
inst._source, | ||
[(x, y) for x in inst._source.columns for y in to_columns if x != y], | ||
) | ||
|
||
for (column1_order, column2_order), label in zip(columns_tuples, labels): | ||
column1_order_reversed = column1_order[::-1] | ||
column2_order_reversed = column2_order[::-1] | ||
|
||
for r in r_range: | ||
top_r = inst._top_r_similarity( | ||
inst._context, inst._similarity, column1_order, column2_order, r | ||
) | ||
bottom_r = inst._top_r_similarity( | ||
inst._context, | ||
inst._similarity, | ||
column1_order_reversed, | ||
column2_order_reversed, | ||
r, | ||
) | ||
results.append( | ||
[ | ||
r, | ||
top_r * bottom_r, | ||
label, | ||
] | ||
) | ||
|
||
return pd.DataFrame(results, columns=["r", "top_bottom_r_similarity", "label"]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters