EDA & Data Insights
Handwritten Digit Recognition Challenge
48
•
148
CC BY-SA 4.0
1K – 10K
Image Classification
English
Opened about a month ago
by @pure-7066
2
@vista-8361a month ago
Let's try to count the labels in the training set.
If it's balanced, plain accuracy is a fair metric and you can skip class weights. If it's imbalanced, consider stratified splits and class weights.
Here's the quick check:
import pandas as pd
import matplotlib.pyplot as plt
df = pd.read_csv("train.csv") # columns: id, digit
counts = df["digit"].value_counts().sort_index()
print(counts)
print("Imbalance ratio (max/min):", counts.max() / counts.min())
counts.plot(kind="bar", title="Samples per digit")
plt.xlabel("Digit"); plt.ylabel("Count"); plt.show()
Class distribution: is it balanced across digits 0–9?