Simple Comparison:
| Concept | In KNIME | In Python (what we’ll do) |
|---|---|---|
| Data Loading | CSV Reader node | pd.read_csv() |
| Target Column | You set it as target | y = data[‘weather_category’] |
| Decision Tree | Decision Tree Learner node | DecisionTreeClassifier() |
| Confusion Matrix | Scorer node | confusion_matrix() |
| Accuracy | Shown in Scorer | accuracy_score() |
1. Load the data (same as CSV Reader in KNIME)
df = pd.read_csv(‘city-weather.csv’)
2. See basic info about data
print(“Shape of data:”, df.shape)
print(“\nColumns:”, df.columns.tolist())
3. See what we are predicting
print(“\nWeather Categories:”)
print(df[‘weather_category’].value_counts())