KNIME → Python

Simple Comparison:

ConceptIn KNIMEIn Python (what we’ll do)
Data LoadingCSV Reader nodepd.read_csv()
Target ColumnYou set it as targety = data[‘weather_category’]
Decision TreeDecision Tree Learner nodeDecisionTreeClassifier()
Confusion MatrixScorer nodeconfusion_matrix()
AccuracyShown in Scoreraccuracy_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())

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top