AI-GENERATED CONTENT — PUBLISHED AS IS. This lesson derives its topic and questions from source posts on Open Education (Sayed Ahmed credited where indicated). Newly AI-generated instructional text, original example code, and synthetic plots are offered for reuse without copyright restrictions asserted by this blog. Other linked material retains its respective rights. AI can make mistakes; verify technical claims and outputs.
Advanced Data Visualization – 001 course index · Source articles: Post 16135 · Post 26191 · Post 16051 · Post 76547
Learning focus. Hierarchical data has nested parent–child structure. The site’s hierarchy resources discuss organizational trees, radial and indented trees, treemaps, dendrograms, and hierarchical edge bundling.

Theory and design considerations
A treemap tiles nested rectangles with area proportional to a nonnegative value; equal-looking colour shades must not replace precise area labels. Sunbursts encode hierarchy with nested sectors, but comparisons across rings are less direct.
Dendrogram height shows the linkage distance or dissimilarity at which clusters merge. Single linkage uses minimum pairwise distance, complete linkage maximum and average linkage an average; scaling and distance definitions change results.
Mathematical model
A tree with n vertices has n−1 edges. For single-linkage clustering, d(A,B)=min{d(a,b):a∈A,b∈B}; complete linkage uses max instead.
Python implementation and plotted output
import numpy as np, matplotlib.pyplot as plt
from scipy.cluster.hierarchy import linkage,dendrogram
from matplotlib.patches import Rectangle
X=np.array([[1,2],[1.3,1.7],[6,6],[6.2,5.9],[9,1]])
Z=linkage(X,method="average",metric="euclidean")
fig,axes=plt.subplots(1,2,figsize=(10,4))
dendrogram(Z,labels=list("ABCDE"),ax=axes[0])
axes[0].set(title="Dendrogram",ylabel="Merge distance")
sizes=[40,30,20,10]
left=0
for s,name in zip(sizes,list("ABCD")):
axes[1].add_patch(Rectangle((left,0),s,1,alpha=.5))
axes[1].text(left+s/2,.5,f"{name}: {s}",ha="center")
left+=s
axes[1].set(xlim=(0,100),ylim=(0,1),title="One-row area treemap")
axes[1].axis("off");plt.tight_layout();plt.show()
R implementation and plotted output
set.seed(1)
x <- matrix(c(1,2,1.3,1.7,6,6,6.2,5.9,9,1),
ncol=2,byrow=TRUE)
hc <- hclust(dist(x),method="average")
plot(hc,main="Hierarchical clustering",
xlab="Objects",ylab="Merge distance")
# Simple proportional rectangles as a one-row treemap
sizes <- c(A=40,B=30,C=20,D=10)
plot(0,0,type="n",xlim=c(0,100),ylim=c(0,1),
axes=FALSE,xlab="",ylab="",main="Treemap areas")
left <- 0
for(i in seq_along(sizes)){
rect(left,0,left+sizes[i],1,col=rainbow(4)[i])
text(left+sizes[i]/2,.5,paste(names(sizes)[i],sizes[i]))
left <- left+sizes[i]
}
Expected output
The five objects form tight pairs near (1,2) and (6,6). The dendrogram shows their merger order, while the rectangular area chart displays A=40%, B=30%, C=20%, D=10%. The one-row layout is illustrative, not a squarified treemap algorithm.
Questions with answers
Q1. How is a dendrogram different from a tree diagram?
Answer. A dendrogram depicts clustering merge distances; a general tree diagram can show any parent–child structure without numerical heights.
Q2. What must a treemap area mean?
Answer. A documented nonnegative size variable; colour may separately encode category or another measure.
Q3. Can a dendrogram prove the ‘true’ number of clusters?
Answer. No. A cut height and clustering assumptions determine a partition; validate with context and stability.
Assessment and practical assignment
Compare average and complete linkage on the same input. Draw a treemap for one nested organizational budget and label every area.
Translated to Bengali / বাংলায় অনুবাদ
বাংলা অনুবাদ: ওপরের পাঠের ব্যাখ্যা, গাণিতিক ধারণা, ফল ও প্রশ্নোত্তরের সহজ কিন্তু যথাযথ বাংলা অনুবাদ নিচে দেওয়া হয়েছে। কোডের ভাষা Python, R ও JavaScript অপরিবর্তিত রাখা হয়েছে।
পাঠের উদ্দেশ্য: স্তরভিত্তিক উপাত্তে পিতা–সন্তান ধরনের সম্পর্ক থাকে। সাইটের মূল উৎসে সাংগঠনিক বৃক্ষ, ট্রিম্যাপ, ডেনড্রোগ্রাম ও স্তরভিত্তিক লিংক-চিত্র আলোচনা করা হয়েছে।
ট্রিম্যাপে আয়তক্ষেত্রের ক্ষেত্রফল অঋণাত্মক মানের সমানুপাতে হয়। সানবার্স্টে বৃত্তাকার স্তর ব্যবহার করা হয়, তবে বিভিন্ন বলয়ের ক্ষেত্রফল তুলনা কঠিন।
ডেনড্রোগ্রামের উচ্চতা দেখায় কত দূরত্ব বা ভিন্নতার পর্যায়ে দুটি দল যুক্ত হয়েছে। সিঙ্গল লিংকেজ ন্যূনতম, কমপ্লিট সর্বোচ্চ এবং অ্যাভারেজ গড় দূরত্ব ব্যবহার করে।
গণিত: n নোডের বৃক্ষে n−1 প্রান্ত থাকে। সিঙ্গল লিংকেজে d(A,B)=min d(a,b), আর কমপ্লিট লিংকেজে সর্বোচ্চ দূরত্ব নেওয়া হয়।
প্রত্যাশিত ফল: পাঁচটি বিন্দুর মধ্যে (১,২) ও (৬,৬)-এর কাছে জোড়া তৈরি হয়। ডেনড্রোগ্রামে যুক্ত হওয়ার ক্রম দেখা যায়; আয়তক্ষেত্রের ক্ষেত্রফল A=৪০%, B=৩০%, C=২০%, D=১০%। এটি শিক্ষণমূলক এক-সারি ট্রিম্যাপ।
প্রশ্ন 1. ডেনড্রোগ্রাম ও সাধারণ বৃক্ষচিত্রের পার্থক্য কী?
উত্তর: ডেনড্রোগ্রামে দলগুলো কত দূরত্বে যুক্ত হয় তা দেখায়; সাধারণ বৃক্ষচিত্রে শুধু স্তরভিত্তিক সম্পর্ক থাকতে পারে।
প্রশ্ন 2. ট্রিম্যাপের ক্ষেত্রফল কী বোঝাবে?
উত্তর: একটি নির্দিষ্ট অঋণাত্মক পরিমাণ; রং অন্য চলক দেখাতে পারে।
প্রশ্ন 3. ডেনড্রোগ্রাম কি প্রকৃত ক্লাস্টারের সংখ্যা প্রমাণ করে?
উত্তর: না। কাটার উচ্চতা ও পদ্ধতির অনুমান ফল বদলায়; প্রেক্ষাপট দিয়ে যাচাই করতে হয়।
বাংলা অনুশীলন
একই উপাত্তে অ্যাভারেজ ও কমপ্লিট লিংকেজ তুলনা করুন। সাংগঠনিক বাজেটের একটি ট্রিম্যাপ বানিয়ে সব ক্ষেত্রফল লেবেল করুন।
মূল উৎসের লিংক পোস্টের শুরুতে দেওয়া আছে। এআই-তৈরি নতুন লেখা ও মৌলিক নমুনা-চিত্র পুনর্ব্যবহারে এই ব্লগ থেকে কপিরাইটের দাবি করা হচ্ছে না; তৃতীয় পক্ষের অধিকার পৃথক। এআই ভুল করতে পারে—যাচাই করুন।
Discover more from Open Education
Subscribe to get the latest posts sent to your email.
