Menu

Separating Features and Target Variable

Separating Features and Target Variable

Machine learning models require the input features and target variable to be separated.

Code

X = credit_card_data.drop(columns='Class', axis=1)

Y = credit_card_data['Class']

Explanation

Here:

  • X contains all transaction features.
  • Y contains the target labels indicating whether a transaction is genuine or fraudulent.