Understanding HOPV Stability

Open In Colab

Explore the HOPV_stability.csv dataset. You can find it under data/001_raw_data.

Working in Colab? The repository’s data/ folder is not available there. Download the file into your Colab session first, then use "HOPV_stability.csv" as the path: !wget -q https://raw.githubusercontent.com/BredaUniversityADSAI/introduction-to-ml/main/data/001_raw_data/HOPV_stability.csv

# IMPORT WHAT YOU NEED HERE

Your Turn

Read HOPV_stability.csv and print the first 10 lines. This lets us take a first look at the raw text and get a sense of the file’s structure before we start parsing it.

Note:

Do not use pandas yet, open with pure Python as follows.

with open(raw_data_path, "r") as f:
    lines = f.readlines()
# YOUR CODE HERE

Your Turn

This dataset already has the structure we need, each row represents a single molecule with two values: its SMILES string and its stability, separated by commas. Unlike HOPV_homolumo.data, this file is ready to use without additional parsing. Pandas can read properly formatted CSV files directly, so go ahead and load this dataset into a Pandas DataFrame.

# YOUR CODE HERE

Your Turn

Count missing values for each column.

# YOUR CODE HERE

Your Turn

Check whether there are duplicate values in the smiles column. If duplicates exist, print each repeated SMILES string along with the number of times it appears.

# YOUR CODE HERE

Your Turn

stability column is our target for classification. Check how many classes we have and their distribution.

# YOUR CODE HERE

Your Turn

Discuss the following questions with your peers:

  1. Are there any duplicate SMILES? How should duplicate entries be handled during data preparation?
  2. Is the stability target balanced across classes? What are the potential implications if it is not?
  3. Are there any missing values? What strategies could be used to handle them?