Test Your Setup

WISE Workshop | Addis Ababa, Feb 2026

Run all cells in this notebook to verify your Google Colab environment is working correctly.

Step 1: Check Python Version

import sys
print(f"Python version: {sys.version}")
print(f"Running in: {'Google Colab' if 'google.colab' in sys.modules else 'Local Environment'}")

Step 2: Check Required Packages

import pandas as pd
import numpy as np
import sklearn
import matplotlib.pyplot as plt
import seaborn as sns

print(f"pandas: {pd.__version__}")
print(f"numpy: {np.__version__}")
print(f"scikit-learn: {sklearn.__version__}")
print(f"matplotlib: {plt.matplotlib.__version__}")
print(f"seaborn: {sns.__version__}")
print("\n✅ All packages installed successfully!")

Step 3: Test Data Loading

# Create a simple test dataset
test_data = pd.DataFrame({
    'facility': ['A', 'B', 'C', 'A', 'B', 'C'],
    'month': [1, 1, 1, 2, 2, 2],
    'demand': [100, 150, 80, 110, 160, 75]
})

print("Test dataset:")
display(test_data)
print(f"\n✅ Data loading works! Shape: {test_data.shape}")

Step 4: Test Visualization

plt.figure(figsize=(8, 4))
sns.barplot(data=test_data, x='facility', y='demand', hue='month')
plt.title('Test Visualization')
plt.xlabel('Facility')
plt.ylabel('Demand')
plt.legend(title='Month')
plt.tight_layout()
plt.show()
print("\n✅ Visualization works!")

Step 5: Test Machine Learning

from sklearn.ensemble import RandomForestRegressor
from sklearn.model_selection import train_test_split

# Simple ML test
X = np.random.rand(100, 3)
y = X[:, 0] + 2*X[:, 1] + np.random.normal(0, 0.1, 100)

X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2)

model = RandomForestRegressor(n_estimators=10, random_state=42)
model.fit(X_train, y_train)
score = model.score(X_test, y_test)

print(f"Model R² score: {score:.3f}")
print("\n✅ Machine learning works!")

All Tests Complete!

If you see ✅ for all steps above, your environment is ready for the workshop.

Next steps: 1. Save a copy to your Google Drive (File > Save a copy in Drive) 2. See you at the workshop!