<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>EDA - 태그 - lee's blog</title><link>http://ken-0913.github.io/myblog/tags/eda/</link><description>EDA - 태그 - lee's blog</description><generator>Hugo -- gohugo.io</generator><language>ko-kr</language><managingEditor>hyeonjae0913@gmail.com (ken-0913)</managingEditor><webMaster>hyeonjae0913@gmail.com (ken-0913)</webMaster><lastBuildDate>Thu, 29 Oct 2026 18:00:00 +0900</lastBuildDate><atom:link href="http://ken-0913.github.io/myblog/tags/eda/" rel="self" type="application/rss+xml"/><item><title>MLPE 스터디 2주차 - Ch4.1 더 해 보기: EDA 막대그래프 position fill과 stack 비교</title><link>http://ken-0913.github.io/myblog/posts/mlpe/mlpe-04-2-eda-fill-vs-stack/</link><pubDate>Thu, 29 Oct 2026 18:00:00 +0900</pubDate><author><name>ken-0913</name></author><guid>http://ken-0913.github.io/myblog/posts/mlpe/mlpe-04-2-eda-fill-vs-stack/</guid><description><![CDATA[<div class="featured-image">
                <img src="images/banners/mlpe-04-2-eda-fill-vs-stack-97988625.png" referrerpolicy="no-referrer">
            </div><p>EDA run의 막대그래프 인자 <code>position=&quot;fill&quot;</code>을 <code>&quot;stack&quot;</code>으로 바꿔 run을 하나 더 만들고, 두 그래프가 무엇을 보여 주는지 비교한다.</p>
<h2 id="1-무엇을-바꾸나" class="headerLink">
    <a href="#1-%eb%ac%b4%ec%97%87%ec%9d%84-%eb%b0%94%ea%be%b8%eb%82%98" class="header-mark"></a>1. 무엇을 바꾸나</h2><p>책의 EDA 셀은 범주형 컬럼 8개마다 막대그래프를 그린다. 막대 하나가 컬럼의 값 하나(예: Workclass의 Private)이고, 막대 안은 소득 구간 Target(<code>&lt;=50K</code>, <code>&gt;50K</code>)별 색으로 나뉜다. <code>geom_bar</code>의 <code>position</code> 인자가 두 색을 어떻게 쌓을지 정한다.</p>
<table>
	<thead>
			<tr>
					<th><code>position</code></th>
					<th>막대 길이</th>
					<th>읽을 수 있는 것</th>
			</tr>
	</thead>
	<tbody>
			<tr>
					<td><code>&quot;fill&quot;</code> (책 코드)</td>
					<td>모든 막대가 1.0으로 같다</td>
					<td>값마다 고소득(<code>&gt;50K</code>) <strong>비율</strong></td>
			</tr>
			<tr>
					<td><code>&quot;stack&quot;</code> (plotnine 기본값)</td>
					<td>그 값의 사람 수만큼</td>
					<td>값마다 <strong>건수</strong>와 그 안의 고소득 수</td>
			</tr>
	</tbody>
</table>
<h2 id="2-실행" class="headerLink">
    <a href="#2-%ec%8b%a4%ed%96%89" class="header-mark"></a>2. 실행</h2><p>JupyterLab에서 책 노트북 옆에 새 노트북 <code>eda_fill_vs_stack.ipynb</code>를 만들고, 4.1절과 같은 <code>chapter-4</code> 커널로 실행했다. 첫 셀은 데이터를 읽고 실험 <code>income-classifier</code>를 고르며, 둘째 셀이 run 두 개를 만든다. 책 셀과 다른 곳은 <code>position</code>을 바꿔 가며 두 번 돈다는 것과, 어느 쪽인지 알 수 있게 <code>position</code>을 파라미터로 기록한다는 것뿐이다.</p>]]></description></item></channel></rss>