Skip to content

Commit 31c0779

Browse files
committed
Fix fname
1 parent 05e9261 commit 31c0779

File tree

5 files changed

+37
-8
lines changed

5 files changed

+37
-8
lines changed

README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11

22
<p align="center">
3-
<picture>
43
<img src="docs/img/MyLogo.png" alt="Library scheme" height="200"/>
5-
</picture>
64
</p>
75

86
<h2 align="center">

autotm/algorithms_for_tuning/genetic_algorithm/mutation.py

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,43 @@ def mutation_one_param(
1111
high_spm: float,
1212
low_n: int,
1313
high_n: int,
14-
low_back: float,
15-
high_back: float,
14+
low_back: int,
15+
high_back: int,
1616
low_decor: float,
1717
high_decor: float,
1818
elem_mutation_prob: float = 0.1,
1919
):
20+
"""
21+
One-point mutation
22+
23+
Checking the probability of mutation for each of the elements
24+
25+
Parameters
26+
----------
27+
individ: List[float]
28+
Individual to be processed
29+
low_spb: float
30+
The lower possible bound for sparsity regularizer of back topics
31+
high_spb: float
32+
The higher possible bound for sparsity regularizer of back topics
33+
low_spm: float
34+
The lower possible bound for sparsity regularizer of specific topics
35+
high_spm: float
36+
The higher possible bound for sparsity regularizer of specific topics
37+
low_n: int
38+
The lower possible bound for amount of iterations between stages
39+
high_n: int
40+
The higher possible bound for amount of iterations between stages
41+
low_back:
42+
The lower possible bound for amount of back topics
43+
high_back:
44+
The higher possible bound for amount of back topics
45+
46+
47+
Returns
48+
----------
49+
Updated individuals with exchanged chromosome parts
50+
"""
2051
for i in range(len(individ)):
2152
if random.random() <= elem_mutation_prob:
2253
if i in [2, 3]:

autotm/fitness/tm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ class Dataset:
5959
_ppmi_dict_df_path: str = "ppmi_df.txt"
6060
_ppmi_dict_tf_path: str = "ppmi_tf.txt"
6161
_mutual_info_dict_path: str = "mutual_info_dict.pkl"
62-
_texts_path: str = "ppp.csv"
62+
_texts_path: str = "prep_df.csv"
6363
_labels_path = "labels.pkl"
6464

6565
def __init__(self, base_path: str, topic_count: int):

autotm/preprocessing/dictionaries_preparation.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ def mutual_info_dict_preparation(fname):
322322

323323

324324
def prepare_all_artifacts(save_path: str):
325-
DATASET_PATH = os.path.join(save_path, "ppp.csv")
325+
DATASET_PATH = os.path.join(save_path, "prep_df.csv")
326326
BATCHES_DIR = os.path.join(save_path, "batches")
327327
WV_PATH = os.path.join(save_path, "test_set_data_voc.txt")
328328
COOC_DICTIONARY_PATH = os.path.join(save_path, "cooc_dictionary.txt")
@@ -333,7 +333,7 @@ def prepare_all_artifacts(save_path: str):
333333
ppmi_dict_df = os.path.join(save_path, "ppmi_df.txt")
334334
ppmi_dict_tf = os.path.join(save_path, "ppmi_tf.txt")
335335
MUTUAL_INFO_DICT_PATH = os.path.join(save_path, "mutual_info_dict.pkl")
336-
DOCUMENTS_TO_BATCH_PATH = os.path.join(save_path, "ppp.csv")
336+
DOCUMENTS_TO_BATCH_PATH = os.path.join(save_path, "prep_df.csv")
337337

338338
# TODO: check why batch vectorizer is returned (unused further)
339339
prepare_batch_vectorizer(

autotm/preprocessing/text_preprocessing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ def process_dataset(
164164
:return:
165165
"""
166166
os.makedirs(save_path, exist_ok=True)
167-
save_path = os.path.join(save_path, "ppp.csv")
167+
save_path = os.path.join(save_path, "prep_df.csv")
168168
data = pd.read_csv(fname) if isinstance(fname, str) else cast(pd.DataFrame, fname)
169169
data = parallelize_dataframe(
170170
data, lemmatize_text, n_cores, lang=lang, col_to_process=col_to_process

0 commit comments

Comments
 (0)