<style>
.mushroom-page * { box-sizing: border-box; }
.mushroom-page h1, .mushroom-page h2, .mushroom-page h3, .mushroom-page h4, .mushroom-page h5, .mushroom-page h6, .mushroom-page p, .mushroom-page ul, .mushroom-page ol, .mushroom-page li, .mushroom-page pre, .mushroom-page blockquote, .mushroom-page table, .mushroom-page td, .mushroom-page th { margin: 0; padding: 0; }
.mushroom-page {
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
color: var(--el-text-color-primary);
background: var(--el-bg-color);
line-height: 1.6;
}
.mushroom-page a { text-decoration: none; color: inherit; }
.mushroom-page a:hover { text-decoration: none; }
.mushroom-page ul { list-style: none; }
.markdown-body .mushroom-page a { color: inherit !important; text-decoration: none !important; }
.markdown-body .mushroom-page a:hover { text-decoration: none !important; }
.markdown-body .mushroom-page a.s-btn-primary,
.markdown-body .mushroom-page a.btn-cta-light { color: #ffffff !important; }
.markdown-body .mushroom-page a.s-btn-secondary { color: var(--el-text-color-primary) !important; }
.markdown-body .mushroom-page a.btn-cta-ghost { color: #94a3b8 !important; }
.markdown-body .mushroom-page a.btn-cta-ghost:hover { color: #e2e8f0 !important; }
.markdown-body .mushroom-page h1, .markdown-body .mushroom-page h2 { border-bottom: none !important; padding-bottom: 0 !important; }
.mushroom-page .s-container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.mushroom-page .s-container-narrow { max-width: 800px; margin: 0 auto; padding: 0 24px; }
.mushroom-page .s-container-wide { max-width: 1100px; margin: 0 auto; padding: 0 32px; }
.mushroom-page .s-section { padding: 80px 0; }
.mushroom-page .s-section-lg { padding: 100px 0; }
.mushroom-page .s-section-sm { padding: 48px 0; }
.mushroom-page .s-bg-white { background: var(--el-bg-color); }
.mushroom-page .s-bg-gray { background: var(--el-bg-color-page); }
.mushroom-page .s-bg-dark { background: #0f172a; color: #f8fafc; }
.mushroom-page .s-header { text-align: center; margin-bottom: 64px; }
.mushroom-page .s-header h2 {
font-size: clamp(28px, 4vw, 40px);
font-weight: 700;
color: var(--el-text-color-primary);
letter-spacing: normal;
margin-bottom: 20px;
line-height: 1.15;
}
.mushroom-page .s-header p {
font-size: clamp(16px, 2vw, 18px);
color: var(--el-text-color-regular);
max-width: 640px;
margin: 0 auto;
line-height: 1.6;
}
.mushroom-page .s-bg-dark .s-header h2 { color: #f8fafc; }
.mushroom-page .s-bg-dark .s-header p { color: var(--el-text-color-secondary); }
.mushroom-page .s-btn-primary {
display: inline-flex; align-items: center; gap: 6px;
padding: 14px 28px;
background: #16a34a; color: #ffffff !important;
border-radius: 9999px; font-size: 15px; font-weight: 600;
transition: background 0.2s, transform 0.15s;
border: none; cursor: pointer;
text-decoration: none !important;
}
.mushroom-page .s-btn-primary:hover { background: #15803d; transform: translateY(-1px); text-decoration: none !important; }
.mushroom-page .s-btn-secondary {
display: inline-flex; align-items: center; gap: 6px;
padding: 14px 28px;
background: var(--el-bg-color); color: var(--el-text-color-primary) !important;
border: 1px solid var(--el-border-color-light);
border-radius: 9999px; font-size: 15px; font-weight: 600;
transition: border-color 0.2s, background 0.2s;
cursor: pointer;
text-decoration: none !important;
}
.mushroom-page .s-btn-secondary:hover { background: var(--el-bg-color-page); text-decoration: none !important; }
.mushroom-hero {
padding: 100px 0 80px;
text-align: center;
background: var(--el-bg-color);
position: relative;
overflow: hidden;
}
.mushroom-hero::before {
content: '';
position: absolute;
top: -200px; left: 50%;
transform: translateX(-50%);
width: 900px; height: 500px;
background: radial-gradient(ellipse, rgba(22, 163, 74, 0.06) 0%, transparent 70%);
pointer-events: none;
}
.mushroom-page .hero-badge {
display: inline-flex; align-items: center; gap: 8px;
padding: 6px 16px;
background: var(--el-bg-color-page); border: 1px solid var(--el-border-color-light);
border-radius: 9999px; font-size: 13px; font-weight: 600; color: var(--el-text-color-regular);
margin-bottom: 28px;
}
.mushroom-page .hero-badge .badge-dot {
width: 6px; height: 6px; background: #10b981; border-radius: 50%;
display: inline-block;
}
.mushroom-hero h1 {
font-size: clamp(36px, 5vw, 60px);
font-weight: 700; line-height: 1.05;
letter-spacing: normal; color: var(--el-text-color-primary);
margin-bottom: 20px;
position: relative;
}
.mushroom-hero h1 span { color: #16a34a; }
.mushroom-page .hero-subtitle {
font-size: clamp(16px, 2vw, 20px);
color: var(--el-text-color-regular); line-height: 1.6;
max-width: 620px; margin: 0 auto 56px;
position: relative;
}
.mushroom-page .hero-actions {
display: flex; gap: 12px; justify-content: center;
flex-wrap: wrap; margin-bottom: 56px; position: relative;
}
.mushroom-page .hero-highlights {
display: flex; align-items: center; justify-content: center;
gap: 16px; flex-wrap: wrap; position: relative;
}
.mushroom-page .hero-highlights .h-item { font-size: 14px; color: var(--el-text-color-regular); font-weight: 500; }
.mushroom-page .hero-highlights .h-div { width: 1px; height: 16px; background: var(--el-border-color-light); }
@media (max-width: 640px)
{ .mushroom-page .hero-highlights .h-div { display: none; } .mushroom-page .hero-highlights { gap: 8px 16px; } .mushroom-page .hero-actions { flex-direction: column; align-items: center; } .mushroom-page .hero-actions a { width: 100%; max-width: 280px; justify-content: center; } } .mushroom-page .hero-cover { max-width: 720px; margin: 48px auto 0; border-radius: 16px; overflow: hidden; box-shadow: 0 8px 32px rgba(0,0,0,0.10); } .mushroom-page .hero-cover img { width: 100%; height: auto; display: block; } .mushroom-stats { padding: 48px 0; background: var(--el-bg-color-page); border-top: 1px solid var(--el-border-color-lighter); border-bottom: 1px solid var(--el-border-color-lighter); } .mushroom-page .stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px; text-align: center; } .mushroom-page .stat-icon { font-size: 28px; margin-bottom: 12px; } .mushroom-page .stat-val { font-size: clamp(28px, 4vw, 40px); font-weight: 700; color: var(--el-text-color-primary); letter-spacing: normal; margin-bottom: 4px; } .mushroom-page .stat-lbl { font-size: 14px; color: var(--el-text-color-secondary); font-weight: 500; } @media (max-width: 768px) { .mushroom-page .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 24px; } } @media (max-width: 480px) { .mushroom-page .stats-grid { grid-template-columns: 1fr; gap: 20px; } } .mushroom-page .features-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; } .mushroom-page .feat-card { padding: 32px 28px; border: none; border-radius: 20px; box-shadow: 0 2px 12px 0 rgba(0,0,0,0.08); background: var(--el-bg-color); transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s; } .mushroom-page .feat-card:hover { box-shadow: 0 8px 24px 0 rgba(0,0,0,0.12); transform: translateY(-2px); } .mushroom-page .feat-icon { font-size: 32px; margin-bottom: 16px; } .mushroom-page .feat-card h3 { font-size: 18px; font-weight: 700; color: var(--el-text-color-primary); margin-bottom: 8px; } .mushroom-page .feat-card p { font-size: 15px; color: var(--el-text-color-regular); line-height: 1.6; } @media (max-width: 1024px) { .mushroom-page .features-grid { grid-template-columns: repeat(2, 1fr); } } @media (max-width: 640px) { .mushroom-page .features-grid { grid-template-columns: 1fr; } } .mushroom-page .usecases-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; } .mushroom-page .uc-card { padding: 28px 24px; background: var(--el-bg-color); border: none; border-radius: 20px; box-shadow: 0 2px 12px 0 rgba(0,0,0,0.08); text-align: center; transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s; } .mushroom-page .uc-card:hover { box-shadow: 0 8px 24px 0 rgba(0,0,0,0.12); transform: translateY(-2px); } .mushroom-page .uc-icon { font-size: 36px; margin-bottom: 16px; } .mushroom-page .uc-card h3 { font-size: 17px; font-weight: 700; color: var(--el-text-color-primary); margin-bottom: 8px; } .mushroom-page .uc-card p { font-size: 14px; color: var(--el-text-color-regular); line-height: 1.6; } @media (max-width: 1024px) { .mushroom-page .usecases-grid { grid-template-columns: repeat(2, 1fr); } } @media (max-width: 480px) { .mushroom-page .usecases-grid { grid-template-columns: 1fr; } } .mushroom-page .code-wrap { border-radius: 16px !important; overflow: hidden !important; border: 1px solid #334155 !important; background: #0f172a !important; max-width: 860px; margin: 0 auto; } .markdown-body .mushroom-page .code-wrap { border-radius: 16px !important; overflow: hidden !important; border: 1px solid #334155 !important; background: #0f172a !important; } .mushroom-page .code-bar { display: flex !important; align-items: center !important; justify-content: space-between !important; padding: 12px 20px !important; background: #1e293b !important; border-bottom: 1px solid #334155 !important; } .mushroom-page .code-dots { display: flex; gap: 6px; } .mushroom-page .code-dots i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; } .mushroom-page .code-dots .r { background: #ef4444; } .mushroom-page .code-dots .y { background: #f59e0b; } .mushroom-page .code-dots .g { background: #10b981; } .mushroom-page .code-lang { font-size: 12px; color: var(--el-text-color-secondary); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; } .mushroom-page .code-block { padding: 24px !important; margin: 0 !important; overflow-x: auto !important; font-family: 'JetBrains Mono', 'Fira Code', 'SF Mono', monospace !important; font-size: 13.5px !important; line-height: 1.7 !important; color: #e2e8f0 !important; white-space: pre !important; background: transparent !important; border: none !important; border-radius: 0 !important; } .markdown-body .mushroom-page .code-block { padding: 24px !important; margin: 0 !important; overflow-x: auto !important; font-family: 'JetBrains Mono', 'Fira Code', 'SF Mono', monospace !important; font-size: 13.5px !important; line-height: 1.7 !important; color: #e2e8f0 !important; white-space: pre !important; background: transparent !important; border: none !important; border-radius: 0 !important; } .mushroom-page .steps-row { display: flex; align-items: flex-start; justify-content: center; margin-bottom: 48px; } .mushroom-page .stp-card { flex: 1; max-width: 320px; text-align: center; padding: 0 24px; } .mushroom-page .stp-num { font-size: clamp(48px, 6vw, 72px); font-weight: 700; color: #e2e8f0; letter-spacing: -0.04em; line-height: 1; margin-bottom: 20px; } .mushroom-page .stp-card h3 { font-size: 18px; font-weight: 700; color: var(--el-text-color-primary); margin-bottom: 10px; } .mushroom-page .stp-card p { font-size: 15px; color: var(--el-text-color-regular); line-height: 1.6; } .mushroom-page .stp-conn { width: 60px; height: 2px; background: var(--el-border-color-light); margin-top: 36px; flex-shrink: 0; } .mushroom-page .steps-cta { text-align: center; } @media (max-width: 768px) { .mushroom-page .steps-row { flex-direction: column; align-items: center; gap: 32px; } .mushroom-page .stp-conn { width: 2px; height: 32px; margin: 0; } .mushroom-page .stp-card { max-width: 100%; } } .mushroom-cta { padding: 100px 0; background: #0f172a; text-align: center; position: relative; overflow: hidden; } .mushroom-cta::before { content: ''; position: absolute; top: -100px; left: 50%; transform: translateX(-50%); width: 700px; height: 400px; background: radial-gradient(ellipse, rgba(22, 163, 74, 0.12) 0%, transparent 70%); pointer-events: none; } .mushroom-cta h2 { font-size: clamp(28px, 4vw, 44px); font-weight: 700; color: #f8fafc; letter-spacing: normal; margin-bottom: 28px; position: relative; } .mushroom-cta > div > p { font-size: clamp(16px, 2vw, 18px); color: var(--el-text-color-secondary); max-width: 520px; margin: 0 auto 56px; line-height: 1.6; position: relative; } .mushroom-page .cta-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; position: relative; } .mushroom-page .btn-cta-light { display: inline-flex; align-items: center; gap: 6px; padding: 14px 32px; background: #16a34a; color: #ffffff !important; border-radius: 9999px; font-size: 15px; font-weight: 700; transition: background 0.2s, transform 0.15s; text-decoration: none !important; } .mushroom-page .btn-cta-light:hover { background: #15803d; transform: translateY(-1px); text-decoration: none !important; } .mushroom-page .btn-cta-ghost { display: inline-flex; align-items: center; padding: 14px 32px; background: transparent; color: #94a3b8 !important; border: 1px solid #334155; border-radius: 9999px; font-size: 15px; font-weight: 600; transition: border-color 0.2s, color 0.2s; text-decoration: none !important; } .mushroom-page .btn-cta-ghost:hover { border-color: var(--el-text-color-regular); color: #e2e8f0 !important; text-decoration: none !important; } .mushroom-page code { background: #f0fdf4 !important; padding: 2px 8px !important; border-radius: 5px !important; font-size: 13px !important; font-family: 'JetBrains Mono', 'Fira Code', 'SF Mono', monospace !important; color: #15803d !important; border: 1px solid #f0fdf4 !important; } .mushroom-page .s-text-dark { color: var(--el-text-color-primary); } .mushroom-page .s-text-brand { color: #16a34a; } .mushroom-page .s-section-body { font-size: 16px; color: var(--el-text-color-regular); line-height: 1.8; text-align: center; max-width: 680px; margin: 0 auto; } .mushroom-page .s-section-body p + p { margin-top: 16px; } .mushroom-page .tag-row { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 16px; } .mushroom-page .tag-item
{
padding: 4px 12px; background: var(--el-bg-color-page);
border: 1px solid var(--el-border-color-light); border-radius: 9999px;
font-size: 12px; font-weight: 600; color: var(--el-text-color-regular);
}
html.dark .mushroom-page { background: var(--el-bg-color); color: var(--el-text-color-primary); }
html.dark .mushroom-page a { color: inherit; }
html.dark .markdown-body .mushroom-page a { color: inherit !important; }
html.dark .markdown-body .mushroom-page a.s-btn-primary,
html.dark .markdown-body .mushroom-page a.btn-cta-light { color: #ffffff !important; }
html.dark .markdown-body .mushroom-page a.s-btn-secondary { color: var(--el-text-color-primary) !important; }
html.dark .markdown-body .mushroom-page a.btn-cta-ghost { color: #94a3b8 !important; }
html.dark .markdown-body .mushroom-page a.btn-cta-ghost:hover { color: var(--el-text-color-primary) !important; }
html.dark .mushroom-page .s-bg-white { background: var(--el-bg-color); }
html.dark .mushroom-page .s-bg-gray { background: var(--el-bg-color-page); }
html.dark .mushroom-page .s-bg-dark { background: var(--el-bg-color); }
html.dark .mushroom-page .s-header h2 { color: var(--el-text-color-primary); }
html.dark .mushroom-page .s-header p { color: var(--el-text-color-secondary); }
html.dark .mushroom-page .s-btn-primary { background: #16a34a; color: #ffffff !important; }
html.dark .mushroom-page .s-btn-primary:hover { background: #15803d; }
html.dark .mushroom-page .s-btn-secondary {
background: #1e293b; color: var(--el-text-color-primary) !important;
border-color: #475569;
}
html.dark .mushroom-page .s-btn-secondary:hover { background: var(--el-border-color); border-color: var(--el-text-color-regular); }
html.dark .mushroom-hero { background: var(--el-bg-color); }
html.dark .mushroom-hero::before {
background: radial-gradient(ellipse, rgba(22, 163, 74, 0.15) 0%, transparent 70%);
}
html.dark .mushroom-page .hero-badge { background: var(--el-bg-color-page); border-color: var(--el-border-color); color: var(--el-text-color-secondary); }
html.dark .mushroom-hero h1 { color: var(--el-text-color-primary); }
html.dark .mushroom-hero h1 span { color: #86efac; }
html.dark .mushroom-page .hero-subtitle { color: var(--el-text-color-secondary); }
html.dark .mushroom-page .hero-highlights .h-item { color: var(--el-text-color-secondary); }
html.dark .mushroom-page .hero-highlights .h-div { background: var(--el-border-color); }
html.dark .mushroom-stats { background: var(--el-bg-color-page); border-color: var(--el-border-color); }
html.dark .mushroom-page .stat-val { color: var(--el-text-color-primary); }
html.dark .mushroom-page .stat-lbl { color: var(--el-text-color-regular); }
html.dark .mushroom-page .feat-card {
background: var(--el-bg-color-page); border-color: var(--el-border-color);
}
html.dark .mushroom-page .feat-card:hover { border-color: var(--el-text-color-regular); box-shadow: 0 4px 16px rgba(0,0,0,0.3); }
html.dark .mushroom-page .feat-card h3 { color: var(--el-text-color-primary); }
html.dark .mushroom-page .feat-card p { color: var(--el-text-color-secondary); }
html.dark .mushroom-page .uc-card { background: var(--el-bg-color-page); border-color: var(--el-border-color); }
html.dark .mushroom-page .uc-card:hover { border-color: var(--el-text-color-regular); box-shadow: 0 4px 16px rgba(0,0,0,0.3); }
html.dark .mushroom-page .uc-card h3 { color: var(--el-text-color-primary); }
html.dark .mushroom-page .uc-card p { color: var(--el-text-color-secondary); }
html.dark .mushroom-page .stp-num { color: #334155; }
html.dark .mushroom-page .stp-card h3 { color: var(--el-text-color-primary); }
html.dark .mushroom-page .stp-card p { color: var(--el-text-color-secondary); }
html.dark .mushroom-page .stp-conn { background: var(--el-border-color); }
html.dark .mushroom-page code {
background: #052e16 !important; color: #bbf7d0 !important; border-color: #16a34a !important;
}
html.dark .mushroom-page .s-text-dark { color: var(--el-text-color-primary); }
html.dark .mushroom-page .s-text-brand { color: #86efac; }
html.dark .mushroom-page .s-section-body { color: var(--el-text-color-secondary); }
html.dark .mushroom-page .tag-item { background: var(--el-border-color); border-color: var(--el-text-color-regular); color: var(--el-text-color-secondary); }
html.dark .mushroom-cta { background: #020617; }
html.dark .mushroom-cta::before {
background: radial-gradient(ellipse, rgba(22, 163, 74, 0.2) 0%, transparent 70%);
}
html.dark .mushroom-page .btn-cta-light { color: #ffffff !important; }
html.dark .mushroom-page .btn-cta-ghost { color: #94a3b8 !important; }
html.dark .mushroom-page .btn-cta-ghost:hover { color: var(--el-text-color-primary) !important; }
</style>
<div class="mushroom-page">
<section class="mushroom-hero">
<div class="s-container-narrow">
<div class="hero-badge">
<span class="badge-dot"></span>
Mushroom Dataset
</div>
<h1>
Mushroom Classification<br/><span>Dataset</span>
</h1>
<p class="hero-subtitle">
The classic mushroom dataset from the UCI Machine Learning Repository, containing 8,124 samples and 22 classification features, used to determine whether mushrooms are edible or poisonous, is a standard introductory dataset for classification learning.
Dataset Highlights
A pure classification feature dataset, suitable for learning decision trees and rule mining
Intuitive classification task
Determine whether a mushroom is edible or poisonous, with results that are intuitive and meaningful.
Pure classification features
All 22 features are categorical variables (cap shape, color, odor, etc.), suitable for practicing one-hot encoding and label encoding.
Decision tree friendly
Classification features make it an ideal dataset for learning decision trees, random forests, and rule learning algorithms.
Ample samples
8,124 samples provide sufficient data, with a relatively balanced distribution of edible and poisonous categories.
Feature analysis
Single features like odor can achieve near-perfect classification, suitable for exploring feature importance.
UCI authoritative source
Originating from the UCI Machine Learning Repository, a classic binary classification dataset widely cited in academia.
Applicable Scenarios
Valuable from beginner learning to advanced feature analysis
Decision tree learning
Pure classification features are very suitable for learning decision trees, CART, and rule learning algorithms
Binary classification modeling
Classify edible/poisonous using algorithms like Naive Bayes, logistic regression, SVM, etc.
Feature selection
Discover the strong predictive power of key features like odor, practice information gain and chi-squared tests
Data encoding
Practice one-hot encoding, label encoding, and target encoding techniques for categorical variables
Data Preview
Below are the first few rows of the mushroom dataset (all features are single-letter encoded)
class,cap_shape,cap_surface,cap_color,bruises,odor,gill_attachment,...,habitat p,x,s,n,t,p,f,c,n,k,e,e,s,s,w,w,p,w,o,p,k,s,u e,x,s,y,t,a,f,c,b,k,e,c,s,s,w,w,p,w,o,p,n,n,g e,b,s,w,t,l,f,c,b,n,e,c,s,s,w,w,p,w,o,p,n,n,m p,x,y,w,t,p,f,c,n,n,e,e,s,s,w,w,p,w,o,p,k,s,u e,x,s,g,f,n,f,w,b,k,t,e,s,s,w,w,p,w,o,e,n,a,g
3 Steps to Get Started Quickly
From browsing to analysis, you can start your data science project in minutes
Browse the dataset
View dataset details on the Ace Data Cloud platform, including field descriptions, sample size, and license agreement metadata.
Download the data
Download the CSV file (374 KB), data is ready to use without additional cleaning.
Load and analyze
Use pandas.read_csv() to load the data, along with pd.get_dummies() to encode categorical features.
Start exploring mushroom classification data
A classic classification dataset with an open license, available for immediate download. The pure classification feature design makes it the best introductory dataset for decision trees and rule learning.
