Files
ExplainableAI/extracted_cells/cell10.py

11 lines
429 B
Python

# Features und Zielwerte definieren
X = df_encoded.drop(['income', 'income_encoded'], axis=1)
y = df_encoded['income_encoded']
# Daten in Trainings- und Testdaten aufteilen
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42, stratify=y)
print(f"Trainingsdaten: {X_train.shape[0]} Beispiele")
print(f"Testdaten: {X_test.shape[0]} Beispiele")
print(f"Features: {X_train.shape[1]} Merkmale")