Skip to content

Commit

Permalink
Fix extraction of column names
Browse files Browse the repository at this point in the history
  • Loading branch information
AVHopp committed Dec 9, 2024
1 parent e3805bf commit d01cf5c
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions baybe/utils/chemistry.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,10 +149,15 @@ def smiles_to_fingerprint_features(
)
name = f"{encoding.name}_"
prefix = prefix + "_" if prefix else ""
col_names = [
prefix + name + f.split("fingerprint")[1]
for f in fingerprint_encoder.get_feature_names_out()
]
if all("fingerprint" in f for f in fingerprint_encoder.get_feature_names_out):
col_names = [
prefix + name + f.split("fingerprint")[1]
for f in fingerprint_encoder.get_feature_names_out()
]
else:
col_names = [
prefix + name + f for f in fingerprint_encoder.get_feature_names_out()
]
df = pd.DataFrame(features, columns=col_names, dtype=DTypeFloatNumpy)

return df
Expand Down

0 comments on commit d01cf5c

Please sign in to comment.