Update Preprocessing Script.py
Browse files- Preprocessing Script.py +3 -1
Preprocessing Script.py
CHANGED
|
@@ -347,12 +347,14 @@ def split_df_into_train_and_test_sets(df):
|
|
| 347 |
test = df[df['group'] == 'testing']
|
| 348 |
return train, test
|
| 349 |
|
|
|
|
|
|
|
| 350 |
HematoxLong2023=pd.read_csv("Long2023.csv")
|
| 351 |
smiles_index = 0 # Because smiles is in the first column
|
| 352 |
realistic = realistic_split(HematoxLong2023.copy(), smiles_index, 0.75, split_for_exact_frac=True, cluster_method="Auto")
|
| 353 |
realistic_train, realistic_test = split_df_into_train_and_test_sets(realistic)
|
| 354 |
|
| 355 |
-
#
|
| 356 |
|
| 357 |
selected_columns = realistic_train[['new SMILES', 'Label']]
|
| 358 |
selected_columns.to_csv("HematoxLong2023_train.csv", index=False)
|
|
|
|
| 347 |
test = df[df['group'] == 'testing']
|
| 348 |
return train, test
|
| 349 |
|
| 350 |
+
# 8. Test and train datasets have been made
|
| 351 |
+
|
| 352 |
HematoxLong2023=pd.read_csv("Long2023.csv")
|
| 353 |
smiles_index = 0 # Because smiles is in the first column
|
| 354 |
realistic = realistic_split(HematoxLong2023.copy(), smiles_index, 0.75, split_for_exact_frac=True, cluster_method="Auto")
|
| 355 |
realistic_train, realistic_test = split_df_into_train_and_test_sets(realistic)
|
| 356 |
|
| 357 |
+
#9. Select columns and name the datasets
|
| 358 |
|
| 359 |
selected_columns = realistic_train[['new SMILES', 'Label']]
|
| 360 |
selected_columns.to_csv("HematoxLong2023_train.csv", index=False)
|