<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>qwer.ty_v</title>
    <link>https://drewvvv.tistory.com/</link>
    <description></description>
    <language>ko</language>
    <pubDate>Fri, 22 May 2026 10:01:41 +0900</pubDate>
    <generator>TISTORY</generator>
    <ttl>100</ttl>
    <managingEditor>qwer.ty_v</managingEditor>
    <image>
      <title>qwer.ty_v</title>
      <url>https://tistory1.daumcdn.net/tistory/3073121/attach/27934a7d6e4145848ffd245df24bc50f</url>
      <link>https://drewvvv.tistory.com</link>
    </image>
    <item>
      <title>타이타닉 생존자 예측 분석 (3-3) 데이터 인코딩 - v.1.0.1</title>
      <link>https://drewvvv.tistory.com/19</link>
      <description>&lt;p data-ke-size=&quot;size14&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size14&quot;&gt;&lt;b&gt;이전 포스트&lt;/b&gt;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&lt;a href=&quot;https://drewvvv.tistory.com/18&quot;&gt;2023.01.12 - [분류 전체보기] - 타이타닉 생존자 예측 분석 (3-2) 데이터 정리 - v.1.0.1&lt;/a&gt;&lt;/p&gt;
&lt;figure id=&quot;og_1674016760642&quot; contenteditable=&quot;false&quot; data-ke-type=&quot;opengraph&quot; data-ke-align=&quot;alignCenter&quot; data-og-type=&quot;article&quot; data-og-title=&quot;타이타닉 생존자 예측 분석 (3-2) 데이터 정리 - v.1.0.1&quot; data-og-description=&quot;이전 포스트 2023.01.09 - [Kaggle/타이타닉] - 타이타닉 생존자 예측 분석 (3-1) 전처리 (나이예측) - v.1.0.1 타이타닉 생존자 예측 분석 (3-1) 전처리 (나이예측) - v.1.0.1 이전 포스트 2023.01.09 - [분류 전체&quot; data-og-host=&quot;drewvvv.tistory.com&quot; data-og-source-url=&quot;https://drewvvv.tistory.com/18&quot; data-og-url=&quot;https://drewvvv.tistory.com/18&quot; data-og-image=&quot;https://scrap.kakaocdn.net/dn/bWRRLp/hyRjaRJ54F/SQl645detVkHoBzkRvP9q1/img.png?width=800&amp;amp;height=168&amp;amp;face=0_0_800_168,https://scrap.kakaocdn.net/dn/diAClW/hyRiYqgxW6/4BtTUv2jrO2S9KejbjclV0/img.png?width=800&amp;amp;height=168&amp;amp;face=0_0_800_168,https://scrap.kakaocdn.net/dn/J9dOI/hyRi7tWQaA/ifGVtWQPcyoh5FswDuHRuK/img.png?width=750&amp;amp;height=757&amp;amp;face=0_0_750_757&quot;&gt;&lt;a href=&quot;https://drewvvv.tistory.com/18&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot; data-source-url=&quot;https://drewvvv.tistory.com/18&quot;&gt;
&lt;div class=&quot;og-image&quot; style=&quot;background-image: url('https://scrap.kakaocdn.net/dn/bWRRLp/hyRjaRJ54F/SQl645detVkHoBzkRvP9q1/img.png?width=800&amp;amp;height=168&amp;amp;face=0_0_800_168,https://scrap.kakaocdn.net/dn/diAClW/hyRiYqgxW6/4BtTUv2jrO2S9KejbjclV0/img.png?width=800&amp;amp;height=168&amp;amp;face=0_0_800_168,https://scrap.kakaocdn.net/dn/J9dOI/hyRi7tWQaA/ifGVtWQPcyoh5FswDuHRuK/img.png?width=750&amp;amp;height=757&amp;amp;face=0_0_750_757');&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;og-text&quot;&gt;
&lt;p class=&quot;og-title&quot; data-ke-size=&quot;size16&quot;&gt;타이타닉 생존자 예측 분석 (3-2) 데이터 정리 - v.1.0.1&lt;/p&gt;
&lt;p class=&quot;og-desc&quot; data-ke-size=&quot;size16&quot;&gt;이전 포스트 2023.01.09 - [Kaggle/타이타닉] - 타이타닉 생존자 예측 분석 (3-1) 전처리 (나이예측) - v.1.0.1 타이타닉 생존자 예측 분석 (3-1) 전처리 (나이예측) - v.1.0.1 이전 포스트 2023.01.09 - [분류 전체&lt;/p&gt;
&lt;p class=&quot;og-host&quot; data-ke-size=&quot;size16&quot;&gt;drewvvv.tistory.com&lt;/p&gt;
&lt;/div&gt;
&lt;/a&gt;&lt;/figure&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style7&quot; /&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;1. 데이터 인코딩&lt;/h3&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;모델에 학습을 하기 위해선 사실 몇가지 준비가 필요하다.&lt;/li&gt;
&lt;li&gt;모델에 학습시킬 데이터에 대한 내용인데,&amp;nbsp;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;1. 데이터프레임 안의 &lt;b&gt;데이터는 숫자&lt;/b&gt;여야 하며(could not convert string to float)
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;이때 범주형 변수를 숫자로 나타내게될 때, 사실 서로 아무 의미가 없지만 모델이 의미를 갖는 경우가 생기는 것에 주의해야 한다.&amp;nbsp;&lt;span style=&quot;color: #006dd7;&quot;&gt; &lt;a style=&quot;color: #006dd7;&quot; href=&quot;https://gongboogi.tistory.com/5&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;(참고링크)&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;위의 차이를 확인해보고자, 레이블 인코딩과 원핫 인코딩으로 비교 제출해 볼 것이다.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;2. 원핫인코딩의 경우 값을 기준으로 분류하기 때문에, 값을 컬럼명으로 사용하는 경우가 발생한다.&amp;nbsp;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;이때 원핫인코딩은 컬럼명을 도출하지만, 각기 다른 컬럼에 값이 같은 경우 문제가 될 수 있으며,&lt;/li&gt;
&lt;li&gt;가장 중요한 모델의 학습의 경우 &lt;b&gt;컬럼명이 숫자인 경우&lt;/b&gt; 워링이 발생한다. (FutureWarning: Feature names only support names that are all strings. Got feature names with dtypes: ['int64'])
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;경우의 따라 숫자 컬럼명을 문자로 변경해주면 되긴하지만, 그것은 모델의 학습에 대해 의도한 바가 아니다.&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;3. scikit-learn의 onehot-encoding과 pandas의 get_dummies()
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;겉으로 보기엔 둘은 똑같은 역할을 하는 것처럼 보이지만 둘은 공통점과 명확한 차이가 존재한다.&lt;/li&gt;
&lt;li&gt;우선 공통점을 보자면 두 메서드는 각 값에 해당하는 컬럼을 새로 생성한 후 컬럼에 해당하는 값일 경우 1 아닐 경우 0으로 둔다. &lt;span style=&quot;color: #006dd7;&quot;&gt;&lt;a style=&quot;color: #006dd7;&quot; href=&quot;https://towardsdatascience.com/stop-using-pandas-get-dummies-for-feature-encoding-5d2cd07cb4fc&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;(참고링크)&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&lt;/li&gt;
&lt;li&gt;히지만 명확한 차이는 모델 학습에서 들어난다.&amp;nbsp;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;판다스의 get_dummies()는 그저 위의 공통사항을 분류만 할 뿐이지만,&lt;/li&gt;
&lt;li&gt;사이킷 런의 원핫인코딩은 train 데이터 셋에 맞게 test 셋을 맞추는 것이다.&amp;nbsp;&lt;/li&gt;
&lt;li&gt;이 차이를 다시 풀자면, train 셋에는 해당하는 컬럼이 없지만 test 셋에는 컬럼이 있을 경우 모델은 학습을 할 수 없어 에러가 나게된다.&amp;nbsp;&lt;/li&gt;
&lt;li&gt;하지만 원핫인코딩의 경우 데이터 뿐만이 아니라, 컬럼명까지 참조하기 때문에 get_dummies()와 같은 문제가 발생하지 않는다. (단 encoding시 handle_unknown='ignore' 파라미터 추가 필요)&lt;/li&gt;
&lt;li&gt;하지만 get_dummies()도 위의 문제를 해결하고 사용할 수 있는 방법이 있는데, 파이프라인을 구축하여 encoding시 원핫인코딩의 handle_unknown 기능을 간접적으로 구현하는 방법이 있다. &lt;a href=&quot;https://pythonsimplified.com/difference-between-onehotencoder-and-get_dummies/&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;&lt;span style=&quot;color: #006dd7;&quot;&gt;(참고링크)&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;(이외의 다른 차이도 존재하지만 생략)&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;따라 본 v1.0.1 버전에선 다음과 같은 계획을 갖고 비교해가며 모델 학습을 진행한다.&amp;nbsp;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;인코딩 방법간의 차이를 살펴보기 위해 모델은 RandomForest로 고정한다.&lt;/li&gt;
&lt;li&gt;1. 앞의 (3-2) 데이터 정리 포스트에서 변수를 숫자 범주형(레이블 인코더)으로 변환한 데이터를 그대로 학습 후 제출&amp;nbsp;&lt;/li&gt;
&lt;li&gt;2. 숫자 범주형을 사용하지 않고 범주형 데이터를 원핫인코딩 후 제출&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;위의 1번의 경우 데이터 셋을 불러온다.&amp;nbsp;&lt;/p&gt;
&lt;div style=&quot;color: #a9b7c6; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; position: relative !important; overflow: auto;&quot;&gt;
&lt;table style=&quot;margin: 0; padding: 0; border: none; background-color: #2b2b2b; border-radius: 4px;&quot; border=&quot;1&quot; data-ke-align=&quot;alignLeft&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&quot;padding: 6px; border-right: 2px solid #4f4f4f;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; word-break: normal; text-align: right; color: #aaa; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;1&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;2&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;3&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;4&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;5&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;6&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;padding: 6px 0; text-align: left;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; color: #a9b7c6; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;import&lt;/span&gt;&amp;nbsp;pandas&amp;nbsp;&lt;span style=&quot;color: #cc7832;&quot;&gt;as&lt;/span&gt;&amp;nbsp;pd&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;import&lt;/span&gt;&amp;nbsp;numpy&amp;nbsp;&lt;span style=&quot;color: #cc7832;&quot;&gt;as&lt;/span&gt;&amp;nbsp;np&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;noNaTrain&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;pd.read_csv(&lt;span style=&quot;color: #6a8759;&quot;&gt;&quot;../input/noNa_train&amp;nbsp;-&amp;nbsp;v1.0.1.csv&quot;&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;noNaTest&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;pd.read_csv(&lt;span style=&quot;color: #6a8759;&quot;&gt;&quot;../input/noNa_test&amp;nbsp;-&amp;nbsp;v1.0.1.csv&quot;&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;gender&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;pd.read_csv(&lt;span style=&quot;color: #6a8759;&quot;&gt;&quot;../input/gender_submission.csv&quot;&lt;/span&gt;)&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;vertical-align: bottom; padding: 0 2px 4px 0;&quot;&gt;&lt;a style=&quot;text-decoration: none; color: white;&quot; href=&quot;http://colorscripter.com/info#e&quot;&gt;&lt;span style=&quot;font-size: 9px; word-break: normal; background-color: #4f4f4f; color: white; border-radius: 10px; padding: 1px;&quot;&gt;cs&lt;/span&gt;&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;div style=&quot;color: #a9b7c6; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; position: relative !important; overflow: auto;&quot;&gt;
&lt;table style=&quot;margin: 0; padding: 0; border: none; background-color: #2b2b2b; border-radius: 4px;&quot; border=&quot;1&quot; data-ke-align=&quot;alignLeft&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&quot;padding: 6px; border-right: 2px solid #4f4f4f;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; word-break: normal; text-align: right; color: #aaa; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;1&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;2&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;3&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;4&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;5&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;padding: 6px 0; text-align: left;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; color: #a9b7c6; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;feature_1&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;[&lt;span style=&quot;color: #6a8759;&quot;&gt;'Survived'&lt;/span&gt;,&lt;span style=&quot;color: #6a8759;&quot;&gt;'Pclass'&lt;/span&gt;,&lt;span style=&quot;color: #6a8759;&quot;&gt;'ca_Sex'&lt;/span&gt;,&lt;span style=&quot;color: #6a8759;&quot;&gt;'ca_Age'&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #6a8759;&quot;&gt;'SibSp'&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #6a8759;&quot;&gt;'Parch'&lt;/span&gt;,&lt;span style=&quot;color: #6a8759;&quot;&gt;'ca_designation'&lt;/span&gt;]&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;train_data&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;noNaTrain[feature_1[&lt;span style=&quot;color: #6897bb;&quot;&gt;1&lt;/span&gt;:]].copy()&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;target&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;noNaTrain[&lt;span style=&quot;color: #6a8759;&quot;&gt;'Survived'&lt;/span&gt;].copy().values&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;test_data&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;noNaTest[feature_1[&lt;span style=&quot;color: #6897bb;&quot;&gt;1&lt;/span&gt;:]].copy()&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: right; margin-top: -13px; margin-right: 5px; font-size: 9px; font-style: italic;&quot;&gt;&lt;a style=&quot;color: #4f4f4ftext-decoration:none;&quot; href=&quot;http://colorscripter.com/info#e&quot;&gt;Colored by Color Scripter&lt;/a&gt;&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;vertical-align: bottom; padding: 0 2px 4px 0;&quot;&gt;&lt;a style=&quot;text-decoration: none; color: white;&quot; href=&quot;http://colorscripter.com/info#e&quot;&gt;&lt;span style=&quot;font-size: 9px; word-break: normal; background-color: #4f4f4f; color: white; border-radius: 10px; padding: 1px;&quot;&gt;cs&lt;/span&gt;&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;Fare 컬럼을 사용하지 않고 위와 같이 featrue_1을 구성한다.&lt;/li&gt;
&lt;li&gt;모델에 학습시킬 train_data는 Survived를 제외, target은 Survived를 사용&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignLeft&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;730&quot; data-origin-height=&quot;614&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/bhJ5eF/btrWzUJ2Zy3/g8S4kuePkq20Uj32XnXv61/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/bhJ5eF/btrWzUJ2Zy3/g8S4kuePkq20Uj32XnXv61/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/bhJ5eF/btrWzUJ2Zy3/g8S4kuePkq20Uj32XnXv61/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FbhJ5eF%2FbtrWzUJ2Zy3%2Fg8S4kuePkq20Uj32XnXv61%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;730&quot; height=&quot;614&quot; data-origin-width=&quot;730&quot; data-origin-height=&quot;614&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;div class=&quot;colorscripter-code&quot; style=&quot;color: #a9b7c6; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; position: relative !important; overflow: auto;&quot;&gt;
&lt;table class=&quot;colorscripter-code-table&quot; style=&quot;margin: 0; padding: 0; border: none; background-color: #2b2b2b; border-radius: 4px;&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; data-ke-align=&quot;alignLeft&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&quot;padding: 6px; border-right: 2px solid #4f4f4f;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; word-break: normal; text-align: right; color: #aaa; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;1&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;2&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;3&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;4&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;5&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;6&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;7&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;8&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;9&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;10&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;11&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;12&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;13&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;14&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;15&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;16&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;padding: 6px 0; text-align: left;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; color: #a9b7c6; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;from&lt;/span&gt;&amp;nbsp;sklearn.ensemble&amp;nbsp;&lt;span style=&quot;color: #cc7832;&quot;&gt;import&lt;/span&gt;&amp;nbsp;RandomForestClassifier&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;from&lt;/span&gt;&amp;nbsp;sklearn.model_selection&amp;nbsp;&lt;span style=&quot;color: #cc7832;&quot;&gt;import&lt;/span&gt;&amp;nbsp;train_test_split&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;X_train,&amp;nbsp;X_test,&amp;nbsp;y_train,&amp;nbsp;y_test&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;train_test_split(train_data,&amp;nbsp;target,&amp;nbsp;test_size&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6897bb;&quot;&gt;0.&lt;/span&gt;&lt;span style=&quot;color: #6897bb;&quot;&gt;2&lt;/span&gt;,&amp;nbsp;random_state&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #6897bb;&quot;&gt;42&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;model&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;RandomForestClassifier()&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;model.fit(X_train,&amp;nbsp;y_train)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;accuracy&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt; round(&lt;span style=&quot;background-color: #2b2b2b; color: #a9b7c6;&quot;&gt;model&lt;/span&gt;.score(X_test,&amp;nbsp;y_test)&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;*&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6897bb;&quot;&gt;100&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #6897bb;&quot;&gt;2&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #8888c6;&quot;&gt;print&lt;/span&gt;(f&lt;span style=&quot;color: #6a8759;&quot;&gt;&quot;accuracy&amp;nbsp;of&amp;nbsp;{type(model).__name__}:&amp;nbsp;{str(accuracy)}%&quot;&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;predict&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt; model.predict(test_data)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;submission_df&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;pd.DataFrame({&lt;span style=&quot;color: #6a8759;&quot;&gt;'PassengerId'&lt;/span&gt;:noNaTest[&lt;span style=&quot;color: #6a8759;&quot;&gt;'PassengerId'&lt;/span&gt;],&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #6a8759;&quot;&gt;'Survived'&lt;/span&gt;:predict})&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #808080;&quot;&gt;#&amp;nbsp;submission_df.head()&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;submission_df.to_csv(f&lt;span style=&quot;color: #6a8759;&quot;&gt;'sbn_{type(model).__name__&amp;nbsp;}&lt;span style=&quot;background-color: #2b2b2b; color: #6a8759;&quot;&gt;_labeling&lt;/span&gt;.csv'&lt;/span&gt;,&amp;nbsp;index&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #8888c6;&quot;&gt;False&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #8888c6;&quot;&gt;print&lt;/span&gt;(f&lt;span style=&quot;color: #6a8759;&quot;&gt;&lt;span style=&quot;color: #6a8759;&quot;&gt;&quot;name of export submission : sbn_{type(model).__name__}_labeling&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #6a8759;&quot;&gt;.csv&quot;&lt;/span&gt;)&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: right; margin-top: -13px; margin-right: 5px; font-size: 9px; font-style: italic;&quot;&gt;&lt;a style=&quot;color: #4f4f4ftext-decoration:none;&quot; href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Colored by Color Scripter&lt;/a&gt;&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;vertical-align: bottom; padding: 0 2px 4px 0;&quot;&gt;&lt;a style=&quot;text-decoration: none; color: white;&quot; href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;&lt;span style=&quot;font-size: 9px; word-break: normal; background-color: #4f4f4f; color: white; border-radius: 10px; padding: 1px;&quot;&gt;cs&lt;/span&gt;&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignLeft&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;780&quot; data-origin-height=&quot;75&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/D5iz6/btrWCIhBnBA/SqvFvnck106ptDHr7Fm1Z1/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/D5iz6/btrWCIhBnBA/SqvFvnck106ptDHr7Fm1Z1/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/D5iz6/btrWCIhBnBA/SqvFvnck106ptDHr7Fm1Z1/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FD5iz6%2FbtrWCIhBnBA%2FSqvFvnck106ptDHr7Fm1Z1%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;780&quot; height=&quot;75&quot; data-origin-width=&quot;780&quot; data-origin-height=&quot;75&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;분류모델에 별다른 하이퍼 파라미터 수정하지 않고,&lt;/li&gt;
&lt;li&gt;위의 train_data는 변수들을 라벨링한 후의 결과 값으로 80.45%의 정확도를 보였다.&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignLeft&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;931&quot; data-origin-height=&quot;927&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/6th2u/btrWxrPp9WV/ue5MhfyeDkLnZF91yk5at1/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/6th2u/btrWxrPp9WV/ue5MhfyeDkLnZF91yk5at1/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/6th2u/btrWxrPp9WV/ue5MhfyeDkLnZF91yk5at1/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2F6th2u%2FbtrWxrPp9WV%2Fue5MhfyeDkLnZF91yk5at1%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;506&quot; height=&quot;504&quot; data-origin-width=&quot;931&quot; data-origin-height=&quot;927&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;figure class=&quot;imageblock alignLeft&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;1553&quot; data-origin-height=&quot;191&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/Dus4R/btrWDdajChG/DQfaDGVuu6bQajL06ZmMKK/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/Dus4R/btrWDdajChG/DQfaDGVuu6bQajL06ZmMKK/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/Dus4R/btrWDdajChG/DQfaDGVuu6bQajL06ZmMKK/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FDus4R%2FbtrWDdajChG%2FDQfaDGVuu6bQajL06ZmMKK%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;568&quot; height=&quot;70&quot; data-origin-width=&quot;1553&quot; data-origin-height=&quot;191&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;하지만 실제 스코어는 0.5933으로 매우 낮았다.&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;이제 2번의 계획인 onehot encoding을 사용해 본다.&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;div class=&quot;colorscripter-code&quot; style=&quot;color: #a9b7c6; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; position: relative !important; overflow: auto;&quot;&gt;
&lt;table class=&quot;colorscripter-code-table&quot; style=&quot;margin: 0; padding: 0; border: none; background-color: #2b2b2b; border-radius: 4px;&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; data-ke-align=&quot;alignLeft&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&quot;padding: 6px; border-right: 2px solid #4f4f4f;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; word-break: normal; text-align: right; color: #aaa; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;1&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;2&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;3&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;4&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;5&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;6&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;7&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;8&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;9&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;10&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;11&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;12&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;13&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;padding: 6px 0; text-align: left;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; color: #a9b7c6; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #808080;&quot;&gt;#&amp;nbsp;test&amp;nbsp;for&amp;nbsp;one&amp;nbsp;hot&amp;nbsp;encoding&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;feature_2&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;[&lt;span style=&quot;color: #6a8759;&quot;&gt;'Survived'&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #6a8759;&quot;&gt;'Pclass'&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #6a8759;&quot;&gt;'Sex'&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #6a8759;&quot;&gt;'ca_Age'&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #6a8759;&quot;&gt;'SibSp'&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #6a8759;&quot;&gt;'Parch'&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #6a8759;&quot;&gt;'designation'&lt;/span&gt;]&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;train_data2&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;noNaTrain[feature_2[&lt;span style=&quot;color: #6897bb;&quot;&gt;1&lt;/span&gt;:]].copy()&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;target&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;noNaTrain[&lt;span style=&quot;color: #6a8759;&quot;&gt;'Survived'&lt;/span&gt;].copy().values&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;test_data2&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;noNaTest[feature_2[&lt;span style=&quot;color: #6897bb;&quot;&gt;1&lt;/span&gt;:]].copy()&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;for&lt;/span&gt;&amp;nbsp;df&amp;nbsp;&lt;span style=&quot;color: #cc7832;&quot;&gt;in&lt;/span&gt;&amp;nbsp;[train_data2,&amp;nbsp;test_data2]:&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #cc7832;&quot;&gt;for&lt;/span&gt;&amp;nbsp;col&amp;nbsp;&lt;span style=&quot;color: #cc7832;&quot;&gt;in&lt;/span&gt;&amp;nbsp;[&lt;span style=&quot;color: #6a8759;&quot;&gt;'Pclass'&lt;/span&gt;, &lt;span style=&quot;color: #6a8759;&quot;&gt;'ca_Age'&lt;/span&gt;&lt;span style=&quot;background-color: #2b2b2b; color: #a9b7c6;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #6a8759;&quot;&gt;'SibSp'&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #6a8759;&quot;&gt;'Parch'&lt;/span&gt;]:&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #cc7832;&quot;&gt;for&lt;/span&gt;&amp;nbsp;index,&amp;nbsp;item&amp;nbsp;&lt;span style=&quot;color: #cc7832;&quot;&gt;in&lt;/span&gt;&amp;nbsp;enumerate(df[col]):&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;df.loc[index,&amp;nbsp;col]&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;col&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;+&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6a8759;&quot;&gt;'_'&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;+&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #8888c6;&quot;&gt;str&lt;/span&gt;(item)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: right; margin-top: -13px; margin-right: 5px; font-size: 9px; font-style: italic;&quot;&gt;&lt;a style=&quot;color: #4f4f4ftext-decoration:none;&quot; href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Colored by Color Scripter&lt;/a&gt;&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;vertical-align: bottom; padding: 0 2px 4px 0;&quot;&gt;&lt;a style=&quot;text-decoration: none; color: white;&quot; href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;&lt;span style=&quot;font-size: 9px; word-break: normal; background-color: #4f4f4f; color: white; border-radius: 10px; padding: 1px;&quot;&gt;cs&lt;/span&gt;&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;우선 feature의 경우 기존 &lt;span style=&quot;background-color: #2b2b2b; color: #a9b7c6;&quot;&gt;feature_1&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;background-color: #2b2b2b; color: #a9b7c6;&quot;&gt;&amp;nbsp;[&lt;/span&gt;&lt;span style=&quot;color: #6a8759;&quot;&gt;'Survived'&lt;/span&gt;&lt;span style=&quot;background-color: #2b2b2b; color: #a9b7c6;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #6a8759;&quot;&gt;'Pclass'&lt;/span&gt;&lt;span style=&quot;background-color: #2b2b2b; color: #a9b7c6;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #6a8759;&quot;&gt;'ca_Sex'&lt;/span&gt;&lt;span style=&quot;background-color: #2b2b2b; color: #a9b7c6;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #6a8759;&quot;&gt;'ca_Age'&lt;/span&gt;&lt;span style=&quot;background-color: #2b2b2b; color: #a9b7c6;&quot;&gt;,&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #6a8759;&quot;&gt;'SibSp'&lt;/span&gt;&lt;span style=&quot;background-color: #2b2b2b; color: #a9b7c6;&quot;&gt;,&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #6a8759;&quot;&gt;'Parch'&lt;/span&gt;&lt;span style=&quot;background-color: #2b2b2b; color: #a9b7c6;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #6a8759;&quot;&gt;'ca_designation'&lt;/span&gt;&lt;span style=&quot;background-color: #2b2b2b; color: #a9b7c6;&quot;&gt;]&lt;span style=&quot;background-color: #ffffff; color: #000000;&quot;&gt; 에서&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&lt;span style=&quot;background-color: #ffffff;&quot;&gt;ca_Sex를 Sex로, ca_designation은 designation으로 사용하고 나머지 컬럼은 앞의 prefix를 붙혀 데이터를 변환한다.&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&lt;span style=&quot;background-color: #ffffff;&quot;&gt;데이터 변환 결과는 아래와 같다.&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignLeft&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;640&quot; data-origin-height=&quot;817&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/kBpZk/btrWzRzVHqo/m0I523opMUcdd5WskUlQ50/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/kBpZk/btrWzRzVHqo/m0I523opMUcdd5WskUlQ50/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/kBpZk/btrWzRzVHqo/m0I523opMUcdd5WskUlQ50/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FkBpZk%2FbtrWzRzVHqo%2Fm0I523opMUcdd5WskUlQ50%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;640&quot; height=&quot;817&quot; data-origin-width=&quot;640&quot; data-origin-height=&quot;817&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;div class=&quot;colorscripter-code&quot; style=&quot;color: #a9b7c6; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; position: relative !important; overflow: auto;&quot;&gt;
&lt;table class=&quot;colorscripter-code-table&quot; style=&quot;margin: 0; padding: 0; border: none; background-color: #2b2b2b; border-radius: 4px;&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; data-ke-align=&quot;alignLeft&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&quot;padding: 6px; border-right: 2px solid #4f4f4f;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; word-break: normal; text-align: right; color: #aaa; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;1&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;2&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;3&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;4&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;5&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;6&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;7&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;8&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;9&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;10&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;11&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;12&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;13&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;14&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;15&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;16&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;17&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;padding: 6px 0; text-align: left;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; color: #a9b7c6; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #808080;&quot;&gt;#&amp;nbsp;https://towardsdatascience.com/stop-using-pandas-get-dummies-for-feature-encoding-5d2cd07cb4fc&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #808080;&quot;&gt;#&amp;nbsp;https://pythonsimplified.com/difference-between-onehotencoder-and-get_dummies/&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;from&lt;/span&gt;&amp;nbsp;sklearn.preprocessing&amp;nbsp;&lt;span style=&quot;color: #cc7832;&quot;&gt;import&lt;/span&gt;&amp;nbsp;OneHotEncoder&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #808080;&quot;&gt;#&amp;nbsp;one&amp;nbsp;hot&amp;nbsp;encoding&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;enc&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;OneHotEncoder(sparse&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #8888c6;&quot;&gt;False&lt;/span&gt;,&amp;nbsp;handle_unknown&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #6a8759;&quot;&gt;'ignore'&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;onehot&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;enc.fit_transform(train_data2[feature_2[&lt;span style=&quot;color: #6897bb;&quot;&gt;1&lt;/span&gt;:]])&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;columns&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;list([j&amp;nbsp;&lt;span style=&quot;color: #cc7832;&quot;&gt;for&lt;/span&gt;&amp;nbsp;i&amp;nbsp;&lt;span style=&quot;color: #cc7832;&quot;&gt;in&lt;/span&gt;&amp;nbsp;enc.categories_&amp;nbsp;&lt;span style=&quot;color: #cc7832;&quot;&gt;for&lt;/span&gt;&amp;nbsp;j&amp;nbsp;&lt;span style=&quot;color: #cc7832;&quot;&gt;in&lt;/span&gt;&amp;nbsp;i])&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #808080;&quot;&gt;#to&amp;nbsp;print&amp;nbsp;the&amp;nbsp;encoded&amp;nbsp;features&amp;nbsp;for&amp;nbsp;train&amp;nbsp;data&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;trainOneHotDf&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;pd.DataFrame(onehot,&amp;nbsp;columns&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;columns)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;train_data2&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;trainOneHotDf.copy()&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #808080;&quot;&gt;#&amp;nbsp;tranform&amp;nbsp;encoding&amp;nbsp;for&amp;nbsp;test&amp;nbsp;data&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;test_onehot&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;enc.transform(test_data2[feature_2[&lt;span style=&quot;color: #6897bb;&quot;&gt;1&lt;/span&gt;:]])&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #808080;&quot;&gt;#to&amp;nbsp;print&amp;nbsp;the&amp;nbsp;encoded&amp;nbsp;features&amp;nbsp;for&amp;nbsp;train&amp;nbsp;data&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;testOneHotDf&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;pd.DataFrame(test_onehot,&amp;nbsp;columns&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;columns)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;test_data2&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;testOneHotDf.copy()&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: right; margin-top: -13px; margin-right: 5px; font-size: 9px; font-style: italic;&quot;&gt;&lt;a style=&quot;color: #4f4f4ftext-decoration:none;&quot; href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Colored by Color Scripter&lt;/a&gt;&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;vertical-align: bottom; padding: 0 2px 4px 0;&quot;&gt;&lt;a style=&quot;text-decoration: none; color: white;&quot; href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;&lt;span style=&quot;font-size: 9px; word-break: normal; background-color: #4f4f4f; color: white; border-radius: 10px; padding: 1px;&quot;&gt;cs&lt;/span&gt;&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;위 코드를 살펴보면 enc를 통해 train_data가 fit_transform되었고 , onehot array를 실제 columns와 매핑하여&amp;nbsp;trainOneHotDf를 생성하였다.&lt;/li&gt;
&lt;li&gt;testOneHotDf의 경우는 train_data2의 컬럼을 기준으로 학습된 enc를 적용하여 transform해서 test셋에는 있지만 train 셋에는 없어서 학습할 수 없는 경우가 발생하지 않도록 unknown 컬럼은 ignore 시키도록 파라미터를 추가하였다.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignLeft&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;1730&quot; data-origin-height=&quot;595&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/b30k9W/btrWCHwdpA7/KOAopVu0DftiMNWcvn1lWk/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/b30k9W/btrWCHwdpA7/KOAopVu0DftiMNWcvn1lWk/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/b30k9W/btrWCHwdpA7/KOAopVu0DftiMNWcvn1lWk/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2Fb30k9W%2FbtrWCHwdpA7%2FKOAopVu0DftiMNWcvn1lWk%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;1730&quot; height=&quot;595&quot; data-origin-width=&quot;1730&quot; data-origin-height=&quot;595&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;figure class=&quot;imageblock alignLeft&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;1838&quot; data-origin-height=&quot;292&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/WqJbd/btrWCh5YZ8r/j9hr56MHMGLf3cw63bmvxK/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/WqJbd/btrWCh5YZ8r/j9hr56MHMGLf3cw63bmvxK/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/WqJbd/btrWCh5YZ8r/j9hr56MHMGLf3cw63bmvxK/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FWqJbd%2FbtrWCh5YZ8r%2Fj9hr56MHMGLf3cw63bmvxK%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;1838&quot; height=&quot;292&quot; data-origin-width=&quot;1838&quot; data-origin-height=&quot;292&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;위를 바탕으로 feature들이 onehot-encoding된 것을 확인할 수 있다.&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;div class=&quot;colorscripter-code&quot; style=&quot;color: #a9b7c6; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; position: relative !important; overflow: auto;&quot;&gt;
&lt;table class=&quot;colorscripter-code-table&quot; style=&quot;margin: 0; padding: 0; border: none; background-color: #2b2b2b; border-radius: 4px;&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; data-ke-align=&quot;alignLeft&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&quot;padding: 6px; border-right: 2px solid #4f4f4f;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; word-break: normal; text-align: right; color: #aaa; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;1&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;2&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;3&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;4&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;5&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;6&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;7&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;8&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;9&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;10&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;11&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;12&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;13&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;padding: 6px 0; text-align: left;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; color: #a9b7c6; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;X_train,&amp;nbsp;X_test,&amp;nbsp;y_train,&amp;nbsp;y_test&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;train_test_split(train_data2,&amp;nbsp;target,&amp;nbsp;test_size&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6897bb;&quot;&gt;0.&lt;/span&gt;&lt;span style=&quot;color: #6897bb;&quot;&gt;2&lt;/span&gt;,&amp;nbsp;random_state&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #6897bb;&quot;&gt;42&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;model&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;RandomForestClassifier()&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;model.fit(X_train,&amp;nbsp;y_train)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;accuracy&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;round(model.score(X_test,&amp;nbsp;y_test)&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;*&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6897bb;&quot;&gt;100&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #6897bb;&quot;&gt;2&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #8888c6;&quot;&gt;print&lt;/span&gt;(f&lt;span style=&quot;color: #6a8759;&quot;&gt;&quot;accuracy&amp;nbsp;of&amp;nbsp;{type(model).__name__}:&amp;nbsp;{str(accuracy)}%&quot;&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;predict&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;model.predict(test_data2)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;submission_df&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;pd.DataFrame({&lt;span style=&quot;color: #6a8759;&quot;&gt;'PassengerId'&lt;/span&gt;:noNaTest[&lt;span style=&quot;color: #6a8759;&quot;&gt;'PassengerId'&lt;/span&gt;],&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #6a8759;&quot;&gt;'Survived'&lt;/span&gt;:predict})&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #808080;&quot;&gt;#&amp;nbsp;submission_df.head()&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;submission_df.to_csv(f&lt;span style=&quot;color: #6a8759;&quot;&gt;'sbn_{type(model).__name__&amp;nbsp;}_onehot.csv'&lt;/span&gt;,&amp;nbsp;index&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #8888c6;&quot;&gt;False&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #8888c6;&quot;&gt;print&lt;/span&gt;(f&lt;span style=&quot;color: #6a8759;&quot;&gt;&quot;name&amp;nbsp;of&amp;nbsp;export&amp;nbsp;submission&amp;nbsp;:&amp;nbsp;sbn_{type(model).__name__}_onehot.csv&quot;&lt;/span&gt;)&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: right; margin-top: -13px; margin-right: 5px; font-size: 9px; font-style: italic;&quot;&gt;&lt;a style=&quot;color: #4f4f4ftext-decoration:none;&quot; href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Colored by Color Scripter&lt;/a&gt;&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;vertical-align: bottom; padding: 0 2px 4px 0;&quot;&gt;&lt;a style=&quot;text-decoration: none; color: white;&quot; href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;&lt;span style=&quot;font-size: 9px; word-break: normal; background-color: #4f4f4f; color: white; border-radius: 10px; padding: 1px;&quot;&gt;cs&lt;/span&gt;&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignLeft&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;754&quot; data-origin-height=&quot;73&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/b3BTsw/btrWyKuh4qY/alJIB9U89w64DD4cIb4ZNk/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/b3BTsw/btrWyKuh4qY/alJIB9U89w64DD4cIb4ZNk/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/b3BTsw/btrWyKuh4qY/alJIB9U89w64DD4cIb4ZNk/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2Fb3BTsw%2FbtrWyKuh4qY%2FalJIB9U89w64DD4cIb4ZNk%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;754&quot; height=&quot;73&quot; data-origin-width=&quot;754&quot; data-origin-height=&quot;73&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;분류모델에 별다른 하이퍼 파라미터 수정하지 않고,&lt;/li&gt;
&lt;li&gt;위의 train_data는 변수들을 onehot-encoding한 후의 결과 값으로 82.68%의 정확도를 보였다.&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignLeft&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;939&quot; data-origin-height=&quot;921&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/zPh93/btrWyMMsiN9/Yl1LwoMiJCDtXbe97gkGA0/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/zPh93/btrWyMMsiN9/Yl1LwoMiJCDtXbe97gkGA0/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/zPh93/btrWyMMsiN9/Yl1LwoMiJCDtXbe97gkGA0/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FzPh93%2FbtrWyMMsiN9%2FYl1LwoMiJCDtXbe97gkGA0%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;386&quot; height=&quot;379&quot; data-origin-width=&quot;939&quot; data-origin-height=&quot;921&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;figure class=&quot;imageblock alignLeft&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;1514&quot; data-origin-height=&quot;314&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/cyhtnv/btrWCqhkFfe/3l7GxzptxrYR40dpAE4GBk/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/cyhtnv/btrWCqhkFfe/3l7GxzptxrYR40dpAE4GBk/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/cyhtnv/btrWCqhkFfe/3l7GxzptxrYR40dpAE4GBk/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2Fcyhtnv%2FbtrWCqhkFfe%2F3l7GxzptxrYR40dpAE4GBk%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;483&quot; height=&quot;100&quot; data-origin-width=&quot;1514&quot; data-origin-height=&quot;314&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;단지 onehot-encoding만 실시하였지만 score가 확연히 차이나는 것을 확인할 수 있다.&lt;/li&gt;
&lt;li&gt;이는 모델이 학습시에 데이터를 올바르게 읽지 못하고 연속된 값이 연관이 있다고 판단하여 생기는 문제이다.&lt;/li&gt;
&lt;li&gt;따라 데이터 전처리의 경우 각 데이터의 특성에 따른 적절한 전처리를 할 필요가 있다.&lt;/li&gt;
&lt;/ul&gt;
&lt;div id=&quot;dicLayer&quot; style=&quot;color: #000000; font-size: 12px; font-family: Arial; background: -webkit-linear-gradient(bottom, #ffeb00, #ffdc00); width: 400px; height: 150px; display: none;&quot;&gt;
&lt;div id=&quot;dicLayerContents&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div id=&quot;dicLayerSub&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;/div&gt;
&lt;div id=&quot;dicRawData&quot; style=&quot;display: none;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style7&quot; /&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&lt;b&gt;다음 포스트&lt;/b&gt;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;TBW&lt;/p&gt;
&lt;div id=&quot;dicLayerLoader&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div id=&quot;dicLayerLoader&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div id=&quot;dicLayerLoader&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div id=&quot;dicLayer&quot;&gt;
&lt;div id=&quot;dicLayerContents&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div id=&quot;dicLayerSub&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;/div&gt;
&lt;div id=&quot;dicRawData&quot; style=&quot;display: none;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div id=&quot;dicLayerLoader&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div id=&quot;dicLayer&quot;&gt;
&lt;div id=&quot;dicLayerContents&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div id=&quot;dicLayerSub&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;/div&gt;
&lt;div id=&quot;dicRawData&quot; style=&quot;display: none;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div id=&quot;dicLayerLoader&quot;&gt;&amp;nbsp;&lt;/div&gt;</description>
      <category>Kaggle/타이타닉</category>
      <author>qwer.ty_v</author>
      <guid isPermaLink="true">https://drewvvv.tistory.com/19</guid>
      <comments>https://drewvvv.tistory.com/19#entry19comment</comments>
      <pubDate>Wed, 18 Jan 2023 14:51:34 +0900</pubDate>
    </item>
    <item>
      <title>타이타닉 생존자 예측 분석 (3-2) 데이터 정리 - v.1.0.1</title>
      <link>https://drewvvv.tistory.com/18</link>
      <description>&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&lt;b&gt;이전 포스트&lt;/b&gt;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;div id=&quot;dicLayerLoader&quot;&gt;&lt;a href=&quot;https://drewvvv.tistory.com/17&quot;&gt;2023.01.09 - [Kaggle/타이타닉] - 타이타닉 생존자 예측 분석 (3-1) 전처리 (나이예측) - v.1.0.1&lt;/a&gt;
&lt;figure id=&quot;og_1673503062169&quot; contenteditable=&quot;false&quot; data-ke-type=&quot;opengraph&quot; data-ke-align=&quot;alignCenter&quot; data-og-type=&quot;article&quot; data-og-title=&quot;타이타닉 생존자 예측 분석 (3-1) 전처리 (나이예측) - v.1.0.1&quot; data-og-description=&quot;이전 포스트 2023.01.09 - [분류 전체보기] - 타이타닉 생존자 예측 분석 (2-3) EDA(상관관계 및 기타) - v.1.0.1 타이타닉 생존자 예측 분석 (2-3) EDA(상관관계 및 기타) - v.1.0.1 이전 포스트 타이타닉 생존&quot; data-og-host=&quot;drewvvv.tistory.com&quot; data-og-source-url=&quot;https://drewvvv.tistory.com/17&quot; data-og-url=&quot;https://drewvvv.tistory.com/17&quot; data-og-image=&quot;https://scrap.kakaocdn.net/dn/b056py/hyRfIN92lk/Jks9XpWAMxVYunIJ2FiOJK/img.png?width=800&amp;amp;height=136&amp;amp;face=0_0_800_136,https://scrap.kakaocdn.net/dn/dIxVRe/hyRfykpNer/L7DH3SZTBrbv7R3lwTHWmK/img.png?width=800&amp;amp;height=136&amp;amp;face=0_0_800_136&quot;&gt;&lt;a href=&quot;https://drewvvv.tistory.com/17&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot; data-source-url=&quot;https://drewvvv.tistory.com/17&quot;&gt;
&lt;div class=&quot;og-image&quot; style=&quot;background-image: url('https://scrap.kakaocdn.net/dn/b056py/hyRfIN92lk/Jks9XpWAMxVYunIJ2FiOJK/img.png?width=800&amp;amp;height=136&amp;amp;face=0_0_800_136,https://scrap.kakaocdn.net/dn/dIxVRe/hyRfykpNer/L7DH3SZTBrbv7R3lwTHWmK/img.png?width=800&amp;amp;height=136&amp;amp;face=0_0_800_136');&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;og-text&quot;&gt;
&lt;p class=&quot;og-title&quot; data-ke-size=&quot;size16&quot;&gt;타이타닉 생존자 예측 분석 (3-1) 전처리 (나이예측) - v.1.0.1&lt;/p&gt;
&lt;p class=&quot;og-desc&quot; data-ke-size=&quot;size16&quot;&gt;이전 포스트 2023.01.09 - [분류 전체보기] - 타이타닉 생존자 예측 분석 (2-3) EDA(상관관계 및 기타) - v.1.0.1 타이타닉 생존자 예측 분석 (2-3) EDA(상관관계 및 기타) - v.1.0.1 이전 포스트 타이타닉 생존&lt;/p&gt;
&lt;p class=&quot;og-host&quot; data-ke-size=&quot;size16&quot;&gt;drewvvv.tistory.com&lt;/p&gt;
&lt;/div&gt;
&lt;/a&gt;&lt;/figure&gt;
&lt;/div&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style7&quot; /&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;1. 데이터 정리&lt;/h3&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;주어진 데이터 셋을 모델링하기 이전에 테스트를 진행할 test셋 또한 데이터 정제가 필요하다.&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;따라 &lt;b&gt;이전 포스트들에서 했던 내용들 중 코드만 모아서&lt;/b&gt;&amp;nbsp;train과 test 각 데이터셋을 처음부터 다시 정리하도록 한다.&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;div class=&quot;colorscripter-code&quot; style=&quot;color: #a9b7c6; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; position: relative !important; overflow: auto;&quot;&gt;
&lt;table class=&quot;colorscripter-code-table&quot; style=&quot;margin: 0; padding: 0; border: none; background-color: #2b2b2b; border-radius: 4px;&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; data-ke-align=&quot;alignLeft&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&quot;padding: 6px; border-right: 2px solid #4f4f4f;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; word-break: normal; text-align: right; color: #aaa; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;1&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;2&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;3&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;4&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;5&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;6&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;7&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;8&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;9&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;10&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;11&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;12&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;padding: 6px 0; text-align: left;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; color: #a9b7c6; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;train&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;pd.read_csv(&lt;span style=&quot;color: #6a8759;&quot;&gt;&quot;../input/train.csv&quot;&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;test&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;pd.read_csv(&lt;span style=&quot;color: #6a8759;&quot;&gt;&quot;../input/test.csv&quot;&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;gender&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;pd.read_csv(&lt;span style=&quot;color: #6a8759;&quot;&gt;&quot;../input/gender_submission.csv&quot;&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;dfs&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;{&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #6a8759;&quot;&gt;'train'&lt;/span&gt;:&amp;nbsp;{&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #6a8759;&quot;&gt;'data'&lt;/span&gt;&amp;nbsp;:&amp;nbsp;train&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;},&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #6a8759;&quot;&gt;'test'&lt;/span&gt;:&amp;nbsp;{&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #6a8759;&quot;&gt;'data'&lt;/span&gt;&amp;nbsp;:&amp;nbsp;test&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: right; margin-top: -13px; margin-right: 5px; font-size: 9px; font-style: italic;&quot;&gt;&lt;a style=&quot;color: #4f4f4ftext-decoration:none;&quot; href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Colored by Color Scripter&lt;/a&gt;&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;vertical-align: bottom; padding: 0 2px 4px 0;&quot;&gt;&lt;a style=&quot;text-decoration: none; color: white;&quot; href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;&lt;span style=&quot;font-size: 9px; word-break: normal; background-color: #4f4f4f; color: white; border-radius: 10px; padding: 1px;&quot;&gt;cs&lt;/span&gt;&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;우선 데이터 셋을 새로 다시 불러온다.&amp;nbsp;&lt;/li&gt;
&lt;li&gt;이후 dict를 생성하여 object로 관리한다.&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&lt;b&gt;1. 나이 범주화&lt;/b&gt;&lt;/p&gt;
&lt;div class=&quot;colorscripter-code&quot; style=&quot;color: #a9b7c6; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; position: relative !important; overflow: auto;&quot;&gt;
&lt;table class=&quot;colorscripter-code-table&quot; style=&quot;margin: 0; padding: 0; border: none; background-color: #2b2b2b; border-radius: 4px;&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; data-ke-align=&quot;alignLeft&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&quot;padding: 6px; border-right: 2px solid #4f4f4f;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; word-break: normal; text-align: right; color: #aaa; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;1&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;2&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;3&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;4&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;5&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;6&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;7&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;8&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;9&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;10&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;11&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;12&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;13&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;14&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;15&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;16&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;17&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;18&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;19&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;20&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;21&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;22&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;23&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;24&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;25&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;padding: 6px 0; text-align: left;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; color: #a9b7c6; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;for&lt;/span&gt;&amp;nbsp;dfName&amp;nbsp;&lt;span style=&quot;color: #cc7832;&quot;&gt;in&lt;/span&gt;&amp;nbsp;dfs.keys():&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #cc7832;&quot;&gt;for&lt;/span&gt;&amp;nbsp;index,&amp;nbsp;item&amp;nbsp;&lt;span style=&quot;color: #cc7832;&quot;&gt;in&lt;/span&gt;&amp;nbsp;enumerate(dfs[dfName][&lt;span style=&quot;color: #6a8759;&quot;&gt;'data'&lt;/span&gt;][&lt;span style=&quot;color: #6a8759;&quot;&gt;'Age'&lt;/span&gt;]):&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #cc7832;&quot;&gt;if&lt;/span&gt;&amp;nbsp;item&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;&amp;lt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6897bb;&quot;&gt;10&lt;/span&gt;:&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;result&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6897bb;&quot;&gt;0&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #cc7832;&quot;&gt;elif&lt;/span&gt;&amp;nbsp;item&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6897bb;&quot;&gt;10&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #cc7832;&quot;&gt;and&lt;/span&gt;&amp;nbsp;item&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;&amp;lt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6897bb;&quot;&gt;20&lt;/span&gt;:&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;result&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6897bb;&quot;&gt;1&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #cc7832;&quot;&gt;elif&lt;/span&gt;&amp;nbsp;item&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6897bb;&quot;&gt;20&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #cc7832;&quot;&gt;and&lt;/span&gt;&amp;nbsp;item&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;&amp;lt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6897bb;&quot;&gt;30&lt;/span&gt;:&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;result&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6897bb;&quot;&gt;2&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #cc7832;&quot;&gt;elif&lt;/span&gt;&amp;nbsp;item&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6897bb;&quot;&gt;30&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #cc7832;&quot;&gt;and&lt;/span&gt;&amp;nbsp;item&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;&amp;lt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6897bb;&quot;&gt;40&lt;/span&gt;:&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;result&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6897bb;&quot;&gt;3&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #cc7832;&quot;&gt;elif&lt;/span&gt;&amp;nbsp;item&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6897bb;&quot;&gt;40&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #cc7832;&quot;&gt;and&lt;/span&gt;&amp;nbsp;item&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;&amp;lt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6897bb;&quot;&gt;50&lt;/span&gt;:&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;result&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6897bb;&quot;&gt;4&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #cc7832;&quot;&gt;elif&lt;/span&gt;&amp;nbsp;item&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6897bb;&quot;&gt;50&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #cc7832;&quot;&gt;and&lt;/span&gt;&amp;nbsp;item&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;&amp;lt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6897bb;&quot;&gt;60&lt;/span&gt;:&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;result&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6897bb;&quot;&gt;5&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #cc7832;&quot;&gt;elif&lt;/span&gt;&amp;nbsp;item&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6897bb;&quot;&gt;60&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #cc7832;&quot;&gt;and&lt;/span&gt;&amp;nbsp;item&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;&amp;lt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6897bb;&quot;&gt;70&lt;/span&gt;:&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;result&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6897bb;&quot;&gt;6&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #cc7832;&quot;&gt;elif&lt;/span&gt;&amp;nbsp;item&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6897bb;&quot;&gt;70&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #cc7832;&quot;&gt;and&lt;/span&gt;&amp;nbsp;item&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6897bb;&quot;&gt;80&lt;/span&gt;:&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;result&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6897bb;&quot;&gt;7&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #cc7832;&quot;&gt;elif&lt;/span&gt;&amp;nbsp;item&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;&amp;gt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6897bb;&quot;&gt;80&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #cc7832;&quot;&gt;and&lt;/span&gt;&amp;nbsp;item&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;&amp;lt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6897bb;&quot;&gt;90&lt;/span&gt;:&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;result&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6897bb;&quot;&gt;8&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #cc7832;&quot;&gt;else&lt;/span&gt;:&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;result&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6897bb;&quot;&gt;99&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;dfs[dfName][&lt;span style=&quot;color: #6a8759;&quot;&gt;'data'&lt;/span&gt;].loc[index,&amp;nbsp;&lt;span style=&quot;color: #6a8759;&quot;&gt;'ca_Age'&lt;/span&gt;]&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;result&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: right; margin-top: -13px; margin-right: 5px; font-size: 9px; font-style: italic;&quot;&gt;&lt;a style=&quot;color: #4f4f4ftext-decoration:none;&quot; href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Colored by Color Scripter&lt;/a&gt;&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;vertical-align: bottom; padding: 0 2px 4px 0;&quot;&gt;&lt;a style=&quot;text-decoration: none; color: white;&quot; href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;&lt;span style=&quot;font-size: 9px; word-break: normal; background-color: #4f4f4f; color: white; border-radius: 10px; padding: 1px;&quot;&gt;cs&lt;/span&gt;&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&lt;b&gt;2. 성별,탑승지,존칭,성 범주화&lt;/b&gt;&lt;/p&gt;
&lt;div class=&quot;colorscripter-code&quot; style=&quot;color: #a9b7c6; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; position: relative !important; overflow: auto;&quot;&gt;
&lt;table class=&quot;colorscripter-code-table&quot; style=&quot;margin: 0; padding: 0; border: none; background-color: #2b2b2b; border-radius: 4px;&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; data-ke-align=&quot;alignLeft&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&quot;padding: 6px; border-right: 2px solid #4f4f4f;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; word-break: normal; text-align: right; color: #aaa; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;1&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;2&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;3&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;4&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;5&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;6&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;7&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;8&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;9&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;10&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;11&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;12&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;13&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;14&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;15&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;16&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;17&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;18&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;19&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;20&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;21&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;padding: 6px 0; text-align: left;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; color: #a9b7c6; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;for&lt;/span&gt;&amp;nbsp;dfName&amp;nbsp;&lt;span style=&quot;color: #cc7832;&quot;&gt;in&lt;/span&gt;&amp;nbsp;dfs.keys():&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;df&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;dfs[dfName][&lt;span style=&quot;color: #6a8759;&quot;&gt;'data'&lt;/span&gt;]&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #808080;&quot;&gt;#&amp;nbsp;성별&amp;nbsp;범주화&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;df.loc[&amp;nbsp;df[&lt;span style=&quot;color: #6a8759;&quot;&gt;'Sex'&lt;/span&gt;]&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6a8759;&quot;&gt;'male'&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #6a8759;&quot;&gt;'ca_Sex'&lt;/span&gt;]&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6897bb;&quot;&gt;0&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;df.loc[&amp;nbsp;df[&lt;span style=&quot;color: #6a8759;&quot;&gt;'Sex'&lt;/span&gt;]&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6a8759;&quot;&gt;'female'&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #6a8759;&quot;&gt;'ca_Sex'&lt;/span&gt;]&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6897bb;&quot;&gt;1&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #808080;&quot;&gt;#&amp;nbsp;탑승지&amp;nbsp;범주화&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;df.loc[&amp;nbsp;df[&lt;span style=&quot;color: #6a8759;&quot;&gt;'Embarked'&lt;/span&gt;]&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6a8759;&quot;&gt;'C'&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #6a8759;&quot;&gt;'ca_Embarked'&lt;/span&gt;]&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6897bb;&quot;&gt;0&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;df.loc[&amp;nbsp;df[&lt;span style=&quot;color: #6a8759;&quot;&gt;'Embarked'&lt;/span&gt;]&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6a8759;&quot;&gt;'Q'&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #6a8759;&quot;&gt;'ca_Embarked'&lt;/span&gt;]&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6897bb;&quot;&gt;1&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;df.loc[&amp;nbsp;df[&lt;span style=&quot;color: #6a8759;&quot;&gt;'Embarked'&lt;/span&gt;]&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6a8759;&quot;&gt;'S'&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #6a8759;&quot;&gt;'ca_Embarked'&lt;/span&gt;]&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6897bb;&quot;&gt;2&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #808080;&quot;&gt;#&amp;nbsp;존칭,&amp;nbsp;성&amp;nbsp;출력&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;df[&lt;span style=&quot;color: #6a8759;&quot;&gt;'designation'&lt;/span&gt;]&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;df[&lt;span style=&quot;color: #6a8759;&quot;&gt;'Name'&lt;/span&gt;].&lt;span style=&quot;color: #8888c6;&quot;&gt;str&lt;/span&gt;.extract(&lt;span style=&quot;color: #6a8759;&quot;&gt;'&amp;nbsp;(\w*)\.'&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;df[&lt;span style=&quot;color: #6a8759;&quot;&gt;'lastName'&lt;/span&gt;]&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;df[&lt;span style=&quot;color: #6a8759;&quot;&gt;'Name'&lt;/span&gt;].&lt;span style=&quot;color: #8888c6;&quot;&gt;str&lt;/span&gt;.extract(&lt;span style=&quot;color: #6a8759;&quot;&gt;'\.+&amp;nbsp;\(?([\w]*)'&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;encoder&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;LabelEncoder()&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;encoder.fit(df[&lt;span style=&quot;color: #6a8759;&quot;&gt;'designation'&lt;/span&gt;])&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;labels&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;encoder.transform(df[&lt;span style=&quot;color: #6a8759;&quot;&gt;'designation'&lt;/span&gt;])&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;df[&lt;span style=&quot;color: #6a8759;&quot;&gt;'ca_designation'&lt;/span&gt;]&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;labels&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;vertical-align: bottom; padding: 0 2px 4px 0;&quot;&gt;&lt;a style=&quot;text-decoration: none; color: white;&quot; href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;&lt;span style=&quot;font-size: 9px; word-break: normal; background-color: #4f4f4f; color: white; border-radius: 10px; padding: 1px;&quot;&gt;cs&lt;/span&gt;&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;보기 쉽게 하기 위해 for문을 나눠서 사용했다.&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&lt;b&gt;3. 나이 대체&lt;/b&gt;&lt;/p&gt;
&lt;div class=&quot;colorscripter-code&quot; style=&quot;color: #a9b7c6; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; position: relative !important; overflow: auto;&quot;&gt;
&lt;table class=&quot;colorscripter-code-table&quot; style=&quot;margin: 0; padding: 0; border: none; background-color: #2b2b2b; border-radius: 4px;&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; data-ke-align=&quot;alignLeft&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&quot;padding: 6px; border-right: 2px solid #4f4f4f;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; word-break: normal; text-align: right; color: #aaa; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;1&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;2&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;3&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;4&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;5&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;6&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;7&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;8&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;9&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;10&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;11&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;12&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;13&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;14&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;15&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;16&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;17&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;18&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;19&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;20&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;21&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;22&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;23&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;24&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;padding: 6px 0; text-align: left;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; color: #a9b7c6; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;for&lt;/span&gt;&amp;nbsp;dfName&amp;nbsp;&lt;span style=&quot;color: #cc7832;&quot;&gt;in&lt;/span&gt;&amp;nbsp;dfs.keys():&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;gTrain&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;dfs[dfName][&lt;span style=&quot;color: #6a8759;&quot;&gt;'data'&lt;/span&gt;].groupby([&lt;span style=&quot;color: #6a8759;&quot;&gt;'designation'&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #6a8759;&quot;&gt;'Sex'&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #6a8759;&quot;&gt;'Pclass'&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #6a8759;&quot;&gt;'SibSp'&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #6a8759;&quot;&gt;'Parch'&lt;/span&gt;])&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #808080;&quot;&gt;#&amp;nbsp;gTrain.describe()[['Age','Survived']]&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;dfs[dfName][&lt;span style=&quot;color: #6a8759;&quot;&gt;'gAge'&lt;/span&gt;]&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;gTrain.describe()[&lt;span style=&quot;color: #6a8759;&quot;&gt;'Age'&lt;/span&gt;]&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;gAge&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;dfs[dfName][&lt;span style=&quot;color: #6a8759;&quot;&gt;'gAge'&lt;/span&gt;]&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #cc7832;&quot;&gt;for&lt;/span&gt;&amp;nbsp;item&amp;nbsp;&lt;span style=&quot;color: #cc7832;&quot;&gt;in&lt;/span&gt;&amp;nbsp;dfs[dfName][&lt;span style=&quot;color: #6a8759;&quot;&gt;'data'&lt;/span&gt;].iterrows():&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;temp&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;item[&lt;span style=&quot;color: #6897bb;&quot;&gt;1&lt;/span&gt;]&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;guessAge&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;gAge.loc[temp[&lt;span style=&quot;color: #6a8759;&quot;&gt;'designation'&lt;/span&gt;],&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;temp[&lt;span style=&quot;color: #6a8759;&quot;&gt;'Sex'&lt;/span&gt;],&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;temp[&lt;span style=&quot;color: #6a8759;&quot;&gt;'Pclass'&lt;/span&gt;],&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;temp[&lt;span style=&quot;color: #6a8759;&quot;&gt;'SibSp'&lt;/span&gt;],&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;temp[&lt;span style=&quot;color: #6a8759;&quot;&gt;'Parch'&lt;/span&gt;]]&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #cc7832;&quot;&gt;if&lt;/span&gt;&amp;nbsp;(math.isnan(guessAge[&lt;span style=&quot;color: #6a8759;&quot;&gt;'mean'&lt;/span&gt;])):&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;guessAge&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;gAge.loc[temp[&lt;span style=&quot;color: #6a8759;&quot;&gt;'designation'&lt;/span&gt;],&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;temp[&lt;span style=&quot;color: #6a8759;&quot;&gt;'Sex'&lt;/span&gt;]].mean()&lt;br /&gt;&lt;span style=&quot;background-color: #2b2b2b; color: #808080;&quot;&gt; # 테스트셋에 예측한 카테고리별 평균이 없는 경우 트레인셋에서 카테고리의 평균을 사용&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #cc7832;&quot;&gt;if&lt;/span&gt;&amp;nbsp;(math.isnan(guessAge[&lt;span style=&quot;color: #6a8759;&quot;&gt;'mean'&lt;/span&gt;])):&lt;span style=&quot;background-color: #2b2b2b; color: #a9b7c6;&quot;&gt; &lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;guessAge&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;dfs[&lt;span style=&quot;color: #6a8759;&quot;&gt;'train'&lt;/span&gt;][&lt;span style=&quot;color: #6a8759;&quot;&gt;'gAge'&lt;/span&gt;].loc[temp[&lt;span style=&quot;color: #6a8759;&quot;&gt;'designation'&lt;/span&gt;],&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;temp[&lt;span style=&quot;color: #6a8759;&quot;&gt;'Sex'&lt;/span&gt;]].mean()&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;dfs[dfName][&lt;span style=&quot;color: #6a8759;&quot;&gt;'data'&lt;/span&gt;].loc[item[&lt;span style=&quot;color: #6897bb;&quot;&gt;0&lt;/span&gt;],&amp;nbsp;&lt;span style=&quot;color: #6a8759;&quot;&gt;'guessAgeMean'&lt;/span&gt;]&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;round(guessAge[&lt;span style=&quot;color: #6a8759;&quot;&gt;'mean'&lt;/span&gt;],&amp;nbsp;&lt;span style=&quot;color: #6897bb;&quot;&gt;2&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;dfs[dfName][&lt;span style=&quot;color: #6a8759;&quot;&gt;'data'&lt;/span&gt;].loc[item[&lt;span style=&quot;color: #6897bb;&quot;&gt;0&lt;/span&gt;],&amp;nbsp;&lt;span style=&quot;color: #6a8759;&quot;&gt;'guessAgeMedian'&lt;/span&gt;]&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;round(guessAge[&lt;span style=&quot;color: #6a8759;&quot;&gt;'50%'&lt;/span&gt;],&amp;nbsp;&lt;span style=&quot;color: #6897bb;&quot;&gt;2&lt;/span&gt;)&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;vertical-align: bottom; padding: 0 2px 4px 0;&quot;&gt;&lt;a style=&quot;text-decoration: none; color: white;&quot; href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;&lt;span style=&quot;font-size: 9px; word-break: normal; background-color: #4f4f4f; color: white; border-radius: 10px; padding: 1px;&quot;&gt;cs&lt;/span&gt;&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;평균으로 대체하려했지만 테스트셋에 예측한 카테고리별 평균이 없는 경우 트레인셋에서의 카테고리로 평균을 대체 사용하였다.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignLeft&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;336&quot; data-origin-height=&quot;761&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/nwn5Y/btrV5WtG6v3/My7WAwgjlDsRfaGtCDJDf0/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/nwn5Y/btrV5WtG6v3/My7WAwgjlDsRfaGtCDJDf0/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/nwn5Y/btrV5WtG6v3/My7WAwgjlDsRfaGtCDJDf0/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2Fnwn5Y%2FbtrV5WtG6v3%2FMy7WAwgjlDsRfaGtCDJDf0%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;336&quot; height=&quot;761&quot; data-origin-width=&quot;336&quot; data-origin-height=&quot;761&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;파생변수의 결측치가 없음을 확인하고&lt;/li&gt;
&lt;li&gt;기존 나이와 요금을 결측치 처리할 예정이다.&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;div class=&quot;colorscripter-code&quot; style=&quot;color: #a9b7c6; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; position: relative !important; overflow: auto;&quot;&gt;
&lt;table class=&quot;colorscripter-code-table&quot; style=&quot;margin: 0; padding: 0; border: none; background-color: #2b2b2b; border-radius: 4px;&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; data-ke-align=&quot;alignLeft&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&quot;padding: 6px; border-right: 2px solid #4f4f4f;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; word-break: normal; text-align: right; color: #aaa; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;1&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;2&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;3&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;4&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;5&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;6&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;padding: 6px 0; text-align: left;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; color: #a9b7c6; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;for&lt;/span&gt;&amp;nbsp;dfName&amp;nbsp;&lt;span style=&quot;color: #cc7832;&quot;&gt;in&lt;/span&gt;&amp;nbsp;dfs.keys():&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;df&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;dfs[dfName][&lt;span style=&quot;color: #6a8759;&quot;&gt;'data'&lt;/span&gt;]&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #cc7832;&quot;&gt;for&lt;/span&gt;&amp;nbsp;index,&amp;nbsp;item&amp;nbsp;&lt;span style=&quot;color: #cc7832;&quot;&gt;in&lt;/span&gt;&amp;nbsp;enumerate(df[&lt;span style=&quot;color: #6a8759;&quot;&gt;'Age'&lt;/span&gt;]):&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #cc7832;&quot;&gt;if&lt;/span&gt;(math.isnan(item)):&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;df.loc[index,&amp;nbsp;&lt;span style=&quot;color: #6a8759;&quot;&gt;'Age'&lt;/span&gt;]&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;df.loc[index,&amp;nbsp;&lt;span style=&quot;color: #6a8759;&quot;&gt;'guessAgeMean'&lt;/span&gt;]&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: right; margin-top: -13px; margin-right: 5px; font-size: 9px; font-style: italic;&quot;&gt;&lt;a style=&quot;color: #4f4f4ftext-decoration:none;&quot; href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Colored by Color Scripter&lt;/a&gt;&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;vertical-align: bottom; padding: 0 2px 4px 0;&quot;&gt;&lt;a style=&quot;text-decoration: none; color: white;&quot; href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;&lt;span style=&quot;font-size: 9px; word-break: normal; background-color: #4f4f4f; color: white; border-radius: 10px; padding: 1px;&quot;&gt;cs&lt;/span&gt;&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;&lt;span&gt;나이&lt;span&gt; 중&amp;nbsp;&lt;/span&gt;&lt;/span&gt;결측치 대체&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;div class=&quot;colorscripter-code&quot; style=&quot;color: #a9b7c6; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; position: relative !important; overflow: auto;&quot;&gt;
&lt;div class=&quot;colorscripter-code&quot; style=&quot;color: #a9b7c6; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; position: relative !important; overflow: auto;&quot;&gt;
&lt;table class=&quot;colorscripter-code-table&quot; style=&quot;margin: 0; padding: 0; border: none; background-color: #2b2b2b; border-radius: 4px;&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; data-ke-align=&quot;alignLeft&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&quot;padding: 6px; border-right: 2px solid #4f4f4f;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; word-break: normal; text-align: right; color: #aaa; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;1&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;2&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;3&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;4&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;5&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;6&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;7&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;8&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;9&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;10&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;11&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;12&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;13&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;14&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;15&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;16&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;17&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;18&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;19&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;20&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;21&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;22&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;23&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;24&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;25&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;26&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;padding: 6px 0; text-align: left;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; color: #a9b7c6; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;for&lt;/span&gt;&amp;nbsp;dfName&amp;nbsp;&lt;span style=&quot;color: #cc7832;&quot;&gt;in&lt;/span&gt;&amp;nbsp;dfs.keys():&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;df&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;dfs[dfName][&lt;span style=&quot;color: #6a8759;&quot;&gt;'data'&lt;/span&gt;]&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #cc7832;&quot;&gt;for&lt;/span&gt;&amp;nbsp;index,&amp;nbsp;item&amp;nbsp;&lt;span style=&quot;color: #cc7832;&quot;&gt;in&lt;/span&gt;&amp;nbsp;enumerate(df[&lt;span style=&quot;color: #6a8759;&quot;&gt;'ca_Age'&lt;/span&gt;]):&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #cc7832;&quot;&gt;if&lt;/span&gt;(item&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6897bb;&quot;&gt;99&lt;/span&gt;):&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;age&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;df.loc[index,&amp;nbsp;&lt;span style=&quot;color: #6a8759;&quot;&gt;'Age'&lt;/span&gt;]&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #cc7832;&quot;&gt;if&lt;/span&gt;&amp;nbsp;age&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;&amp;lt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6897bb;&quot;&gt;10&lt;/span&gt;:&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;result&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6897bb;&quot;&gt;0&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #cc7832;&quot;&gt;elif&lt;/span&gt;&amp;nbsp;age&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6897bb;&quot;&gt;10&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #cc7832;&quot;&gt;and&lt;/span&gt;&amp;nbsp;age&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;&amp;lt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6897bb;&quot;&gt;20&lt;/span&gt;:&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;result&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6897bb;&quot;&gt;1&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #cc7832;&quot;&gt;elif&lt;/span&gt;&amp;nbsp;age&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6897bb;&quot;&gt;20&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #cc7832;&quot;&gt;and&lt;/span&gt;&amp;nbsp;age&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;&amp;lt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6897bb;&quot;&gt;30&lt;/span&gt;:&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;result&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6897bb;&quot;&gt;2&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #cc7832;&quot;&gt;elif&lt;/span&gt;&amp;nbsp;age&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6897bb;&quot;&gt;30&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #cc7832;&quot;&gt;and&lt;/span&gt;&amp;nbsp;age&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;&amp;lt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6897bb;&quot;&gt;40&lt;/span&gt;:&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;result&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6897bb;&quot;&gt;3&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #cc7832;&quot;&gt;elif&lt;/span&gt;&amp;nbsp;age&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6897bb;&quot;&gt;40&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #cc7832;&quot;&gt;and&lt;/span&gt;&amp;nbsp;age&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;&amp;lt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6897bb;&quot;&gt;50&lt;/span&gt;:&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;result&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6897bb;&quot;&gt;4&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #cc7832;&quot;&gt;elif&lt;/span&gt;&amp;nbsp;age&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6897bb;&quot;&gt;50&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #cc7832;&quot;&gt;and&lt;/span&gt;&amp;nbsp;age&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;&amp;lt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6897bb;&quot;&gt;60&lt;/span&gt;:&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;result&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6897bb;&quot;&gt;5&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #cc7832;&quot;&gt;elif&lt;/span&gt;&amp;nbsp;age&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6897bb;&quot;&gt;60&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #cc7832;&quot;&gt;and&lt;/span&gt;&amp;nbsp;age&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;&amp;lt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6897bb;&quot;&gt;70&lt;/span&gt;:&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;result&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6897bb;&quot;&gt;6&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #cc7832;&quot;&gt;elif&lt;/span&gt;&amp;nbsp;age&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6897bb;&quot;&gt;70&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #cc7832;&quot;&gt;and&lt;/span&gt;&amp;nbsp;age&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6897bb;&quot;&gt;80&lt;/span&gt;:&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;result&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6897bb;&quot;&gt;7&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #cc7832;&quot;&gt;elif&lt;/span&gt;&amp;nbsp;age&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;&amp;gt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6897bb;&quot;&gt;80&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #cc7832;&quot;&gt;and&lt;/span&gt;&amp;nbsp;age&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;&amp;lt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6897bb;&quot;&gt;90&lt;/span&gt;:&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;result&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6897bb;&quot;&gt;8&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;df.loc[index,&amp;nbsp;&lt;span style=&quot;color: #6a8759;&quot;&gt;'ca_Age'&lt;/span&gt;]&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;result&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: right; margin-top: -13px; margin-right: 5px; font-size: 9px; font-style: italic;&quot;&gt;&lt;a style=&quot;color: #4f4f4ftext-decoration:none;&quot; href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Colored by Color Scripter&lt;/a&gt;&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;vertical-align: bottom; padding: 0 2px 4px 0;&quot;&gt;&lt;a style=&quot;text-decoration: none; color: white;&quot; href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;&lt;span style=&quot;font-size: 9px; word-break: normal; background-color: #4f4f4f; color: white; border-radius: 10px; padding: 1px;&quot;&gt;cs&lt;/span&gt;&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;범주화한 나이에 결측치를 99로 처리했던 값들을 다시 새로 범주화한다.&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-ke-size=&quot;size14&quot;&gt;&lt;b&gt;4. 다른 컬럼의 결측치 처리&lt;/b&gt;&lt;/p&gt;
&lt;div class=&quot;colorscripter-code&quot; style=&quot;color: #a9b7c6; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; position: relative !important; overflow: auto;&quot;&gt;
&lt;table class=&quot;colorscripter-code-table&quot; style=&quot;margin: 0; padding: 0; border: none; background-color: #2b2b2b; border-radius: 4px;&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; data-ke-align=&quot;alignLeft&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&quot;padding: 6px; border-right: 2px solid #4f4f4f;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; word-break: normal; text-align: right; color: #aaa; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;1&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;2&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;3&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;4&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;padding: 6px 0; text-align: left;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; color: #a9b7c6; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;dfs[&lt;span style=&quot;color: #6a8759;&quot;&gt;'train'&lt;/span&gt;][&lt;span style=&quot;color: #6a8759;&quot;&gt;'data'&lt;/span&gt;][&lt;span style=&quot;color: #6a8759;&quot;&gt;'Embarked'&lt;/span&gt;].fillna(&lt;span style=&quot;color: #6a8759;&quot;&gt;&quot;S&quot;&lt;/span&gt;,&amp;nbsp;inplace&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #8888c6;&quot;&gt;True&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;dfs[&lt;span style=&quot;color: #6a8759;&quot;&gt;'train'&lt;/span&gt;][&lt;span style=&quot;color: #6a8759;&quot;&gt;'data'&lt;/span&gt;][&lt;span style=&quot;color: #6a8759;&quot;&gt;'ca_Embarked'&lt;/span&gt;].fillna(&lt;span style=&quot;color: #6a8759;&quot;&gt;&quot;2&quot;&lt;/span&gt;,&amp;nbsp;inplace&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #8888c6;&quot;&gt;True&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;test.loc[test[&lt;span style=&quot;color: #6a8759;&quot;&gt;'Fare'&lt;/span&gt;].isna(),&amp;nbsp;&lt;span style=&quot;color: #6a8759;&quot;&gt;'Fare'&lt;/span&gt;]&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;test[&lt;span style=&quot;color: #6a8759;&quot;&gt;'Fare'&lt;/span&gt;].median()&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;vertical-align: bottom; padding: 0 2px 4px 0;&quot;&gt;&lt;a style=&quot;text-decoration: none; color: white;&quot; href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;&lt;span style=&quot;font-size: 9px; word-break: normal; background-color: #4f4f4f; color: white; border-radius: 10px; padding: 1px;&quot;&gt;cs&lt;/span&gt;&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;train 데이터셋과 test 데이터셋에 있는 각각의 결측치를 최빈값과 중앙값으로 대체한다.&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignLeft&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;349&quot; data-origin-height=&quot;740&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/IOfDL/btrV5fm2LkV/9BFr1sO9xJfNuohl6Wkv50/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/IOfDL/btrV5fm2LkV/9BFr1sO9xJfNuohl6Wkv50/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/IOfDL/btrV5fm2LkV/9BFr1sO9xJfNuohl6Wkv50/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FIOfDL%2FbtrV5fm2LkV%2F9BFr1sO9xJfNuohl6Wkv50%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;349&quot; height=&quot;740&quot; data-origin-width=&quot;349&quot; data-origin-height=&quot;740&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;결측치를 다시 한번 확인한 후&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-ke-size=&quot;size14&quot;&gt;&lt;b&gt;5. 내보내기&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignLeft&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;849&quot; data-origin-height=&quot;179&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/Urdo0/btrV56C6TSq/Dwb19BEDVphkAk2t1kiUI1/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/Urdo0/btrV56C6TSq/Dwb19BEDVphkAk2t1kiUI1/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/Urdo0/btrV56C6TSq/Dwb19BEDVphkAk2t1kiUI1/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FUrdo0%2FbtrV56C6TSq%2FDwb19BEDVphkAk2t1kiUI1%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;849&quot; height=&quot;179&quot; data-origin-width=&quot;849&quot; data-origin-height=&quot;179&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;Cabin 컬럼을 drop하고 noNa_train.csv, noNa_test.csv로 저장한다.&lt;/li&gt;
&lt;/ul&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style7&quot; /&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&lt;b&gt;다음 포스트&lt;/b&gt;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&lt;a href=&quot;https://drewvvv.tistory.com/19&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;2023.01.18 - [Kaggle/타이타닉] - 타이타닉 생존자 예측 분석 (3-3) 데이터 인코딩 - v.1.0.1&lt;/a&gt;&lt;/p&gt;
&lt;figure id=&quot;og_1674027076954&quot; contenteditable=&quot;false&quot; data-ke-type=&quot;opengraph&quot; data-ke-align=&quot;alignCenter&quot; data-og-type=&quot;article&quot; data-og-title=&quot;타이타닉 생존자 예측 분석 (3-3) 데이터 인코딩 - v.1.0.1&quot; data-og-description=&quot;이전 포스트 2023.01.12 - [분류 전체보기] - 타이타닉 생존자 예측 분석 (3-2) 데이터 정리 - v.1.0.1 타이타닉 생존자 예측 분석 (3-2) 데이터 정리 - v.1.0.1 이전 포스트 2023.01.09 - [Kaggle/타이타닉] - 타이&quot; data-og-host=&quot;drewvvv.tistory.com&quot; data-og-source-url=&quot;https://drewvvv.tistory.com/19&quot; data-og-url=&quot;https://drewvvv.tistory.com/19&quot; data-og-image=&quot;https://scrap.kakaocdn.net/dn/c3dPVD/hyRkjNbfYj/ubc8O7jTVI3HKFJ9f8JoXK/img.png?width=800&amp;amp;height=275&amp;amp;face=0_0_800_275,https://scrap.kakaocdn.net/dn/bRYAuI/hyRku8ZIZp/WU0Ae5wtktGc1PIg0GTPbk/img.png?width=800&amp;amp;height=275&amp;amp;face=0_0_800_275,https://scrap.kakaocdn.net/dn/cGad8E/hyRi8Nf6t0/i2KhqdAEFtr20IFI88Ugr1/img.png?width=1730&amp;amp;height=595&amp;amp;face=0_0_1730_595&quot;&gt;&lt;a href=&quot;https://drewvvv.tistory.com/19&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot; data-source-url=&quot;https://drewvvv.tistory.com/19&quot;&gt;
&lt;div class=&quot;og-image&quot; style=&quot;background-image: url('https://scrap.kakaocdn.net/dn/c3dPVD/hyRkjNbfYj/ubc8O7jTVI3HKFJ9f8JoXK/img.png?width=800&amp;amp;height=275&amp;amp;face=0_0_800_275,https://scrap.kakaocdn.net/dn/bRYAuI/hyRku8ZIZp/WU0Ae5wtktGc1PIg0GTPbk/img.png?width=800&amp;amp;height=275&amp;amp;face=0_0_800_275,https://scrap.kakaocdn.net/dn/cGad8E/hyRi8Nf6t0/i2KhqdAEFtr20IFI88Ugr1/img.png?width=1730&amp;amp;height=595&amp;amp;face=0_0_1730_595');&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;og-text&quot;&gt;
&lt;p class=&quot;og-title&quot; data-ke-size=&quot;size16&quot;&gt;타이타닉 생존자 예측 분석 (3-3) 데이터 인코딩 - v.1.0.1&lt;/p&gt;
&lt;p class=&quot;og-desc&quot; data-ke-size=&quot;size16&quot;&gt;이전 포스트 2023.01.12 - [분류 전체보기] - 타이타닉 생존자 예측 분석 (3-2) 데이터 정리 - v.1.0.1 타이타닉 생존자 예측 분석 (3-2) 데이터 정리 - v.1.0.1 이전 포스트 2023.01.09 - [Kaggle/타이타닉] - 타이&lt;/p&gt;
&lt;p class=&quot;og-host&quot; data-ke-size=&quot;size16&quot;&gt;drewvvv.tistory.com&lt;/p&gt;
&lt;/div&gt;
&lt;/a&gt;&lt;/figure&gt;
&lt;div id=&quot;dicLayerLoader&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div id=&quot;dicLayer&quot; style=&quot;display: none;&quot;&gt;
&lt;div id=&quot;dicLayerContents&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div id=&quot;dicLayerSub&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;/div&gt;
&lt;div id=&quot;dicRawData&quot; style=&quot;display: none;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div id=&quot;dicLayerLoader&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div id=&quot;dicLayer&quot;&gt;
&lt;div id=&quot;dicLayerContents&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div id=&quot;dicLayerSub&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;/div&gt;
&lt;div id=&quot;dicRawData&quot; style=&quot;display: none;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div id=&quot;dicLayerLoader&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div id=&quot;dicLayer&quot;&gt;
&lt;div id=&quot;dicLayerContents&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div id=&quot;dicLayerSub&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;/div&gt;
&lt;div id=&quot;dicRawData&quot; style=&quot;display: none;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div id=&quot;dicLayerLoader&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div id=&quot;dicLayer&quot;&gt;
&lt;div id=&quot;dicLayerContents&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div id=&quot;dicLayerSub&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;/div&gt;
&lt;div id=&quot;dicRawData&quot; style=&quot;display: none;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div id=&quot;dicLayerLoader&quot;&gt;&amp;nbsp;&lt;/div&gt;</description>
      <category>Kaggle/타이타닉</category>
      <author>qwer.ty_v</author>
      <guid isPermaLink="true">https://drewvvv.tistory.com/18</guid>
      <comments>https://drewvvv.tistory.com/18#entry18comment</comments>
      <pubDate>Thu, 12 Jan 2023 14:59:04 +0900</pubDate>
    </item>
    <item>
      <title>타이타닉 생존자 예측 분석 (3-1) 전처리 (나이예측) - v.1.0.1</title>
      <link>https://drewvvv.tistory.com/17</link>
      <description>&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&lt;b&gt;이전 포스트&lt;/b&gt;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;div id=&quot;dicLayer&quot; style=&quot;color: #000000; font-size: 12px; font-family: Arial; background: -webkit-linear-gradient(bottom, #ffeb00, #ffdc00); width: 400px; height: 150px; display: none;&quot;&gt;
&lt;div id=&quot;dicLayerContents&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div id=&quot;dicLayerSub&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;/div&gt;
&lt;div id=&quot;dicRawData&quot; style=&quot;display: none;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&lt;a href=&quot;https://drewvvv.tistory.com/16&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;2023.01.09 - [분류 전체보기] - 타이타닉 생존자 예측 분석 (2-3) EDA(상관관계 및 기타) - v.1.0.1&lt;/a&gt;&lt;/p&gt;
&lt;figure id=&quot;og_1673251659163&quot; contenteditable=&quot;false&quot; data-ke-type=&quot;opengraph&quot; data-ke-align=&quot;alignCenter&quot; data-og-type=&quot;article&quot; data-og-title=&quot;타이타닉 생존자 예측 분석 (2-3) EDA(상관관계 및 기타) - v.1.0.1&quot; data-og-description=&quot;이전 포스트 타이타닉 생존자 예측 분석 (2-2) EDA(연령대별) - v.1.0.1 이전 포스트 타이타닉 생존자 예측 분석 (2-1) EDA(성별) - v.1.0.1 - 개요 우선 데이터 사이언티스트 (이하 DS)의 꿈을 가장 크게 꾸&quot; data-og-host=&quot;drewvvv.tistory.com&quot; data-og-source-url=&quot;https://drewvvv.tistory.com/16&quot; data-og-url=&quot;https://drewvvv.tistory.com/16&quot; data-og-image=&quot;https://scrap.kakaocdn.net/dn/cibczK/hyRdR4Gm0C/HU4H0umvy8O1X8CLJVOoW0/img.png?width=800&amp;amp;height=807&amp;amp;face=0_0_800_807,https://scrap.kakaocdn.net/dn/chr9Q0/hyRdFXm7Og/6uVJKjd2rWhRPxOGnZGG3K/img.png?width=921&amp;amp;height=807&amp;amp;face=0_0_921_807&quot;&gt;&lt;a href=&quot;https://drewvvv.tistory.com/16&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot; data-source-url=&quot;https://drewvvv.tistory.com/16&quot;&gt;
&lt;div class=&quot;og-image&quot; style=&quot;background-image: url('https://scrap.kakaocdn.net/dn/cibczK/hyRdR4Gm0C/HU4H0umvy8O1X8CLJVOoW0/img.png?width=800&amp;amp;height=807&amp;amp;face=0_0_800_807,https://scrap.kakaocdn.net/dn/chr9Q0/hyRdFXm7Og/6uVJKjd2rWhRPxOGnZGG3K/img.png?width=921&amp;amp;height=807&amp;amp;face=0_0_921_807');&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;og-text&quot;&gt;
&lt;p class=&quot;og-title&quot; data-ke-size=&quot;size16&quot;&gt;타이타닉 생존자 예측 분석 (2-3) EDA(상관관계 및 기타) - v.1.0.1&lt;/p&gt;
&lt;p class=&quot;og-desc&quot; data-ke-size=&quot;size16&quot;&gt;이전 포스트 타이타닉 생존자 예측 분석 (2-2) EDA(연령대별) - v.1.0.1 이전 포스트 타이타닉 생존자 예측 분석 (2-1) EDA(성별) - v.1.0.1 - 개요 우선 데이터 사이언티스트 (이하 DS)의 꿈을 가장 크게 꾸&lt;/p&gt;
&lt;p class=&quot;og-host&quot; data-ke-size=&quot;size16&quot;&gt;drewvvv.tistory.com&lt;/p&gt;
&lt;/div&gt;
&lt;/a&gt;&lt;/figure&gt;
&lt;div id=&quot;dicLayerLoader&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style7&quot; /&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;div id=&quot;dicLayer&quot;&gt;
&lt;div id=&quot;dicLayerContents&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div id=&quot;dicLayerSub&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;/div&gt;
&lt;div id=&quot;dicRawData&quot; style=&quot;display: none;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;1. 결측치 처리&lt;/h3&gt;
&lt;div id=&quot;dicLayerLoader&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;우선 타이타닉 데이터셋에서 결측치를 확인해보았다.&lt;/p&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignLeft&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;494&quot; data-origin-height=&quot;461&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/dNu8w0/btrVI6kZ8gt/nwOzvbRTjBQIIYna6ZC1Kk/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/dNu8w0/btrVI6kZ8gt/nwOzvbRTjBQIIYna6ZC1Kk/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/dNu8w0/btrVI6kZ8gt/nwOzvbRTjBQIIYna6ZC1Kk/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FdNu8w0%2FbtrVI6kZ8gt%2FnwOzvbRTjBQIIYna6ZC1Kk%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;494&quot; height=&quot;461&quot; data-origin-width=&quot;494&quot; data-origin-height=&quot;461&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;나이의 경우 전체 891개 (트레인 데이터셋) 에서 177개의 결측치를 보였다.&lt;/li&gt;
&lt;li&gt;따라 다양한 결측치 처리 법 중 대체를 통해 나이의 결측치를&amp;nbsp; 채우도록 하겠다.&lt;/li&gt;
&lt;li&gt;우선 정렬을 해가며 데이터를 확인해보았을 때,&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;1345&quot; data-origin-height=&quot;526&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/pPSFa/btrVRDgTVAY/KbAKIg80OZ1K6pkuatz0kK/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/pPSFa/btrVRDgTVAY/KbAKIg80OZ1K6pkuatz0kK/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/pPSFa/btrVRDgTVAY/KbAKIg80OZ1K6pkuatz0kK/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FpPSFa%2FbtrVRDgTVAY%2FKbAKIg80OZ1K6pkuatz0kK%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;1345&quot; height=&quot;526&quot; data-origin-width=&quot;1345&quot; data-origin-height=&quot;526&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;나이 순으로 정렬했을 때 이름에 Master, Miss가 들어가는 경우 16세 이하임을 확인할 수 있다.&lt;/li&gt;
&lt;li&gt;따라 이름에 Master나 Miss가 들어가는 경우 ca_Age를 0또는 1로 대부분 대체할 생각이다. (Miss가 들어가는데 나이가 많은 경우도 있기 때문)&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;colorscripter-code&quot; style=&quot;color: #a9b7c6; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; position: relative !important; overflow: auto;&quot;&gt;
&lt;table class=&quot;colorscripter-code-table&quot; style=&quot;margin: 0; padding: 0; border: none; background-color: #2b2b2b; border-radius: 4px;&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; data-ke-align=&quot;alignLeft&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&quot;padding: 6px; border-right: 2px solid #4f4f4f;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; word-break: normal; text-align: right; color: #aaa; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;1&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;2&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;3&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;padding: 6px 0; text-align: left;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; color: #a9b7c6; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;train[&lt;span style=&quot;color: #6a8759;&quot;&gt;'designation'&lt;/span&gt;]&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;train[&lt;span style=&quot;color: #6a8759;&quot;&gt;'Name'&lt;/span&gt;].&lt;span style=&quot;color: #8888c6;&quot;&gt;str&lt;/span&gt;.extract(&lt;span style=&quot;color: #6a8759;&quot;&gt;'&amp;nbsp;(\w*)\.'&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;train[&lt;span style=&quot;color: #6a8759;&quot;&gt;'lastName'&lt;/span&gt;]&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;train[&lt;span style=&quot;color: #6a8759;&quot;&gt;'Name'&lt;/span&gt;].&lt;span style=&quot;color: #8888c6;&quot;&gt;str&lt;/span&gt;.extract(&lt;span style=&quot;color: #6a8759;&quot;&gt;'\.+&amp;nbsp;\(?([\w]*)'&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;train[[&lt;span style=&quot;color: #6a8759;&quot;&gt;'Name'&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #6a8759;&quot;&gt;'designation'&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #6a8759;&quot;&gt;'lastName'&lt;/span&gt;]]&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;vertical-align: bottom; padding: 0 2px 4px 0;&quot;&gt;&lt;a style=&quot;text-decoration: none; color: white;&quot; href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;&lt;span style=&quot;font-size: 9px; word-break: normal; background-color: #4f4f4f; color: white; border-radius: 10px; padding: 1px;&quot;&gt;cs&lt;/span&gt;&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignLeft&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-filename=&quot;blob&quot; data-origin-width=&quot;500&quot; data-origin-height=&quot;329&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/TvhBD/btrVTVuIrRc/UfrT2FSCtRgveO0U9wbOD1/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/TvhBD/btrVTVuIrRc/UfrT2FSCtRgveO0U9wbOD1/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/TvhBD/btrVTVuIrRc/UfrT2FSCtRgveO0U9wbOD1/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FTvhBD%2FbtrVTVuIrRc%2FUfrT2FSCtRgveO0U9wbOD1%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;576&quot; height=&quot;380&quot; data-filename=&quot;blob&quot; data-origin-width=&quot;500&quot; data-origin-height=&quot;329&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;div&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;정규식을 활용해서 존칭과 성을 분류해보았다.&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignLeft&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;856&quot; data-origin-height=&quot;555&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/y7vgG/btrVNggvzyI/yp8eKkkZpJuzxKcdLavNZk/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/y7vgG/btrVNggvzyI/yp8eKkkZpJuzxKcdLavNZk/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/y7vgG/btrVNggvzyI/yp8eKkkZpJuzxKcdLavNZk/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2Fy7vgG%2FbtrVNggvzyI%2Fyp8eKkkZpJuzxKcdLavNZk%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;856&quot; height=&quot;555&quot; data-origin-width=&quot;856&quot; data-origin-height=&quot;555&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;존칭에서 위의 패턴을 사용하지 않는 사람들은 전체 중 24명이었다.&lt;/li&gt;
&lt;li&gt;대부분의 경우 위의 경우를 other로 하나로 취급해서 처리했지만, 우선 존칭을 그대로 활용해볼 생각이다.&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;div class=&quot;colorscripter-code&quot; style=&quot;color: #a9b7c6; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; position: relative !important; overflow: auto;&quot;&gt;
&lt;table class=&quot;colorscripter-code-table&quot; style=&quot;margin: 0; padding: 0; border: none; background-color: #2b2b2b; border-radius: 4px;&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; data-ke-align=&quot;alignLeft&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&quot;padding: 6px; border-right: 2px solid #4f4f4f;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; word-break: normal; text-align: right; color: #aaa; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;1&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;2&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;3&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;4&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;5&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;6&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;7&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;8&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;9&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;10&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;11&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;12&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;13&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;padding: 6px 0; text-align: left;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; color: #a9b7c6; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;orders&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;train[&lt;span style=&quot;color: #6a8759;&quot;&gt;'designation'&lt;/span&gt;].value_counts().index.tolist()&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;fig&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;plt.figure(figsize&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;(&lt;span style=&quot;color: #6897bb;&quot;&gt;16&lt;/span&gt;,&lt;span style=&quot;color: #6897bb;&quot;&gt;7&lt;/span&gt;))&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;area01&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;fig.add_subplot(&lt;span style=&quot;color: #6897bb;&quot;&gt;1&lt;/span&gt;,&lt;span style=&quot;color: #6897bb;&quot;&gt;2&lt;/span&gt;,&lt;span style=&quot;color: #6897bb;&quot;&gt;1&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;area02&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;fig.add_subplot(&lt;span style=&quot;color: #6897bb;&quot;&gt;1&lt;/span&gt;,&lt;span style=&quot;color: #6897bb;&quot;&gt;2&lt;/span&gt;,&lt;span style=&quot;color: #6897bb;&quot;&gt;2&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;ax1&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;sns.countplot(data&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;train,&amp;nbsp;x&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6a8759;&quot;&gt;&quot;designation&quot;&lt;/span&gt;,&amp;nbsp;hue&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #6a8759;&quot;&gt;&quot;Survived&quot;&lt;/span&gt;,&amp;nbsp;order&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;orders,&amp;nbsp;ax&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;area01)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;ax1.set_title(&lt;span style=&quot;color: #6a8759;&quot;&gt;'존칭별&amp;nbsp;인원(명)'&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;ax2&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;sns.barplot(data&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;train,&amp;nbsp;x&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6a8759;&quot;&gt;&quot;designation&quot;&lt;/span&gt;,&amp;nbsp;y&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6a8759;&quot;&gt;&quot;Survived&quot;&lt;/span&gt;,&amp;nbsp;hue&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #6a8759;&quot;&gt;&quot;Sex&quot;&lt;/span&gt;,&amp;nbsp;order&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;orders,&amp;nbsp;errwidth&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6897bb;&quot;&gt;0&lt;/span&gt;,&amp;nbsp;ax&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;area02)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;ax2.set_title(&lt;span style=&quot;color: #6a8759;&quot;&gt;'존칭별/성별&amp;nbsp;생존률'&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;plt.show()&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: right; margin-top: -13px; margin-right: 5px; font-size: 9px; font-style: italic;&quot;&gt;&lt;a style=&quot;color: #4f4f4ftext-decoration:none;&quot; href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Colored by Color Scripter&lt;/a&gt;&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;vertical-align: bottom; padding: 0 2px 4px 0;&quot;&gt;&lt;a style=&quot;text-decoration: none; color: white;&quot; href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;&lt;span style=&quot;font-size: 9px; word-break: normal; background-color: #4f4f4f; color: white; border-radius: 10px; padding: 1px;&quot;&gt;cs&lt;/span&gt;&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div id=&quot;dicLayer&quot;&gt;
&lt;div id=&quot;dicLayerSub&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;/div&gt;
&lt;div id=&quot;dicLayerLoader&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-filename=&quot;5. 존칭별-성별 생존률.png&quot; data-origin-width=&quot;1322&quot; data-origin-height=&quot;622&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/uEQUf/btrVTVPF94h/QfLXaIZJBgeC9Ws4oelbkK/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/uEQUf/btrVTVPF94h/QfLXaIZJBgeC9Ws4oelbkK/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/uEQUf/btrVTVPF94h/QfLXaIZJBgeC9Ws4oelbkK/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FuEQUf%2FbtrVTVPF94h%2FQfLXaIZJBgeC9Ws4oelbkK%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;1322&quot; height=&quot;622&quot; data-filename=&quot;5. 존칭별-성별 생존률.png&quot; data-origin-width=&quot;1322&quot; data-origin-height=&quot;622&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/div&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;존칭별 인원 카운트에선 큰 범주 4개를 제외하곤 갯수가 많이 없음을 확인하였고,&lt;/li&gt;
&lt;li&gt;존칭별/성별 생존율을 살펴보면 Dr를 제외하곤 각 막대가 없는 것을 볼 수 있는데, 당연히 성별에 따라 존칭을 사용하기 때문이다. 또한, 여성용 존칭과 남성용 존칭에 따라 생존을 볼 수 있다.&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignLeft&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;617&quot; data-origin-height=&quot;734&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/NYqGd/btrVOy14boU/hOfTQHfQxjDuBQ0mcF7rj1/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/NYqGd/btrVOy14boU/hOfTQHfQxjDuBQ0mcF7rj1/img.png&quot; data-alt=&quot;존칭에 따른 성별표&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/NYqGd/btrVOy14boU/hOfTQHfQxjDuBQ0mcF7rj1/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FNYqGd%2FbtrVOy14boU%2FhOfTQHfQxjDuBQ0mcF7rj1%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;617&quot; height=&quot;734&quot; data-origin-width=&quot;617&quot; data-origin-height=&quot;734&quot;/&gt;&lt;/span&gt;&lt;figcaption&gt;존칭에 따른 성별표&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;figure class=&quot;imageblock alignLeft&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;1289&quot; data-origin-height=&quot;778&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/bgjlXv/btrVP9m1ftV/6tSg4ede3BvPyJZyuP4tpk/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/bgjlXv/btrVP9m1ftV/6tSg4ede3BvPyJZyuP4tpk/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/bgjlXv/btrVP9m1ftV/6tSg4ede3BvPyJZyuP4tpk/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FbgjlXv%2FbtrVP9m1ftV%2F6tSg4ede3BvPyJZyuP4tpk%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;1289&quot; height=&quot;778&quot; data-origin-width=&quot;1289&quot; data-origin-height=&quot;778&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;존칭과 성별로 groupby를하고 나이와 생존에 대해 describe()를 조회하여 존칭별/성별 나이의 기술통계값을 확인할 수 있었다.&amp;nbsp;&lt;/li&gt;
&lt;li&gt;위의 size()함수와는 다르게 Age에서는 count가 줄어든 것을 볼 수 있는데 이는 describe() 함수가 결측치를 제거하고 통계를 내기 때문이다.&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;div class=&quot;colorscripter-code&quot; style=&quot;color: #a9b7c6; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; position: relative !important; overflow: auto;&quot;&gt;
&lt;table class=&quot;colorscripter-code-table&quot; style=&quot;margin: 0; padding: 0; border: none; background-color: #2b2b2b; border-radius: 4px;&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; data-ke-align=&quot;alignLeft&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&quot;padding: 6px; border-right: 2px solid #4f4f4f;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; word-break: normal; text-align: right; color: #aaa; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;1&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;2&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;3&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;4&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;5&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;6&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;7&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;8&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;padding: 6px 0; text-align: left;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; color: #a9b7c6; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;from&lt;/span&gt;&amp;nbsp;sklearn.preprocessing&amp;nbsp;&lt;span style=&quot;color: #cc7832;&quot;&gt;import&lt;/span&gt;&amp;nbsp;LabelEncoder&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;encoder&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;LabelEncoder()&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;encoder.fit(train[&lt;span style=&quot;color: #6a8759;&quot;&gt;'designation'&lt;/span&gt;])&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;labels&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;encoder.transform(train[&lt;span style=&quot;color: #6a8759;&quot;&gt;'designation'&lt;/span&gt;])&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;train[&lt;span style=&quot;color: #6a8759;&quot;&gt;'ca_designation'&lt;/span&gt;]&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;labels&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: right; margin-top: -13px; margin-right: 5px; font-size: 9px; font-style: italic;&quot;&gt;&lt;a style=&quot;color: #4f4f4ftext-decoration:none;&quot; href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Colored by Color Scripter&lt;/a&gt;&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;vertical-align: bottom; padding: 0 2px 4px 0;&quot;&gt;&lt;a style=&quot;text-decoration: none; color: white;&quot; href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;&lt;span style=&quot;font-size: 9px; word-break: normal; background-color: #4f4f4f; color: white; border-radius: 10px; padding: 1px;&quot;&gt;cs&lt;/span&gt;&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;LabelEncoder로 존칭을 숫자로 변환하였다.&amp;nbsp;&lt;/li&gt;
&lt;li&gt;이후 corr()함수를 사용하여 상관관계를 확인했을 때&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;1256&quot; data-origin-height=&quot;215&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/dyFTLp/btrVO0xj6wL/HSH7SHNRqRcrQB27LPyaEK/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/dyFTLp/btrVO0xj6wL/HSH7SHNRqRcrQB27LPyaEK/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/dyFTLp/btrVO0xj6wL/HSH7SHNRqRcrQB27LPyaEK/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FdyFTLp%2FbtrVO0xj6wL%2FHSH7SHNRqRcrQB27LPyaEK%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;1256&quot; height=&quot;215&quot; data-origin-width=&quot;1256&quot; data-origin-height=&quot;215&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;특정 조건에서 나이와 존칭의 상관계수가 0.75까지 올라가는 경우가 존재한다.&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;2. 나이 예측&lt;/h3&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;div class=&quot;colorscripter-code&quot; style=&quot;color: #a9b7c6; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; position: relative !important; overflow: auto;&quot;&gt;
&lt;table class=&quot;colorscripter-code-table&quot; style=&quot;margin: 0; padding: 0; border: none; background-color: #2b2b2b; border-radius: 4px;&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; data-ke-align=&quot;alignLeft&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&quot;padding: 6px; border-right: 2px solid #4f4f4f;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; word-break: normal; text-align: right; color: #aaa; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;1&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;2&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;3&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;4&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;5&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;padding: 6px 0; text-align: left;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; color: #a9b7c6; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;gTrain&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;train.groupby([&lt;span style=&quot;color: #6a8759;&quot;&gt;'designation'&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #6a8759;&quot;&gt;'Sex'&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #6a8759;&quot;&gt;'Pclass'&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #6a8759;&quot;&gt;'SibSp'&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #6a8759;&quot;&gt;'Parch'&lt;/span&gt;])&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;gAge&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;gTrain.describe()[&lt;span style=&quot;color: #6a8759;&quot;&gt;'Age'&lt;/span&gt;]&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;gAge[&lt;span style=&quot;color: #6a8759;&quot;&gt;'mDiff'&lt;/span&gt;]&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;gAge[&lt;span style=&quot;color: #6a8759;&quot;&gt;'mean'&lt;/span&gt;]&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;-&lt;/span&gt;&amp;nbsp;gAge[&lt;span style=&quot;color: #6a8759;&quot;&gt;'50%'&lt;/span&gt;]&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #8888c6;&quot;&gt;print&lt;/span&gt;(f&lt;span style=&quot;color: #6a8759;&quot;&gt;&quot;max&amp;nbsp;value&amp;nbsp;:&amp;nbsp;\n{gAge[['mean','50%',&amp;nbsp;'mDiff']].max()}&quot;&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;gAge[[&lt;span style=&quot;color: #6a8759;&quot;&gt;'mean'&lt;/span&gt;,&lt;span style=&quot;color: #6a8759;&quot;&gt;'50%'&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #6a8759;&quot;&gt;'mDiff'&lt;/span&gt;]]&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: right; margin-top: -13px; margin-right: 5px; font-size: 9px; font-style: italic;&quot;&gt;&lt;a style=&quot;color: #4f4f4ftext-decoration:none;&quot; href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Colored by Color Scripter&lt;/a&gt;&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;vertical-align: bottom; padding: 0 2px 4px 0;&quot;&gt;&lt;a style=&quot;text-decoration: none; color: white;&quot; href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;&lt;span style=&quot;font-size: 9px; word-break: normal; background-color: #4f4f4f; color: white; border-radius: 10px; padding: 1px;&quot;&gt;cs&lt;/span&gt;&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;img style=&quot;caret-color: transparent; color: #333333; font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'Apple SD Gothic Neo', Arial, sans-serif; letter-spacing: 0px;&quot; src=&quot;https://blog.kakaocdn.net/dn/RfKgv/btrVTT46lBn/LYtllnqm1JralYXZXTFKQk/img.png&quot; data-origin-width=&quot;529&quot; data-origin-height=&quot;892&quot; data-is-animation=&quot;false&quot; /&gt;&lt;/div&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;존칭, 성별, Pclass, SibSp, ParCh에 따라 분류한 후,&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;colorscripter-code&quot; style=&quot;color: #a9b7c6; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; position: relative !important; overflow: auto;&quot;&gt;
&lt;table class=&quot;colorscripter-code-table&quot; style=&quot;margin: 0; padding: 0; border: none; background-color: #2b2b2b; border-radius: 4px;&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; data-ke-align=&quot;alignLeft&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&quot;padding: 6px; border-right: 2px solid #4f4f4f;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; word-break: normal; text-align: right; color: #aaa; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;1&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;2&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;3&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;4&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;5&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;6&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;7&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;8&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;9&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;10&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;11&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;12&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;13&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;14&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;padding: 6px 0; text-align: left;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; color: #a9b7c6; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;for&lt;/span&gt;&amp;nbsp;item&amp;nbsp;&lt;span style=&quot;color: #cc7832;&quot;&gt;in&lt;/span&gt;&amp;nbsp;train.iterrows():&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;temp&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;item[&lt;span style=&quot;color: #6897bb;&quot;&gt;1&lt;/span&gt;]&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;guessAge&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;gAge.loc[temp[&lt;span style=&quot;color: #6a8759;&quot;&gt;'designation'&lt;/span&gt;],&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;temp[&lt;span style=&quot;color: #6a8759;&quot;&gt;'Sex'&lt;/span&gt;],&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;temp[&lt;span style=&quot;color: #6a8759;&quot;&gt;'Pclass'&lt;/span&gt;],&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;temp[&lt;span style=&quot;color: #6a8759;&quot;&gt;'SibSp'&lt;/span&gt;],&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;temp[&lt;span style=&quot;color: #6a8759;&quot;&gt;'Parch'&lt;/span&gt;]]&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #cc7832;&quot;&gt;if&lt;/span&gt;&amp;nbsp;(math.isnan(guessAge[&lt;span style=&quot;color: #6a8759;&quot;&gt;'mean'&lt;/span&gt;])):&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;guessAge&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;gAge.loc[temp[&lt;span style=&quot;color: #6a8759;&quot;&gt;'designation'&lt;/span&gt;],&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;temp[&lt;span style=&quot;color: #6a8759;&quot;&gt;'Sex'&lt;/span&gt;]].mean()&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;train.loc[item[&lt;span style=&quot;color: #6897bb;&quot;&gt;0&lt;/span&gt;],&amp;nbsp;&lt;span style=&quot;color: #6a8759;&quot;&gt;'guessAgeMean'&lt;/span&gt;]&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;round(guessAge[&lt;span style=&quot;color: #6a8759;&quot;&gt;'mean'&lt;/span&gt;],&amp;nbsp;&lt;span style=&quot;color: #6897bb;&quot;&gt;2&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;train.loc[item[&lt;span style=&quot;color: #6897bb;&quot;&gt;0&lt;/span&gt;],&amp;nbsp;&lt;span style=&quot;color: #6a8759;&quot;&gt;'guessAgeMedian'&lt;/span&gt;]&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;round(guessAge[&lt;span style=&quot;color: #6a8759;&quot;&gt;'50%'&lt;/span&gt;],&amp;nbsp;&lt;span style=&quot;color: #6897bb;&quot;&gt;2&lt;/span&gt;)&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;vertical-align: bottom; padding: 0 2px 4px 0;&quot;&gt;&lt;a style=&quot;text-decoration: none; color: white;&quot; href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;&lt;span style=&quot;font-size: 9px; word-break: normal; background-color: #4f4f4f; color: white; border-radius: 10px; padding: 1px;&quot;&gt;cs&lt;/span&gt;&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignLeft&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;791&quot; data-origin-height=&quot;223&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/wabFs/btrVTmffSly/n4mwKKjGc5zEjtTLOBDUok/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/wabFs/btrVTmffSly/n4mwKKjGc5zEjtTLOBDUok/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/wabFs/btrVTmffSly/n4mwKKjGc5zEjtTLOBDUok/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FwabFs%2FbtrVTmffSly%2Fn4mwKKjGc5zEjtTLOBDUok%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;504&quot; height=&quot;142&quot; data-origin-width=&quot;791&quot; data-origin-height=&quot;223&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;각 row 데이터에 따른 평균 나이와 중앙값을 구하였다.&amp;nbsp;&lt;/li&gt;
&lt;li&gt;결측치가 없음을 확인하고&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignLeft&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;465&quot; data-origin-height=&quot;856&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/brE18a/btrVOieqQB4/AMMZfk8ytVqg3CKklOaujk/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/brE18a/btrVOieqQB4/AMMZfk8ytVqg3CKklOaujk/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/brE18a/btrVOieqQB4/AMMZfk8ytVqg3CKklOaujk/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FbrE18a%2FbtrVOieqQB4%2FAMMZfk8ytVqg3CKklOaujk%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;465&quot; height=&quot;856&quot; data-origin-width=&quot;465&quot; data-origin-height=&quot;856&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;실제 나이와 예측한 나이가 편차가 크지 않은 것으로 보인다.&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignLeft&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;774&quot; data-origin-height=&quot;452&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/1KSF7/btrVTTYowYl/tzEMCJYRKB8hRUWlhlNkI1/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/1KSF7/btrVTTYowYl/tzEMCJYRKB8hRUWlhlNkI1/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/1KSF7/btrVTTYowYl/tzEMCJYRKB8hRUWlhlNkI1/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2F1KSF7%2FbtrVTTYowYl%2FtzEMCJYRKB8hRUWlhlNkI1%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;471&quot; height=&quot;275&quot; data-origin-width=&quot;774&quot; data-origin-height=&quot;452&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;기술통계에서도 실제 나이와 추론한 나이가 비슷하고 오히려 편차는 낮게 나타났다.&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;div class=&quot;colorscripter-code&quot; style=&quot;color: #a9b7c6; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; position: relative !important; overflow: auto;&quot;&gt;
&lt;table class=&quot;colorscripter-code-table&quot; style=&quot;margin: 0; padding: 0; border: none; background-color: #2b2b2b; border-radius: 4px;&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; data-ke-align=&quot;alignLeft&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&quot;padding: 6px; border-right: 2px solid #4f4f4f;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; word-break: normal; text-align: right; color: #aaa; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;1&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;2&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;3&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;4&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;padding: 6px 0; text-align: left;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; color: #a9b7c6; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;for&lt;/span&gt;&amp;nbsp;index,&amp;nbsp;item&amp;nbsp;&lt;span style=&quot;color: #cc7832;&quot;&gt;in&lt;/span&gt;&amp;nbsp;enumerate(train[&lt;span style=&quot;color: #6a8759;&quot;&gt;'Age'&lt;/span&gt;]):&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #cc7832;&quot;&gt;if&lt;/span&gt;(math.isnan(item)):&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;train.loc[index,&amp;nbsp;&lt;span style=&quot;color: #6a8759;&quot;&gt;'Age'&lt;/span&gt;]&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;train.loc[index,&amp;nbsp;&lt;span style=&quot;color: #6a8759;&quot;&gt;'guessAgeMean'&lt;/span&gt;]&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: right; margin-top: -13px; margin-right: 5px; font-size: 9px; font-style: italic;&quot;&gt;&lt;a style=&quot;color: #4f4f4ftext-decoration:none;&quot; href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Colored by Color Scripter&lt;/a&gt;&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;vertical-align: bottom; padding: 0 2px 4px 0;&quot;&gt;&lt;a style=&quot;text-decoration: none; color: white;&quot; href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;&lt;span style=&quot;font-size: 9px; word-break: normal; background-color: #4f4f4f; color: white; border-radius: 10px; padding: 1px;&quot;&gt;cs&lt;/span&gt;&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;따라 추론한 평균값으로 171개의 NaN값을 대체한다.&amp;nbsp;&lt;/li&gt;
&lt;li&gt;(현재는 Pclass까지 포함했지만 제외할 예정)&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;div class=&quot;colorscripter-code&quot; style=&quot;color: #a9b7c6; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; position: relative !important; overflow: auto;&quot;&gt;
&lt;table class=&quot;colorscripter-code-table&quot; style=&quot;margin: 0; padding: 0; border: none; background-color: #2b2b2b; border-radius: 4px;&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; data-ke-align=&quot;alignLeft&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&quot;padding: 6px; border-right: 2px solid #4f4f4f;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; word-break: normal; text-align: right; color: #aaa; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;1&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;2&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;3&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;4&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;5&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;6&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;7&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;8&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;9&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;10&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;11&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;12&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;13&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;14&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;15&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;16&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;17&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;18&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;19&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;20&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;21&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;22&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;23&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;24&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;padding: 6px 0; text-align: left;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; color: #a9b7c6; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;for&lt;/span&gt;&amp;nbsp;index,&amp;nbsp;item&amp;nbsp;&lt;span style=&quot;color: #cc7832;&quot;&gt;in&lt;/span&gt;&amp;nbsp;enumerate(train[&lt;span style=&quot;color: #6a8759;&quot;&gt;'ca_Age'&lt;/span&gt;]):&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #cc7832;&quot;&gt;if&lt;/span&gt;(item&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6897bb;&quot;&gt;99&lt;/span&gt;):&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;age&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;train.loc[index,&amp;nbsp;&lt;span style=&quot;color: #6a8759;&quot;&gt;'Age'&lt;/span&gt;]&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #cc7832;&quot;&gt;if&lt;/span&gt;&amp;nbsp;age&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;&amp;lt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6897bb;&quot;&gt;10&lt;/span&gt;:&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;result&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6897bb;&quot;&gt;0&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #cc7832;&quot;&gt;elif&lt;/span&gt;&amp;nbsp;age&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6897bb;&quot;&gt;10&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #cc7832;&quot;&gt;and&lt;/span&gt;&amp;nbsp;age&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;&amp;lt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6897bb;&quot;&gt;20&lt;/span&gt;:&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;result&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6897bb;&quot;&gt;1&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #cc7832;&quot;&gt;elif&lt;/span&gt;&amp;nbsp;age&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6897bb;&quot;&gt;20&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #cc7832;&quot;&gt;and&lt;/span&gt;&amp;nbsp;age&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;&amp;lt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6897bb;&quot;&gt;30&lt;/span&gt;:&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;result&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6897bb;&quot;&gt;2&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #cc7832;&quot;&gt;elif&lt;/span&gt;&amp;nbsp;age&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6897bb;&quot;&gt;30&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #cc7832;&quot;&gt;and&lt;/span&gt;&amp;nbsp;age&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;&amp;lt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6897bb;&quot;&gt;40&lt;/span&gt;:&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;result&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6897bb;&quot;&gt;3&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #cc7832;&quot;&gt;elif&lt;/span&gt;&amp;nbsp;age&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6897bb;&quot;&gt;40&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #cc7832;&quot;&gt;and&lt;/span&gt;&amp;nbsp;age&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;&amp;lt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6897bb;&quot;&gt;50&lt;/span&gt;:&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;result&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6897bb;&quot;&gt;4&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #cc7832;&quot;&gt;elif&lt;/span&gt;&amp;nbsp;age&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6897bb;&quot;&gt;50&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #cc7832;&quot;&gt;and&lt;/span&gt;&amp;nbsp;age&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;&amp;lt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6897bb;&quot;&gt;60&lt;/span&gt;:&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;result&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6897bb;&quot;&gt;5&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #cc7832;&quot;&gt;elif&lt;/span&gt;&amp;nbsp;age&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6897bb;&quot;&gt;60&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #cc7832;&quot;&gt;and&lt;/span&gt;&amp;nbsp;age&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;&amp;lt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6897bb;&quot;&gt;70&lt;/span&gt;:&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;result&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6897bb;&quot;&gt;6&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #cc7832;&quot;&gt;elif&lt;/span&gt;&amp;nbsp;age&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6897bb;&quot;&gt;70&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #cc7832;&quot;&gt;and&lt;/span&gt;&amp;nbsp;age&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6897bb;&quot;&gt;80&lt;/span&gt;:&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;result&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6897bb;&quot;&gt;7&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #cc7832;&quot;&gt;elif&lt;/span&gt;&amp;nbsp;age&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;&amp;gt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6897bb;&quot;&gt;80&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #cc7832;&quot;&gt;and&lt;/span&gt;&amp;nbsp;age&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;&amp;lt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6897bb;&quot;&gt;90&lt;/span&gt;:&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;result&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6897bb;&quot;&gt;8&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;train.loc[index,&amp;nbsp;&lt;span style=&quot;color: #6a8759;&quot;&gt;'ca_Age'&lt;/span&gt;]&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;result&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: right; margin-top: -13px; margin-right: 5px; font-size: 9px; font-style: italic;&quot;&gt;&lt;a style=&quot;color: #4f4f4ftext-decoration:none;&quot; href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Colored by Color Scripter&lt;/a&gt;&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;vertical-align: bottom; padding: 0 2px 4px 0;&quot;&gt;&lt;a style=&quot;text-decoration: none; color: white;&quot; href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;&lt;span style=&quot;font-size: 9px; word-break: normal; background-color: #4f4f4f; color: white; border-radius: 10px; padding: 1px;&quot;&gt;cs&lt;/span&gt;&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;이후 ca_Age 컬럼에서 99로 분류하였던 NaN값을 각 평균값으로 다시 대체한다.&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;colorscripter-code&quot; style=&quot;color: #a9b7c6; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; position: relative !important; overflow: auto;&quot;&gt;
&lt;table class=&quot;colorscripter-code-table&quot; style=&quot;margin: 0; padding: 0; border: none; background-color: #2b2b2b; border-radius: 4px;&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; data-ke-align=&quot;alignLeft&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&quot;padding: 6px; border-right: 2px solid #4f4f4f;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; word-break: normal; text-align: right; color: #aaa; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;1&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;2&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;3&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;padding: 6px 0; text-align: left;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; color: #a9b7c6; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;train[&lt;span style=&quot;color: #6a8759;&quot;&gt;'Embarked'&lt;/span&gt;].fillna(&lt;span style=&quot;color: #6a8759;&quot;&gt;&quot;S&quot;&lt;/span&gt;,&amp;nbsp;inplace&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #8888c6;&quot;&gt;True&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;train[&lt;span style=&quot;color: #6a8759;&quot;&gt;'ca_Embarked'&lt;/span&gt;].fillna(&lt;span style=&quot;color: #6a8759;&quot;&gt;&quot;2&quot;&lt;/span&gt;,&amp;nbsp;inplace&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #8888c6;&quot;&gt;True&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;train&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;train.drop(&lt;span style=&quot;color: #6a8759;&quot;&gt;'Cabin'&lt;/span&gt;,&amp;nbsp;axis&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #6897bb;&quot;&gt;1&lt;/span&gt;)&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;vertical-align: bottom; padding: 0 2px 4px 0;&quot;&gt;&lt;a style=&quot;text-decoration: none; color: white;&quot; href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;&lt;span style=&quot;font-size: 9px; word-break: normal; background-color: #4f4f4f; color: white; border-radius: 10px; padding: 1px;&quot;&gt;cs&lt;/span&gt;&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;Embarked의 경우 대부분이 S이므로 S로 대체하고 ca_Embared 값은 S의 숫자값인 2로 대체한다.&lt;/li&gt;
&lt;li&gt;Cabin 컬럼은 결측치가 대부분이어서 이번 전처리에선 제거 처리하였다.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignLeft&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;306&quot; data-origin-height=&quot;763&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/DlllE/btrVT7I4qXf/42bn0fXX4Wo7NLDKyzpPDk/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/DlllE/btrVT7I4qXf/42bn0fXX4Wo7NLDKyzpPDk/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/DlllE/btrVT7I4qXf/42bn0fXX4Wo7NLDKyzpPDk/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FDlllE%2FbtrVT7I4qXf%2F42bn0fXX4Wo7NLDKyzpPDk%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;306&quot; height=&quot;763&quot; data-origin-width=&quot;306&quot; data-origin-height=&quot;763&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;결측치가 제거됐음을 확인하고&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;div class=&quot;colorscripter-code&quot; style=&quot;color: #a9b7c6; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; position: relative !important; overflow: auto;&quot;&gt;
&lt;table class=&quot;colorscripter-code-table&quot; style=&quot;margin: 0; padding: 0; border: none; background-color: #2b2b2b; border-radius: 4px;&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; data-ke-align=&quot;alignLeft&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&quot;padding: 6px; border-right: 2px solid #4f4f4f;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; word-break: normal; text-align: right; color: #aaa; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;1&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;padding: 6px 0; text-align: left;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; color: #a9b7c6; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;train.to_csv(&lt;span style=&quot;color: #6a8759;&quot;&gt;'../input/noNaTrain.csv'&lt;/span&gt;,&amp;nbsp;index&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #8888c6;&quot;&gt;False&lt;/span&gt;)&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;vertical-align: bottom; padding: 0 2px 4px 0;&quot;&gt;&lt;a style=&quot;text-decoration: none; color: white;&quot; href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;&lt;span style=&quot;font-size: 9px; word-break: normal; background-color: #4f4f4f; color: white; border-radius: 10px; padding: 1px;&quot;&gt;cs&lt;/span&gt;&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;noNa 데이터로 내보낸다.&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style7&quot; /&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size14&quot;&gt;&lt;b&gt;다음 포스트&lt;/b&gt;&lt;/p&gt;
&lt;p data-ke-size=&quot;size14&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&lt;a href=&quot;https://drewvvv.tistory.com/18&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;2023.01.12 - [분류 전체보기] - 타이타닉 생존자 예측 분석 (3-2) 데이터 정리 - v.1.0.1&lt;/a&gt;&lt;/p&gt;
&lt;figure id=&quot;og_1673509258828&quot; contenteditable=&quot;false&quot; data-ke-type=&quot;opengraph&quot; data-ke-align=&quot;alignCenter&quot; data-og-type=&quot;article&quot; data-og-title=&quot;타이타닉 생존자 예측 분석 (3-2) 데이터 정리 - v.1.0.1&quot; data-og-description=&quot;이전 포스트 2023.01.09 - [Kaggle/타이타닉] - 타이타닉 생존자 예측 분석 (3-1) 전처리 (나이예측) - v.1.0.1 타이타닉 생존자 예측 분석 (3-1) 전처리 (나이예측) - v.1.0.1 이전 포스트 2023.01.09 - [분류 전체&quot; data-og-host=&quot;drewvvv.tistory.com&quot; data-og-source-url=&quot;https://drewvvv.tistory.com/18&quot; data-og-url=&quot;https://drewvvv.tistory.com/18&quot; data-og-image=&quot;https://scrap.kakaocdn.net/dn/caMK89/hyRgtaN7Fx/U6RS2HUQ7bCPwOFvlpJgiK/img.png?width=764&amp;amp;height=170&amp;amp;face=0_0_764_170,https://scrap.kakaocdn.net/dn/tgFbe/hyRfzKrw3f/KfFS9M2jRyEL2cf16RNGHk/img.png?width=764&amp;amp;height=170&amp;amp;face=0_0_764_170,https://scrap.kakaocdn.net/dn/cR9V95/hyRfCmUfiI/tcafyjiHDZyKyFcdC3LtHk/img.png?width=750&amp;amp;height=757&amp;amp;face=0_0_750_757&quot;&gt;&lt;a href=&quot;https://drewvvv.tistory.com/18&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot; data-source-url=&quot;https://drewvvv.tistory.com/18&quot;&gt;
&lt;div class=&quot;og-image&quot; style=&quot;background-image: url('https://scrap.kakaocdn.net/dn/caMK89/hyRgtaN7Fx/U6RS2HUQ7bCPwOFvlpJgiK/img.png?width=764&amp;amp;height=170&amp;amp;face=0_0_764_170,https://scrap.kakaocdn.net/dn/tgFbe/hyRfzKrw3f/KfFS9M2jRyEL2cf16RNGHk/img.png?width=764&amp;amp;height=170&amp;amp;face=0_0_764_170,https://scrap.kakaocdn.net/dn/cR9V95/hyRfCmUfiI/tcafyjiHDZyKyFcdC3LtHk/img.png?width=750&amp;amp;height=757&amp;amp;face=0_0_750_757');&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;og-text&quot;&gt;
&lt;p class=&quot;og-title&quot; data-ke-size=&quot;size16&quot;&gt;타이타닉 생존자 예측 분석 (3-2) 데이터 정리 - v.1.0.1&lt;/p&gt;
&lt;p class=&quot;og-desc&quot; data-ke-size=&quot;size16&quot;&gt;이전 포스트 2023.01.09 - [Kaggle/타이타닉] - 타이타닉 생존자 예측 분석 (3-1) 전처리 (나이예측) - v.1.0.1 타이타닉 생존자 예측 분석 (3-1) 전처리 (나이예측) - v.1.0.1 이전 포스트 2023.01.09 - [분류 전체&lt;/p&gt;
&lt;p class=&quot;og-host&quot; data-ke-size=&quot;size16&quot;&gt;drewvvv.tistory.com&lt;/p&gt;
&lt;/div&gt;
&lt;/a&gt;&lt;/figure&gt;
&lt;div id=&quot;dicLayerLoader&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div id=&quot;dicLayer&quot;&gt;
&lt;div id=&quot;dicLayerContents&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div id=&quot;dicLayerSub&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;/div&gt;
&lt;div id=&quot;dicRawData&quot; style=&quot;display: none;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div id=&quot;dicLayerLoader&quot;&gt;&amp;nbsp;&lt;/div&gt;</description>
      <category>Kaggle/타이타닉</category>
      <category>Eda</category>
      <category>결측치처리</category>
      <category>나이예측</category>
      <category>연령대별</category>
      <category>이진분류</category>
      <category>타이타닉</category>
      <category>탐색적분석</category>
      <author>qwer.ty_v</author>
      <guid isPermaLink="true">https://drewvvv.tistory.com/17</guid>
      <comments>https://drewvvv.tistory.com/17#entry17comment</comments>
      <pubDate>Mon, 9 Jan 2023 17:08:05 +0900</pubDate>
    </item>
    <item>
      <title>타이타닉 생존자 예측 분석 (2-3) EDA(상관관계 및 기타) - v.1.0.1</title>
      <link>https://drewvvv.tistory.com/16</link>
      <description>&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&lt;b&gt;이전 포스트&lt;/b&gt;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;div id=&quot;dicLayer&quot; style=&quot;color: #000000; font-size: 12px; font-family: Arial; background: -webkit-linear-gradient(bottom, #ffeb00, #ffdc00); width: 400px; height: 150px; display: none;&quot;&gt;
&lt;div id=&quot;dicLayerContents&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div id=&quot;dicLayerSub&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;/div&gt;
&lt;div id=&quot;dicRawData&quot; style=&quot;display: none;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&lt;a href=&quot;https://drewvvv.tistory.com/15&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;2023.01.05 - [Kaggle/타이타닉] - 타이타닉 생존자 예측 분석 (2-2) EDA(연령대별) - v.1.0.1&lt;/a&gt;&lt;/p&gt;
&lt;figure id=&quot;og_1673226804082&quot; contenteditable=&quot;false&quot; data-ke-type=&quot;opengraph&quot; data-ke-align=&quot;alignCenter&quot; data-og-type=&quot;article&quot; data-og-title=&quot;타이타닉 생존자 예측 분석 (2-2) EDA(연령대별) - v.1.0.1&quot; data-og-description=&quot;이전 포스트 타이타닉 생존자 예측 분석 (2-1) EDA(성별) - v.1.0.1 - 개요 우선 데이터 사이언티스트 (이하 DS)의 꿈을 가장 크게 꾸게 해준 타이타닉은 매우 흥미로웠다. 타이타닉에 탑승했던 사람들&quot; data-og-host=&quot;drewvvv.tistory.com&quot; data-og-source-url=&quot;https://drewvvv.tistory.com/15&quot; data-og-url=&quot;https://drewvvv.tistory.com/15&quot; data-og-image=&quot;https://scrap.kakaocdn.net/dn/bthIDv/hyRdLitaxM/soKwV4BPkemY97ivlgreHk/img.png?width=800&amp;amp;height=669&amp;amp;face=0_0_800_669,https://scrap.kakaocdn.net/dn/b2i6b2/hyRdQYotE2/rlwXnW6J6oMxnCS0GIzLK1/img.png?width=800&amp;amp;height=669&amp;amp;face=0_0_800_669,https://scrap.kakaocdn.net/dn/c60Ji1/hyRcL5s6A9/vTf2AsTFvX0z15q8kVZe0k/img.png?width=1334&amp;amp;height=659&amp;amp;face=0_0_1334_659&quot;&gt;&lt;a href=&quot;https://drewvvv.tistory.com/15&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot; data-source-url=&quot;https://drewvvv.tistory.com/15&quot;&gt;
&lt;div class=&quot;og-image&quot; style=&quot;background-image: url('https://scrap.kakaocdn.net/dn/bthIDv/hyRdLitaxM/soKwV4BPkemY97ivlgreHk/img.png?width=800&amp;amp;height=669&amp;amp;face=0_0_800_669,https://scrap.kakaocdn.net/dn/b2i6b2/hyRdQYotE2/rlwXnW6J6oMxnCS0GIzLK1/img.png?width=800&amp;amp;height=669&amp;amp;face=0_0_800_669,https://scrap.kakaocdn.net/dn/c60Ji1/hyRcL5s6A9/vTf2AsTFvX0z15q8kVZe0k/img.png?width=1334&amp;amp;height=659&amp;amp;face=0_0_1334_659');&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;og-text&quot;&gt;
&lt;p class=&quot;og-title&quot; data-ke-size=&quot;size16&quot;&gt;타이타닉 생존자 예측 분석 (2-2) EDA(연령대별) - v.1.0.1&lt;/p&gt;
&lt;p class=&quot;og-desc&quot; data-ke-size=&quot;size16&quot;&gt;이전 포스트 타이타닉 생존자 예측 분석 (2-1) EDA(성별) - v.1.0.1 - 개요 우선 데이터 사이언티스트 (이하 DS)의 꿈을 가장 크게 꾸게 해준 타이타닉은 매우 흥미로웠다. 타이타닉에 탑승했던 사람들&lt;/p&gt;
&lt;p class=&quot;og-host&quot; data-ke-size=&quot;size16&quot;&gt;drewvvv.tistory.com&lt;/p&gt;
&lt;/div&gt;
&lt;/a&gt;&lt;/figure&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style7&quot; /&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;&lt;span&gt;1. 상관관계 분석&amp;nbsp;&lt;/span&gt;&lt;/h3&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&lt;span&gt;파이썬 데이터테이블에서 상관관계를 분석하는 함수로 pandas의 corr()이 있다.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&lt;span&gt;df.corr()을 하면 상관관계를 분석해주는데 타이타닉 데이터를 토대로 상관관계를 확인해보면 아래와 같다.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;1387&quot; data-origin-height=&quot;455&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/zhsUy/btrVI5Y1oXo/8mfa5OtER6EghWbzxIuav1/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/zhsUy/btrVI5Y1oXo/8mfa5OtER6EghWbzxIuav1/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/zhsUy/btrVI5Y1oXo/8mfa5OtER6EghWbzxIuav1/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FzhsUy%2FbtrVI5Y1oXo%2F8mfa5OtER6EghWbzxIuav1%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;1387&quot; height=&quot;455&quot; data-origin-width=&quot;1387&quot; data-origin-height=&quot;455&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;대각선을 기준으로 대칭이어서 한쪽만 살펴보면된다.&amp;nbsp;&lt;/li&gt;
&lt;li&gt;pandas의 corr 함수에는 methods라는 파라미터를 입력해서&amp;nbsp;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;연속형 - 연속형 (모수적) &lt;span style=&quot;background-color: #ffffff; color: #000000;&quot;&gt;자료간의 선형관&lt;/span&gt;&lt;span style=&quot;background-color: #ffffff; color: #000000;&quot;&gt;계를 나타내는 피어슨 상관계수 (methods=&quot;pearson&quot;)&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;background-color: #ffffff; color: #000000;&quot;&gt;연속형 - 연속형 (비모수적) 자료간의 비선형관계를 나타내는 스피어만 순위 상관계수 (methods=&quot;spearman&quot;)&lt;/span&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;&lt;span style=&quot;background-color: #ffffff; color: #000000;&quot;&gt;순위를 사용하기 때문에 연속형 변수가 아닌 순서형 변수에서도 사용 가능(*)&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;background-color: #ffffff; color: #000000;&quot;&gt;&lt;span style=&quot;background-color: #ffffff; color: #323232;&quot;&gt;연속형 - 연속형 (비모수적) 자료간의 켄달의 타우 순위 상관계수 (method=&quot;&lt;span style=&quot;background-color: #ffffff; color: #323232;&quot;&gt;kendall&lt;/span&gt;&quot;) 이 존재한다.&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: #ffffff; color: #000000;&quot;&gt;&lt;span style=&quot;background-color: #ffffff; color: #323232;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;background-color: #ffffff; color: #000000;&quot;&gt;&lt;span style=&quot;background-color: #ffffff; color: #323232;&quot;&gt;하지만 사용시 주의할 점이 있는데, corr 함수의 메서드들은 연속형 자료에 대해서 상관관계를 분석한다.&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;background-color: #ffffff; color: #000000;&quot;&gt;&lt;span style=&quot;background-color: #ffffff; color: #323232;&quot;&gt;따라, 범주형 변수의 상관관계를 분석할 경우 &lt;/span&gt;&lt;/span&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;&lt;span style=&quot;background-color: #ffffff; color: #000000;&quot;&gt;&lt;span style=&quot;background-color: #ffffff; color: #323232;&quot;&gt;명목형(이분형) &amp;amp; 연속형 - Point biserial correlation coefficient&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;background-color: #ffffff; color: #323232;&quot;&gt;명목형(이분형) &amp;amp; &lt;span style=&quot;background-color: #ffffff; color: #323232;&quot;&gt;명목형(이분형) - Phi coefficient 를 사용해야 한다. &lt;span style=&quot;color: #006dd7;&quot;&gt;&lt;a style=&quot;color: #006dd7;&quot; href=&quot;https://mansoostat.tistory.com/115&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;[참고링크]&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;background-color: #ffffff; color: #323232;&quot;&gt;&lt;span style=&quot;background-color: #ffffff; color: #323232;&quot;&gt;또한 상관관계가 인과관계를 설명하지 않는 것의 유의한다. &lt;span style=&quot;color: #006dd7;&quot;&gt;&lt;a style=&quot;color: #006dd7;&quot; href=&quot;https://wikidocs.net/161870&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;[참&lt;/a&gt;&lt;a style=&quot;color: #006dd7;&quot; href=&quot;https://mansoostat.tistory.com/115&quot;&gt;고&lt;/a&gt;&lt;a style=&quot;color: #006dd7;&quot; href=&quot;https://wikidocs.net/161870&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;링크]&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;단, scipy의 &lt;span style=&quot;background-color: #ffffff; color: #323232;&quot;&gt;Point biserial correlation을 활용하여 명목형과 연속형에 대한 상관분석을 하였을 때,&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;1008&quot; data-origin-height=&quot;279&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/xhTVm/btrVMZZflbZ/jsl2RXMKQUwuk3CSbC0s91/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/xhTVm/btrVMZZflbZ/jsl2RXMKQUwuk3CSbC0s91/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/xhTVm/btrVMZZflbZ/jsl2RXMKQUwuk3CSbC0s91/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FxhTVm%2FbtrVMZZflbZ%2Fjsl2RXMKQUwuk3CSbC0s91%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;1008&quot; height=&quot;279&quot; data-origin-width=&quot;1008&quot; data-origin-height=&quot;279&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;df의 corr에서 해당 컬럼의 값과 동일하게 나오는 것을 확인할 수 있는데, 이는 corr함수가 같이 분석해주는 것으로 보인다.&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;colorscripter-code&quot; style=&quot;color: #a9b7c6; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; position: relative !important; overflow: auto;&quot;&gt;
&lt;table class=&quot;colorscripter-code-table&quot; style=&quot;margin: 0; padding: 0; border: none; background-color: #2b2b2b; border-radius: 4px;&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; data-ke-align=&quot;alignLeft&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&quot;padding: 6px; border-right: 2px solid #4f4f4f;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; word-break: normal; text-align: right; color: #aaa; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;1&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;2&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;3&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;4&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;5&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;6&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;7&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;8&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;9&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;10&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;11&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;12&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;13&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;14&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;15&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;16&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;17&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;18&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;padding: 6px 0; text-align: left;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; color: #a9b7c6; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;df&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;train.corr(numeric_only&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #8888c6;&quot;&gt;True&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #808080;&quot;&gt;#&amp;nbsp;그림&amp;nbsp;사이즈&amp;nbsp;지정&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;fig,&amp;nbsp;ax&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;plt.subplots(&amp;nbsp;figsize&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;(&lt;span style=&quot;color: #6897bb;&quot;&gt;7&lt;/span&gt;,&lt;span style=&quot;color: #6897bb;&quot;&gt;7&lt;/span&gt;)&amp;nbsp;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #808080;&quot;&gt;#&amp;nbsp;삼각형&amp;nbsp;마스크를&amp;nbsp;만든다(위&amp;nbsp;쪽&amp;nbsp;삼각형에&amp;nbsp;True,&amp;nbsp;아래&amp;nbsp;삼각형에&amp;nbsp;False)&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;mask&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;np.zeros_like(df,&amp;nbsp;dtype&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;bool)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;mask[np.triu_indices_from(mask)]&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #8888c6;&quot;&gt;True&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #808080;&quot;&gt;#&amp;nbsp;히트맵을&amp;nbsp;그린다&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;sns.heatmap(df,&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;cmap&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6a8759;&quot;&gt;'RdYlBu_r'&lt;/span&gt;,&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;annot&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #8888c6;&quot;&gt;True&lt;/span&gt;,&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #808080;&quot;&gt;#&amp;nbsp;실제&amp;nbsp;값을&amp;nbsp;표시한다&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;mask&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;mask,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #808080;&quot;&gt;#&amp;nbsp;표시하지&amp;nbsp;않을&amp;nbsp;마스크&amp;nbsp;부분을&amp;nbsp;지정한다&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;linewidths&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;.&lt;span style=&quot;color: #6897bb;&quot;&gt;5&lt;/span&gt;,&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #808080;&quot;&gt;#&amp;nbsp;경계면&amp;nbsp;실선으로&amp;nbsp;구분하기&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;cbar_kws&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;{&lt;span style=&quot;color: #6a8759;&quot;&gt;&quot;shrink&quot;&lt;/span&gt;:&amp;nbsp;.&lt;span style=&quot;color: #6897bb;&quot;&gt;5&lt;/span&gt;},&lt;span style=&quot;color: #808080;&quot;&gt;#&amp;nbsp;컬러바&amp;nbsp;크기&amp;nbsp;절반으로&amp;nbsp;줄이기&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;vmin&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color: #6897bb;&quot;&gt;1&lt;/span&gt;,vmax&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6897bb;&quot;&gt;1&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #808080;&quot;&gt;#&amp;nbsp;컬러바&amp;nbsp;범위&amp;nbsp;-1&amp;nbsp;~&amp;nbsp;1&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;)&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;plt.show()&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: right; margin-top: -13px; margin-right: 5px; font-size: 9px; font-style: italic;&quot;&gt;&lt;a style=&quot;color: #4f4f4ftext-decoration:none;&quot; href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Colored by Color Scripter&lt;/a&gt;&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;vertical-align: bottom; padding: 0 2px 4px 0;&quot;&gt;&lt;a style=&quot;text-decoration: none; color: white;&quot; href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;&lt;span style=&quot;font-size: 9px; word-break: normal; background-color: #4f4f4f; color: white; border-radius: 10px; padding: 1px;&quot;&gt;cs&lt;/span&gt;&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;figure class=&quot;imageblock alignLeft&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-filename=&quot;4.상관관계 분석.png&quot; data-origin-width=&quot;653&quot; data-origin-height=&quot;666&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/YUb00/btrVOgM8OMq/EPuv5JAL2cHC3kRRmvf8b1/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/YUb00/btrVOgM8OMq/EPuv5JAL2cHC3kRRmvf8b1/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/YUb00/btrVOgM8OMq/EPuv5JAL2cHC3kRRmvf8b1/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FYUb00%2FbtrVOgM8OMq%2FEPuv5JAL2cHC3kRRmvf8b1%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;653&quot; height=&quot;666&quot; data-filename=&quot;4.상관관계 분석.png&quot; data-origin-width=&quot;653&quot; data-origin-height=&quot;666&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/div&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;sns heatmap 함수를 이용하여 corr을 시각화한다.&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;colorscripter-code&quot; style=&quot;color: #a9b7c6; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; position: relative !important; overflow: auto;&quot;&gt;
&lt;table class=&quot;colorscripter-code-table&quot; style=&quot;margin: 0; padding: 0; border: none; background-color: #2b2b2b; border-radius: 4px;&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; data-ke-align=&quot;alignLeft&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&quot;padding: 6px; border-right: 2px solid #4f4f4f;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; word-break: normal; text-align: right; color: #aaa; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;1&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;2&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;padding: 6px 0; text-align: left;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; color: #a9b7c6; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;train.loc[&amp;nbsp;train[&lt;span style=&quot;color: #6a8759;&quot;&gt;'Sex'&lt;/span&gt;]&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6a8759;&quot;&gt;'male'&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #6a8759;&quot;&gt;'ca_Sex'&lt;/span&gt;]&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6897bb;&quot;&gt;0&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;train.loc[&amp;nbsp;train[&lt;span style=&quot;color: #6a8759;&quot;&gt;'Sex'&lt;/span&gt;]&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6a8759;&quot;&gt;'female'&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #6a8759;&quot;&gt;'ca_Sex'&lt;/span&gt;]&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6897bb;&quot;&gt;1&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;vertical-align: bottom; padding: 0 2px 4px 0;&quot;&gt;&lt;a style=&quot;text-decoration: none; color: white;&quot; href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;&lt;span style=&quot;font-size: 9px; word-break: normal; background-color: #4f4f4f; color: white; border-radius: 10px; padding: 1px;&quot;&gt;cs&lt;/span&gt;&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;&lt;span style=&quot;background-color: #ffffff;&quot;&gt;데이터 분석 모형은 숫자만 입력으로 받을 수 있기 때문에 성별을 숫자로 변환한다.&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;1179&quot; data-origin-height=&quot;353&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/bIAxJL/btrVKZ6f7hX/ZwKNfVfZyIxn40APmuBFT1/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/bIAxJL/btrVKZ6f7hX/ZwKNfVfZyIxn40APmuBFT1/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/bIAxJL/btrVKZ6f7hX/ZwKNfVfZyIxn40APmuBFT1/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FbIAxJL%2FbtrVKZ6f7hX%2FZwKNfVfZyIxn40APmuBFT1%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;1179&quot; height=&quot;353&quot; data-origin-width=&quot;1179&quot; data-origin-height=&quot;353&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;이후 pandas의 crosstab을 활용하여&lt;span style=&quot;background-color: #ffffff; color: #212529;&quot;&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;요인별로 교차분석을 하여, 행 및 열 요인 기준별로 빈도를 세어서 도수분포표, 교차표를 만들어 시각화할 수 있다. &lt;a href=&quot;https://velog.io/@lsmmay322/%ED%83%80%EC%9D%B4%ED%83%80%EB%8B%89-%EC%A0%9C%EB%8C%80%EB%A1%9C-%EB%B6%84%EC%84%9D%ED%95%B4%EB%B3%B4%EA%B8%B0&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;[참조링크]&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;&lt;span&gt;2. 기타 EDA 분석&amp;nbsp; (선착장별, 객실등급별, 요금별)&lt;/span&gt;&lt;/h3&gt;
&lt;h4 data-ke-size=&quot;size20&quot;&gt;&amp;nbsp;&lt;/h4&gt;
&lt;h4 data-ke-size=&quot;size20&quot;&gt;- 선착장별 EDA&lt;/h4&gt;
&lt;div class=&quot;colorscripter-code&quot; style=&quot;color: #a9b7c6; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; position: relative !important; overflow: auto;&quot;&gt;
&lt;table class=&quot;colorscripter-code-table&quot; style=&quot;margin: 0; padding: 0; border: none; background-color: #2b2b2b; border-radius: 4px;&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; data-ke-align=&quot;alignLeft&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&quot;padding: 6px; border-right: 2px solid #4f4f4f;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; word-break: normal; text-align: right; color: #aaa; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;1&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;2&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;3&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;4&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;5&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;padding: 6px 0; text-align: left;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; color: #a9b7c6; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;train.loc[&amp;nbsp;train[&lt;span style=&quot;color: #6a8759;&quot;&gt;'Embarked'&lt;/span&gt;]&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6a8759;&quot;&gt;'C'&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #6a8759;&quot;&gt;'ca_Embarked'&lt;/span&gt;]&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6897bb;&quot;&gt;0&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;train.loc[&amp;nbsp;train[&lt;span style=&quot;color: #6a8759;&quot;&gt;'Embarked'&lt;/span&gt;]&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6a8759;&quot;&gt;'Q'&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #6a8759;&quot;&gt;'ca_Embarked'&lt;/span&gt;]&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6897bb;&quot;&gt;1&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;train.loc[&amp;nbsp;train[&lt;span style=&quot;color: #6a8759;&quot;&gt;'Embarked'&lt;/span&gt;]&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6a8759;&quot;&gt;'S'&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #6a8759;&quot;&gt;'ca_Embarked'&lt;/span&gt;]&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6897bb;&quot;&gt;2&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;pd.crosstab(train.ca_Embarked,train.Survived,margins&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #8888c6;&quot;&gt;True&lt;/span&gt;).style.background_gradient(cmap&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #6a8759;&quot;&gt;'summer_r'&lt;/span&gt;)&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;vertical-align: bottom; padding: 0 2px 4px 0;&quot;&gt;&lt;a style=&quot;text-decoration: none; color: white;&quot; href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;&lt;span style=&quot;font-size: 9px; word-break: normal; background-color: #4f4f4f; color: white; border-radius: 10px; padding: 1px;&quot;&gt;cs&lt;/span&gt;&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignLeft&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;322&quot; data-origin-height=&quot;248&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/KT40g/btrVCeKgWZK/66mQNIpzLP2T5XLohaTgyK/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/KT40g/btrVCeKgWZK/66mQNIpzLP2T5XLohaTgyK/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/KT40g/btrVCeKgWZK/66mQNIpzLP2T5XLohaTgyK/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FKT40g%2FbtrVCeKgWZK%2F66mQNIpzLP2T5XLohaTgyK%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;322&quot; height=&quot;248&quot; data-origin-width=&quot;322&quot; data-origin-height=&quot;248&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;선착장을&amp;nbsp; 숫자 변환하고 도수분포표를 확인해본 경우, 선착장별 생존자 차이는 뚜렷한 차이를 보긴 어렵다.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;1009&quot; data-origin-height=&quot;336&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/c2VyhK/btrVLv5fQjI/8BZ8nkhjdsFpz6krz5ewK0/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/c2VyhK/btrVLv5fQjI/8BZ8nkhjdsFpz6krz5ewK0/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/c2VyhK/btrVLv5fQjI/8BZ8nkhjdsFpz6krz5ewK0/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2Fc2VyhK%2FbtrVLv5fQjI%2F8BZ8nkhjdsFpz6krz5ewK0%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;1009&quot; height=&quot;336&quot; data-origin-width=&quot;1009&quot; data-origin-height=&quot;336&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;선착장별 요금분포&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;921&quot; data-origin-height=&quot;807&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/bIFulf/btrVOiqKdxZ/joEKfNINwZ4VCqF4rvxZa1/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/bIFulf/btrVOiqKdxZ/joEKfNINwZ4VCqF4rvxZa1/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/bIFulf/btrVOiqKdxZ/joEKfNINwZ4VCqF4rvxZa1/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FbIFulf%2FbtrVOiqKdxZ%2FjoEKfNINwZ4VCqF4rvxZa1%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;921&quot; height=&quot;807&quot; data-origin-width=&quot;921&quot; data-origin-height=&quot;807&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;h4 data-ke-size=&quot;size20&quot;&gt;&lt;span style=&quot;color: #000000;&quot;&gt;- 객실등급별 EDA&lt;/span&gt;&lt;/h4&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;907&quot; data-origin-height=&quot;807&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/cSqbZ2/btrVF8W7QKK/XmMkYGOxBSX6I41aHlaibk/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/cSqbZ2/btrVF8W7QKK/XmMkYGOxBSX6I41aHlaibk/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/cSqbZ2/btrVF8W7QKK/XmMkYGOxBSX6I41aHlaibk/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FcSqbZ2%2FbtrVF8W7QKK%2FXmMkYGOxBSX6I41aHlaibk%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;907&quot; height=&quot;807&quot; data-origin-width=&quot;907&quot; data-origin-height=&quot;807&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;div class=&quot;colorscripter-code&quot; style=&quot;color: #a9b7c6; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; position: relative !important; overflow: auto;&quot;&gt;
&lt;table class=&quot;colorscripter-code-table&quot; style=&quot;margin: 0; padding: 0; border: none; background-color: #2b2b2b; border-radius: 4px;&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; data-ke-align=&quot;alignLeft&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&quot;padding: 6px; border-right: 2px solid #4f4f4f;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; word-break: normal; text-align: right; color: #aaa; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;1&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;2&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;3&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;4&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;5&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;6&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;7&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;8&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;9&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;10&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;11&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;12&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;13&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;14&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;padding: 6px 0; text-align: left;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; color: #a9b7c6; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;fig&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;plt.figure(figsize&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;(&lt;span style=&quot;color: #6897bb;&quot;&gt;10&lt;/span&gt;,&lt;span style=&quot;color: #6897bb;&quot;&gt;10&lt;/span&gt;))&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;area01&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;fig.add_subplot(&lt;span style=&quot;color: #6897bb;&quot;&gt;2&lt;/span&gt;,&lt;span style=&quot;color: #6897bb;&quot;&gt;2&lt;/span&gt;,&lt;span style=&quot;color: #6897bb;&quot;&gt;1&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;area02&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;fig.add_subplot(&lt;span style=&quot;color: #6897bb;&quot;&gt;2&lt;/span&gt;,&lt;span style=&quot;color: #6897bb;&quot;&gt;2&lt;/span&gt;,&lt;span style=&quot;color: #6897bb;&quot;&gt;2&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;area03&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;fig.add_subplot(&lt;span style=&quot;color: #6897bb;&quot;&gt;2&lt;/span&gt;,&lt;span style=&quot;color: #6897bb;&quot;&gt;2&lt;/span&gt;,&lt;span style=&quot;color: #6897bb;&quot;&gt;3&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;sns.countplot(data&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;train,&amp;nbsp;x&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #6a8759;&quot;&gt;'Pclass'&lt;/span&gt;,&amp;nbsp;ax&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;area01)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;area01.set_title(&lt;span style=&quot;color: #6a8759;&quot;&gt;'객실별&amp;nbsp;count'&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;sns.barplot(data&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;train,&amp;nbsp;x&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #6a8759;&quot;&gt;&quot;Pclass&quot;&lt;/span&gt;,&amp;nbsp;y&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #6a8759;&quot;&gt;&quot;Survived&quot;&lt;/span&gt;,&amp;nbsp;errwidth&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #6897bb;&quot;&gt;0&lt;/span&gt;,&amp;nbsp;ax&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;area02)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;area02.set_title(&lt;span style=&quot;color: #6a8759;&quot;&gt;'객실별&amp;nbsp;생존자&amp;nbsp;count'&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;sns.countplot(data&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;train,&amp;nbsp;x&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #6a8759;&quot;&gt;'Pclass'&lt;/span&gt;,&amp;nbsp;hue&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #6a8759;&quot;&gt;'Survived'&lt;/span&gt;,&amp;nbsp;ax&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;area03)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;area03.set_title(&lt;span style=&quot;color: #6a8759;&quot;&gt;'객실별&amp;nbsp;생존&amp;nbsp;여부&amp;nbsp;count'&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;plt.show()&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: right; margin-top: -13px; margin-right: 5px; font-size: 9px; font-style: italic;&quot;&gt;&lt;a style=&quot;color: #4f4f4ftext-decoration:none;&quot; href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Colored by Color Scripter&lt;/a&gt;&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;vertical-align: bottom; padding: 0 2px 4px 0;&quot;&gt;&lt;a style=&quot;text-decoration: none; color: white;&quot; href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;&lt;span style=&quot;font-size: 9px; word-break: normal; background-color: #4f4f4f; color: white; border-radius: 10px; padding: 1px;&quot;&gt;cs&lt;/span&gt;&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-filename=&quot;4. 객실등급별 생존자 분석.png&quot; data-origin-width=&quot;855&quot; data-origin-height=&quot;863&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/BVk5c/btrVF8QnlVm/qEXLEnKpljtU40wffU7Sz0/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/BVk5c/btrVF8QnlVm/qEXLEnKpljtU40wffU7Sz0/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/BVk5c/btrVF8QnlVm/qEXLEnKpljtU40wffU7Sz0/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FBVk5c%2FbtrVF8QnlVm%2FqEXLEnKpljtU40wffU7Sz0%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;855&quot; height=&quot;863&quot; data-filename=&quot;4. 객실등급별 생존자 분석.png&quot; data-origin-width=&quot;855&quot; data-origin-height=&quot;863&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/div&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;객실등급이 높을 수록 생존율이 높음을 확인할 수 있다.&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;h4 data-ke-size=&quot;size20&quot;&gt;- 객실등급별, Pclass별 요금분포&lt;/h4&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;1021&quot; data-origin-height=&quot;477&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/cx0YMS/btrVIvYQZvg/J2UjT7MprNSLsfLmew1vak/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/cx0YMS/btrVIvYQZvg/J2UjT7MprNSLsfLmew1vak/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/cx0YMS/btrVIvYQZvg/J2UjT7MprNSLsfLmew1vak/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2Fcx0YMS%2FbtrVIvYQZvg%2FJ2UjT7MprNSLsfLmew1vak%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;1021&quot; height=&quot;477&quot; data-origin-width=&quot;1021&quot; data-origin-height=&quot;477&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;920&quot; data-origin-height=&quot;830&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/uED5g/btrVMYMVxyk/wJfI1y2XmDzklUu1Z3CFCK/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/uED5g/btrVMYMVxyk/wJfI1y2XmDzklUu1Z3CFCK/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/uED5g/btrVMYMVxyk/wJfI1y2XmDzklUu1Z3CFCK/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FuED5g%2FbtrVMYMVxyk%2FwJfI1y2XmDzklUu1Z3CFCK%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;920&quot; height=&quot;830&quot; data-origin-width=&quot;920&quot; data-origin-height=&quot;830&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;선착장 위치에 상관없이 1등 객실에 탑승한 고객은 비싼 요금을 지불했다.&lt;/li&gt;
&lt;/ul&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style7&quot; /&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;div id=&quot;dicLayer&quot;&gt;
&lt;div id=&quot;dicLayerContents&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div id=&quot;dicLayerSub&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;/div&gt;
&lt;div id=&quot;dicRawData&quot; style=&quot;display: none;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div id=&quot;dicLayerLoader&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div id=&quot;dicLayer&quot;&gt;
&lt;div id=&quot;dicLayerContents&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div id=&quot;dicLayerSub&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;/div&gt;
&lt;div id=&quot;dicRawData&quot; style=&quot;display: none;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;div id=&quot;dicLayerLoader&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&lt;b&gt;다음 포스트&lt;/b&gt;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&lt;a href=&quot;https://drewvvv.tistory.com/17&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;2023.01.09 - [분류 전체보기] - 타이타닉 생존자 예측 분석 (3-1) 전처리 (나이예측) - v.1.0.1&lt;/a&gt;&lt;/p&gt;
&lt;figure id=&quot;og_1673503167024&quot; contenteditable=&quot;false&quot; data-ke-type=&quot;opengraph&quot; data-ke-align=&quot;alignCenter&quot; data-og-type=&quot;article&quot; data-og-title=&quot;타이타닉 생존자 예측 분석 (3-1) 전처리 (나이예측) - v.1.0.1&quot; data-og-description=&quot;이전 포스트 2023.01.09 - [분류 전체보기] - 타이타닉 생존자 예측 분석 (2-3) EDA(상관관계 및 기타) - v.1.0.1 타이타닉 생존자 예측 분석 (2-3) EDA(상관관계 및 기타) - v.1.0.1 이전 포스트 타이타닉 생존&quot; data-og-host=&quot;drewvvv.tistory.com&quot; data-og-source-url=&quot;https://drewvvv.tistory.com/17&quot; data-og-url=&quot;https://drewvvv.tistory.com/17&quot; data-og-image=&quot;https://scrap.kakaocdn.net/dn/b056py/hyRfIN92lk/Jks9XpWAMxVYunIJ2FiOJK/img.png?width=800&amp;amp;height=136&amp;amp;face=0_0_800_136,https://scrap.kakaocdn.net/dn/dIxVRe/hyRfykpNer/L7DH3SZTBrbv7R3lwTHWmK/img.png?width=800&amp;amp;height=136&amp;amp;face=0_0_800_136&quot;&gt;&lt;a href=&quot;https://drewvvv.tistory.com/17&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot; data-source-url=&quot;https://drewvvv.tistory.com/17&quot;&gt;
&lt;div class=&quot;og-image&quot; style=&quot;background-image: url('https://scrap.kakaocdn.net/dn/b056py/hyRfIN92lk/Jks9XpWAMxVYunIJ2FiOJK/img.png?width=800&amp;amp;height=136&amp;amp;face=0_0_800_136,https://scrap.kakaocdn.net/dn/dIxVRe/hyRfykpNer/L7DH3SZTBrbv7R3lwTHWmK/img.png?width=800&amp;amp;height=136&amp;amp;face=0_0_800_136');&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;og-text&quot;&gt;
&lt;p class=&quot;og-title&quot; data-ke-size=&quot;size16&quot;&gt;타이타닉 생존자 예측 분석 (3-1) 전처리 (나이예측) - v.1.0.1&lt;/p&gt;
&lt;p class=&quot;og-desc&quot; data-ke-size=&quot;size16&quot;&gt;이전 포스트 2023.01.09 - [분류 전체보기] - 타이타닉 생존자 예측 분석 (2-3) EDA(상관관계 및 기타) - v.1.0.1 타이타닉 생존자 예측 분석 (2-3) EDA(상관관계 및 기타) - v.1.0.1 이전 포스트 타이타닉 생존&lt;/p&gt;
&lt;p class=&quot;og-host&quot; data-ke-size=&quot;size16&quot;&gt;drewvvv.tistory.com&lt;/p&gt;
&lt;/div&gt;
&lt;/a&gt;&lt;/figure&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;div id=&quot;dicLayerLoader&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;div id=&quot;dicLayer&quot;&gt;
&lt;div id=&quot;dicLayerContents&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div id=&quot;dicLayerSub&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;/div&gt;
&lt;div id=&quot;dicRawData&quot; style=&quot;display: none;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div id=&quot;dicLayerLoader&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div id=&quot;dicLayer&quot;&gt;
&lt;div id=&quot;dicLayerContents&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div id=&quot;dicLayerSub&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;/div&gt;
&lt;div id=&quot;dicRawData&quot; style=&quot;display: none;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div id=&quot;dicLayerLoader&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div id=&quot;dicLayer&quot;&gt;
&lt;div id=&quot;dicLayerContents&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div id=&quot;dicLayerSub&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;/div&gt;
&lt;div id=&quot;dicRawData&quot; style=&quot;display: none;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div id=&quot;dicLayerLoader&quot;&gt;&amp;nbsp;&lt;/div&gt;</description>
      <category>Kaggle/타이타닉</category>
      <category>Eda</category>
      <category>Embarked</category>
      <category>Pclass</category>
      <category>객실등급별</category>
      <category>모자이크플롯</category>
      <category>선착장별</category>
      <category>시각화</category>
      <category>이진분류</category>
      <category>타이타닉</category>
      <category>티켓별</category>
      <author>qwer.ty_v</author>
      <guid isPermaLink="true">https://drewvvv.tistory.com/16</guid>
      <comments>https://drewvvv.tistory.com/16#entry16comment</comments>
      <pubDate>Mon, 9 Jan 2023 10:54:34 +0900</pubDate>
    </item>
    <item>
      <title>타이타닉 생존자 예측 분석 (2-2) EDA(연령대별) - v.1.0.1</title>
      <link>https://drewvvv.tistory.com/15</link>
      <description>&lt;p data-ke-size=&quot;size14&quot;&gt;&lt;b&gt;이전 포스트&lt;/b&gt;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&lt;a href=&quot;https://drewvvv.tistory.com/14&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;2023.01.04 - [Kaggle/타이타닉] - 타이타닉 생존자 예측 분석 (2-1) EDA(성별) v.1.0.1&lt;/a&gt;&lt;/p&gt;
&lt;figure id=&quot;og_1672893447037&quot; contenteditable=&quot;false&quot; data-ke-type=&quot;opengraph&quot; data-ke-align=&quot;alignCenter&quot; data-og-type=&quot;article&quot; data-og-title=&quot;타이타닉 생존자 예측 분석 (2-1) EDA(성별) - v.1.0.1&quot; data-og-description=&quot;- 개요 우선 데이터 사이언티스트 (이하 DS)의 꿈을 가장 크게 꾸게 해준 타이타닉은 매우 흥미로웠다. 타이타닉에 탑승했던 사람들의 일련의 데이터들을 토대로 정보로 이끌어 내어 분석하여 그&quot; data-og-host=&quot;drewvvv.tistory.com&quot; data-og-source-url=&quot;https://drewvvv.tistory.com/14&quot; data-og-url=&quot;https://drewvvv.tistory.com/14&quot; data-og-image=&quot;https://scrap.kakaocdn.net/dn/50cgt/hyRasQ99FT/em0SH3k7nxVUFPBZxFWeKK/img.png?width=800&amp;amp;height=241&amp;amp;face=0_0_800_241,https://scrap.kakaocdn.net/dn/bo2jzZ/hyRaH8En9n/5x0Z4VHYvhOoV01jmsfoCK/img.png?width=800&amp;amp;height=241&amp;amp;face=0_0_800_241,https://scrap.kakaocdn.net/dn/bSHCLG/hyRaH8En7a/kkuXtkbQ9bnGtd40ccSLQK/img.png?width=1459&amp;amp;height=440&amp;amp;face=0_0_1459_440&quot;&gt;&lt;a href=&quot;https://drewvvv.tistory.com/14&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot; data-source-url=&quot;https://drewvvv.tistory.com/14&quot;&gt;
&lt;div class=&quot;og-image&quot; style=&quot;background-image: url('https://scrap.kakaocdn.net/dn/50cgt/hyRasQ99FT/em0SH3k7nxVUFPBZxFWeKK/img.png?width=800&amp;amp;height=241&amp;amp;face=0_0_800_241,https://scrap.kakaocdn.net/dn/bo2jzZ/hyRaH8En9n/5x0Z4VHYvhOoV01jmsfoCK/img.png?width=800&amp;amp;height=241&amp;amp;face=0_0_800_241,https://scrap.kakaocdn.net/dn/bSHCLG/hyRaH8En7a/kkuXtkbQ9bnGtd40ccSLQK/img.png?width=1459&amp;amp;height=440&amp;amp;face=0_0_1459_440');&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;og-text&quot;&gt;
&lt;p class=&quot;og-title&quot; style=&quot;max-width: 490px;&quot; data-ke-size=&quot;size32&quot;&gt;타이타닉 생존자 예측 분석 (2-1) EDA(성별) - v.1.0.1&lt;/p&gt;
&lt;p class=&quot;og-desc&quot; data-ke-size=&quot;size16&quot;&gt;- 개요 우선 데이터 사이언티스트 (이하 DS)의 꿈을 가장 크게 꾸게 해준 타이타닉은 매우 흥미로웠다. 타이타닉에 탑승했던 사람들의 일련의 데이터들을 토대로 정보로 이끌어 내어 분석하여 그&lt;/p&gt;
&lt;p class=&quot;og-host&quot; data-ke-size=&quot;size16&quot;&gt;drewvvv.tistory.com&lt;/p&gt;
&lt;/div&gt;
&lt;/a&gt;&lt;/figure&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style7&quot; /&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;&lt;span style=&quot;font-size: 1.44em;&quot;&gt;3. 연령대별 - EDA&amp;nbsp;&lt;/span&gt;&lt;/h3&gt;
&lt;blockquote data-ke-style=&quot;style2&quot;&gt;age: Age is fractional if less than 1. If the age is estimated, is it in the form of xx.5&lt;br /&gt;# 나이가 1 미만인 경우 1살 미만의 영유아의 개월 수 이다.&lt;/blockquote&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;1233&quot; data-origin-height=&quot;340&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/lPjPV/btrVpoFx07p/ZGY1YVwwiJQWx0OuPwYRl1/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/lPjPV/btrVpoFx07p/ZGY1YVwwiJQWx0OuPwYRl1/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/lPjPV/btrVpoFx07p/ZGY1YVwwiJQWx0OuPwYRl1/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FlPjPV%2FbtrVpoFx07p%2FZGY1YVwwiJQWx0OuPwYRl1%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;1233&quot; height=&quot;340&quot; data-origin-width=&quot;1233&quot; data-origin-height=&quot;340&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;연령대별 분포를 확인하기 이전에 위의 설명&lt;span style=&quot;color: #333333;&quot;&gt;&lt;/span&gt;에서 연령이 1미만인 경우를 확인해본다.&lt;/li&gt;
&lt;li&gt;데이터는 몇개 없으나 영유아의 경우 Parch가 1이상인 것을 확인할 수 있다.&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;div id=&quot;dicLayer&quot; style=&quot;color: #000000; font-size: 12px; font-family: Arial; background: -webkit-linear-gradient(bottom, #ffeb00, #ffdc00); width: 400px; height: 150px; display: none;&quot;&gt;
&lt;div id=&quot;dicLayerContents&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div id=&quot;dicLayerSub&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;/div&gt;
&lt;div id=&quot;dicRawData&quot; style=&quot;display: none;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignLeft&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;261&quot; data-origin-height=&quot;430&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/IQPtx/btrVpDo6sCD/dWx8M0CH9FOXbOwdEwBh1K/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/IQPtx/btrVpDo6sCD/dWx8M0CH9FOXbOwdEwBh1K/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/IQPtx/btrVpDo6sCD/dWx8M0CH9FOXbOwdEwBh1K/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FIQPtx%2FbtrVpDo6sCD%2FdWx8M0CH9FOXbOwdEwBh1K%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;261&quot; height=&quot;430&quot; data-origin-width=&quot;261&quot; data-origin-height=&quot;430&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;트레인 셋의 결측치를 확인해보니 Age에서 177개가 확인되었다.&amp;nbsp;&lt;/li&gt;
&lt;li&gt;결측치를 처리하는 방법은 대체/제외가 있고, 다른 버전의 EDA에서는 성능에 따른 다양한 결측치 처리 방법을 시도해 볼 것이다.&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;div class=&quot;colorscripter-code&quot; style=&quot;color: #a9b7c6; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; position: relative !important; overflow: auto;&quot;&gt;
&lt;table class=&quot;colorscripter-code-table&quot; style=&quot;margin: 0; padding: 0; border: none; background-color: #2b2b2b; border-radius: 4px;&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; data-ke-align=&quot;alignLeft&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&quot;padding: 6px; border-right: 2px solid #4f4f4f;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; word-break: normal; text-align: right; color: #aaa; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;1&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;2&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;3&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;4&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;5&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;6&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;padding: 6px 0; text-align: left;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; color: #a9b7c6; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #808080;&quot;&gt;#&amp;nbsp;rugplot&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #808080;&quot;&gt;#&amp;nbsp;rug는&amp;nbsp;rugplot이라고도&amp;nbsp;불리우며,&amp;nbsp;데이터&amp;nbsp;위치를&amp;nbsp;x축&amp;nbsp;위에&amp;nbsp;**작은&amp;nbsp;선분(rug)으로&amp;nbsp;나타내어&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #808080;&quot;&gt;#&amp;nbsp;데이터들의&amp;nbsp;위치&amp;nbsp;및&amp;nbsp;분포**를&amp;nbsp;보여준다.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;sns.set(rc&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;{&lt;span style=&quot;color: #6a8759;&quot;&gt;'figure.figsize'&lt;/span&gt;:(&lt;span style=&quot;color: #6897bb;&quot;&gt;10&lt;/span&gt;,&lt;span style=&quot;color: #6897bb;&quot;&gt;8&lt;/span&gt;)})&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;sns.distplot(train[&lt;span style=&quot;color: #6a8759;&quot;&gt;'Age'&lt;/span&gt;],&amp;nbsp;rug&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #8888c6;&quot;&gt;True&lt;/span&gt;,&amp;nbsp;hist&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #8888c6;&quot;&gt;True&lt;/span&gt;,&amp;nbsp;kde&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #8888c6;&quot;&gt;True&lt;/span&gt;)&amp;nbsp;&lt;span style=&quot;color: #808080;&quot;&gt;#&amp;nbsp;histplot&amp;nbsp;사용&amp;nbsp;권장&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;plt.show()&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: right; margin-top: -13px; margin-right: 5px; font-size: 9px; font-style: italic;&quot;&gt;&lt;a style=&quot;color: #4f4f4ftext-decoration:none;&quot; href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Colored by Color Scripter&lt;/a&gt;&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;vertical-align: bottom; padding: 0 2px 4px 0;&quot;&gt;&lt;a style=&quot;text-decoration: none; color: white;&quot; href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;&lt;span style=&quot;font-size: 9px; word-break: normal; background-color: #4f4f4f; color: white; border-radius: 10px; padding: 1px;&quot;&gt;cs&lt;/span&gt;&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;&lt;span style=&quot;color: #000000;&quot;&gt;우선 Age의 분포를 그래프로 확인해본다.&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignLeft&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-filename=&quot;edited_3.연령별 histplot.png&quot; data-origin-width=&quot;600&quot; data-origin-height=&quot;472&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/lea80/btrVnXV6Vse/jk3iHU57Awc4KRwa2kkxa1/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/lea80/btrVnXV6Vse/jk3iHU57Awc4KRwa2kkxa1/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/lea80/btrVnXV6Vse/jk3iHU57Awc4KRwa2kkxa1/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2Flea80%2FbtrVnXV6Vse%2Fjk3iHU57Awc4KRwa2kkxa1%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;678&quot; height=&quot;472&quot; data-filename=&quot;edited_3.연령별 histplot.png&quot; data-origin-width=&quot;600&quot; data-origin-height=&quot;472&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;현재 distplot을 사용하면 histplot을 사용하라고 경고가 뜨지만 한번 distplot의 옵셥을 주어 표현해 보았다.&amp;nbsp;&lt;/li&gt;
&lt;li&gt;연령의 분포는 어느정도 정규분포를 그리고 있으며 20~30대 구간이 많은 것을 볼 수 있다.&lt;/li&gt;
&lt;li&gt;분포가 정규분포를 그리는 것으로 보아 Age 컬럼의 구간을 나눌 때 &lt;b&gt;표준편차를 활용&lt;/b&gt;하는 것이 좋을 것이라 판단되나, 임의로 10의 크기로 구간을 분할해보도록 한다.&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;div class=&quot;colorscripter-code&quot; style=&quot;color: #a9b7c6; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; position: relative !important; overflow: auto;&quot;&gt;
&lt;table class=&quot;colorscripter-code-table&quot; style=&quot;margin: 0; padding: 0; border: none; background-color: #2b2b2b; border-radius: 4px;&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; data-ke-align=&quot;alignLeft&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&quot;padding: 6px; border-right: 2px solid #4f4f4f;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; word-break: normal; text-align: right; color: #aaa; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;1&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;2&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;3&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;4&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;5&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;6&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;7&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;8&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;9&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;10&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;11&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;12&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;13&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;14&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;15&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;16&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;17&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;18&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;19&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;20&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;21&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;22&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;23&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;24&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;25&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;padding: 6px 0; text-align: left;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; color: #a9b7c6; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #808080;&quot;&gt;#&amp;nbsp;연령대를&amp;nbsp;임의의&amp;nbsp;10의&amp;nbsp;크기로&amp;nbsp;분할&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;for&lt;/span&gt;&amp;nbsp;index,&amp;nbsp;item&amp;nbsp;&lt;span style=&quot;color: #cc7832;&quot;&gt;in&lt;/span&gt;&amp;nbsp;enumerate(train[&lt;span style=&quot;color: #6a8759;&quot;&gt;'Age'&lt;/span&gt;]):&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #cc7832;&quot;&gt;if&lt;/span&gt;&amp;nbsp;item&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;&amp;lt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6897bb;&quot;&gt;10&lt;/span&gt;:&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;result&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6897bb;&quot;&gt;0&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #cc7832;&quot;&gt;elif&lt;/span&gt;&amp;nbsp;item&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6897bb;&quot;&gt;10&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #cc7832;&quot;&gt;and&lt;/span&gt;&amp;nbsp;item&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;&amp;lt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6897bb;&quot;&gt;20&lt;/span&gt;:&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;result&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6897bb;&quot;&gt;1&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #cc7832;&quot;&gt;elif&lt;/span&gt;&amp;nbsp;item&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6897bb;&quot;&gt;20&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #cc7832;&quot;&gt;and&lt;/span&gt;&amp;nbsp;item&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;&amp;lt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6897bb;&quot;&gt;30&lt;/span&gt;:&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;result&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6897bb;&quot;&gt;2&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #cc7832;&quot;&gt;elif&lt;/span&gt;&amp;nbsp;item&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6897bb;&quot;&gt;30&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #cc7832;&quot;&gt;and&lt;/span&gt;&amp;nbsp;item&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;&amp;lt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6897bb;&quot;&gt;40&lt;/span&gt;:&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;result&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6897bb;&quot;&gt;3&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #cc7832;&quot;&gt;elif&lt;/span&gt;&amp;nbsp;item&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6897bb;&quot;&gt;40&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #cc7832;&quot;&gt;and&lt;/span&gt;&amp;nbsp;item&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;&amp;lt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6897bb;&quot;&gt;50&lt;/span&gt;:&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;result&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6897bb;&quot;&gt;4&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #cc7832;&quot;&gt;elif&lt;/span&gt;&amp;nbsp;item&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6897bb;&quot;&gt;50&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #cc7832;&quot;&gt;and&lt;/span&gt;&amp;nbsp;item&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;&amp;lt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6897bb;&quot;&gt;60&lt;/span&gt;:&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;result&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6897bb;&quot;&gt;5&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #cc7832;&quot;&gt;elif&lt;/span&gt;&amp;nbsp;item&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6897bb;&quot;&gt;60&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #cc7832;&quot;&gt;and&lt;/span&gt;&amp;nbsp;item&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;&amp;lt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6897bb;&quot;&gt;70&lt;/span&gt;:&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;result&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6897bb;&quot;&gt;6&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #cc7832;&quot;&gt;elif&lt;/span&gt;&amp;nbsp;item&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6897bb;&quot;&gt;70&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #cc7832;&quot;&gt;and&lt;/span&gt;&amp;nbsp;item&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6897bb;&quot;&gt;80&lt;/span&gt;:&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;result&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6897bb;&quot;&gt;7&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #cc7832;&quot;&gt;elif&lt;/span&gt;&amp;nbsp;item&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;&amp;gt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6897bb;&quot;&gt;80&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #cc7832;&quot;&gt;and&lt;/span&gt;&amp;nbsp;item&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;&amp;lt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6897bb;&quot;&gt;90&lt;/span&gt;:&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;result&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6897bb;&quot;&gt;8&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #cc7832;&quot;&gt;else&lt;/span&gt;:&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;result&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6897bb;&quot;&gt;99&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;train.loc[index,&amp;nbsp;&lt;span style=&quot;color: #6a8759;&quot;&gt;'ca_Age'&lt;/span&gt;]&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;result&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;train[&lt;span style=&quot;color: #6a8759;&quot;&gt;'ca_Age'&lt;/span&gt;]&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;vertical-align: bottom; padding: 0 2px 4px 0;&quot;&gt;&lt;a style=&quot;text-decoration: none; color: white;&quot; href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;&lt;span style=&quot;font-size: 9px; word-break: normal; background-color: #4f4f4f; color: white; border-radius: 10px; padding: 1px;&quot;&gt;cs&lt;/span&gt;&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;img style=&quot;text-align: center; caret-color: transparent; color: #333333; font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'Apple SD Gothic Neo', Arial, sans-serif; letter-spacing: 0px;&quot; src=&quot;https://blog.kakaocdn.net/dn/su92F/btrVt3f2uuQ/c4vDPtWhyuR0Kp7kGOGqak/img.png&quot; data-origin-width=&quot;1334&quot; data-origin-height=&quot;659&quot; data-is-animation=&quot;false&quot; /&gt;&lt;/div&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;연령대 범주별 분포&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-filename=&quot;blob&quot; data-origin-width=&quot;1000&quot; data-origin-height=&quot;522&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/d5dt8n/btrVqg1Wc4B/DtwgSyMnSnDccBTXmOBAn1/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/d5dt8n/btrVqg1Wc4B/DtwgSyMnSnDccBTXmOBAn1/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/d5dt8n/btrVqg1Wc4B/DtwgSyMnSnDccBTXmOBAn1/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2Fd5dt8n%2FbtrVqg1Wc4B%2FDtwgSyMnSnDccBTXmOBAn1%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;1000&quot; height=&quot;522&quot; data-filename=&quot;blob&quot; data-origin-width=&quot;1000&quot; data-origin-height=&quot;522&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;div id=&quot;dicLayer&quot;&gt;
&lt;div id=&quot;dicLayerSub&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;/div&gt;
&lt;div id=&quot;dicRawData&quot; style=&quot;display: none;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;연령대 범주별 생존율&lt;/li&gt;
&lt;li&gt;연령대별/성별로 구분한 경우 모든 연령대에서 여성의 생존이 남성보다 높음을 확인할 수 있다.&lt;/li&gt;
&lt;/ul&gt;
&lt;div id=&quot;dicLayerLoader&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;colorscripter-code&quot; style=&quot;color: #a9b7c6; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; position: relative !important; overflow: auto;&quot;&gt;
&lt;table class=&quot;colorscripter-code-table&quot; style=&quot;margin: 0; padding: 0; border: none; background-color: #2b2b2b; border-radius: 4px;&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; data-ke-align=&quot;alignLeft&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&quot;padding: 6px; border-right: 2px solid #4f4f4f;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; word-break: normal; text-align: right; color: #aaa; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;1&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;2&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;3&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;4&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;5&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;6&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;7&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;8&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;9&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;10&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;padding: 6px 0; text-align: left;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; color: #a9b7c6; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;fig&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;plt.figure(figsize&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;(&lt;span style=&quot;color: #6897bb;&quot;&gt;10&lt;/span&gt;,&lt;span style=&quot;color: #6897bb;&quot;&gt;5&lt;/span&gt;))&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;area01&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;fig.add_subplot(&lt;span style=&quot;color: #6897bb;&quot;&gt;1&lt;/span&gt;,&lt;span style=&quot;color: #6897bb;&quot;&gt;2&lt;/span&gt;,&lt;span style=&quot;color: #6897bb;&quot;&gt;1&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;area02&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;fig.add_subplot(&lt;span style=&quot;color: #6897bb;&quot;&gt;1&lt;/span&gt;,&lt;span style=&quot;color: #6897bb;&quot;&gt;2&lt;/span&gt;,&lt;span style=&quot;color: #6897bb;&quot;&gt;2&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;sns.countplot(data&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;train,&amp;nbsp;x&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6a8759;&quot;&gt;'ca_Age'&lt;/span&gt;,&amp;nbsp;hue&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6a8759;&quot;&gt;&quot;Sex&quot;&lt;/span&gt;,&amp;nbsp;ax&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;area01)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;sns.barplot(data&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;train,&amp;nbsp;x&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6a8759;&quot;&gt;&quot;ca_Age&quot;&lt;/span&gt;,&amp;nbsp;y&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6a8759;&quot;&gt;&quot;Survived&quot;&lt;/span&gt;,&amp;nbsp;hue&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6a8759;&quot;&gt;&quot;Sex&quot;&lt;/span&gt;,&amp;nbsp;errwidth&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6897bb;&quot;&gt;0&lt;/span&gt;,&amp;nbsp;ax&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;area02)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;plt.show()&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #808080;&quot;&gt;#&amp;nbsp;전체&amp;nbsp;각&amp;nbsp;연령대에서&amp;nbsp;남성이&amp;nbsp;여성보다&amp;nbsp;많지만&amp;nbsp;생존의&amp;nbsp;경우는&amp;nbsp;ca_Age&amp;nbsp;0을&amp;nbsp;제외하고&amp;nbsp;모두&amp;nbsp;여성이&amp;nbsp;높음&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: right; margin-top: -13px; margin-right: 5px; font-size: 9px; font-style: italic;&quot;&gt;&lt;a style=&quot;color: #4f4f4ftext-decoration:none;&quot; href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Colored by Color Scripter&lt;/a&gt;&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;vertical-align: bottom; padding: 0 2px 4px 0;&quot;&gt;&lt;a style=&quot;text-decoration: none; color: white;&quot; href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;&lt;span style=&quot;font-size: 9px; word-break: normal; background-color: #4f4f4f; color: white; border-radius: 10px; padding: 1px;&quot;&gt;cs&lt;/span&gt;&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div id=&quot;dicLayer&quot;&gt;
&lt;div id=&quot;dicLayerSub&quot;&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-filename=&quot;3.연령별 count and bar plot .png&quot; data-origin-width=&quot;855&quot; data-origin-height=&quot;456&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/bj1Fd0/btrVsJvGAgB/AyFJhdmaatbHzD89bNPaI1/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/bj1Fd0/btrVsJvGAgB/AyFJhdmaatbHzD89bNPaI1/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/bj1Fd0/btrVsJvGAgB/AyFJhdmaatbHzD89bNPaI1/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2Fbj1Fd0%2FbtrVsJvGAgB%2FAyFJhdmaatbHzD89bNPaI1%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;855&quot; height=&quot;456&quot; data-filename=&quot;3.연령별 count and bar plot .png&quot; data-origin-width=&quot;855&quot; data-origin-height=&quot;456&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;전체 각 연령대에서 남성이 여성보다 많지만 생존의 경우는 ca_Age == 0은 나름 비등하지만 나머지 모두에선 여성이 높음을 확인할 수 있다.&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;div class=&quot;colorscripter-code&quot; style=&quot;color: #a9b7c6; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; position: relative !important; overflow: auto;&quot;&gt;
&lt;table class=&quot;colorscripter-code-table&quot; style=&quot;margin: 0; padding: 0; border: none; background-color: #2b2b2b; border-radius: 4px;&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; data-ke-align=&quot;alignLeft&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&quot;padding: 6px; border-right: 2px solid #4f4f4f;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; word-break: normal; text-align: right; color: #aaa; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;1&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;2&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;3&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;4&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;5&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;6&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;7&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;8&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;padding: 6px 0; text-align: left;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; color: #a9b7c6; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;from&lt;/span&gt;&amp;nbsp;statsmodels.graphics.mosaicplot&amp;nbsp;&lt;span style=&quot;color: #cc7832;&quot;&gt;import&lt;/span&gt;&amp;nbsp;mosaic&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;mosaic(train.sort_values(&lt;span style=&quot;color: #6a8759;&quot;&gt;'Pclass'&lt;/span&gt;),&amp;nbsp;[&lt;span style=&quot;color: #6a8759;&quot;&gt;'Survived'&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #6a8759;&quot;&gt;'ca_Age'&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #6a8759;&quot;&gt;'Sex'&lt;/span&gt;],&amp;nbsp;gap&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #6897bb;&quot;&gt;0.&lt;/span&gt;&lt;span style=&quot;color: #6897bb;&quot;&gt;002&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;plt.title(&lt;span style=&quot;color: #6a8759;&quot;&gt;'Survivor&amp;nbsp;of&amp;nbsp;Titanic'&lt;/span&gt;,&amp;nbsp;fontsize&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #6897bb;&quot;&gt;20&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;plt.show()&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #808080;&quot;&gt;#&amp;nbsp;대부분의&amp;nbsp;연령대별&amp;nbsp;사망자는&amp;nbsp;남자가&amp;nbsp;지배적&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: right; margin-top: -13px; margin-right: 5px; font-size: 9px; font-style: italic;&quot;&gt;&lt;a style=&quot;color: #4f4f4ftext-decoration:none;&quot; href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Colored by Color Scripter&lt;/a&gt;&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;vertical-align: bottom; padding: 0 2px 4px 0;&quot;&gt;&lt;a style=&quot;text-decoration: none; color: white;&quot; href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;&lt;span style=&quot;font-size: 9px; word-break: normal; background-color: #4f4f4f; color: white; border-radius: 10px; padding: 1px;&quot;&gt;cs&lt;/span&gt;&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-filename=&quot;3. 연령대별-성별 생존율 mosaic plot.png&quot; data-origin-width=&quot;858&quot; data-origin-height=&quot;718&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/2c6ms/btrVujiOCWM/8AW5HVdCSRoMRFh4hWcpr1/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/2c6ms/btrVujiOCWM/8AW5HVdCSRoMRFh4hWcpr1/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/2c6ms/btrVujiOCWM/8AW5HVdCSRoMRFh4hWcpr1/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2F2c6ms%2FbtrVujiOCWM%2F8AW5HVdCSRoMRFh4hWcpr1%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;858&quot; height=&quot;718&quot; data-filename=&quot;3. 연령대별-성별 생존율 mosaic plot.png&quot; data-origin-width=&quot;858&quot; data-origin-height=&quot;718&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;대부분의 연령대별 사망자는 남자가 지배적인 것을 확인할 수 있다.&lt;/li&gt;
&lt;/ul&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style7&quot; /&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&lt;b&gt;다음 포스트&lt;/b&gt;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&lt;a href=&quot;https://drewvvv.tistory.com/16&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;2023.01.09 - [분류 전체보기] - 타이타닉 생존자 예측 분석 (2-3) EDA(상관관계 및 기타) - v.1.0.1&lt;/a&gt;&lt;/p&gt;
&lt;figure id=&quot;og_1673251327691&quot; contenteditable=&quot;false&quot; data-ke-type=&quot;opengraph&quot; data-ke-align=&quot;alignCenter&quot; data-og-type=&quot;article&quot; data-og-title=&quot;타이타닉 생존자 예측 분석 (2-3) EDA(상관관계 및 기타) - v.1.0.1&quot; data-og-description=&quot;이전 포스트 타이타닉 생존자 예측 분석 (2-2) EDA(연령대별) - v.1.0.1 이전 포스트 타이타닉 생존자 예측 분석 (2-1) EDA(성별) - v.1.0.1 - 개요 우선 데이터 사이언티스트 (이하 DS)의 꿈을 가장 크게 꾸&quot; data-og-host=&quot;drewvvv.tistory.com&quot; data-og-source-url=&quot;https://drewvvv.tistory.com/16&quot; data-og-url=&quot;https://drewvvv.tistory.com/16&quot; data-og-image=&quot;https://scrap.kakaocdn.net/dn/cibczK/hyRdR4Gm0C/HU4H0umvy8O1X8CLJVOoW0/img.png?width=800&amp;amp;height=807&amp;amp;face=0_0_800_807,https://scrap.kakaocdn.net/dn/chr9Q0/hyRdFXm7Og/6uVJKjd2rWhRPxOGnZGG3K/img.png?width=921&amp;amp;height=807&amp;amp;face=0_0_921_807&quot;&gt;&lt;a href=&quot;https://drewvvv.tistory.com/16&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot; data-source-url=&quot;https://drewvvv.tistory.com/16&quot;&gt;
&lt;div class=&quot;og-image&quot; style=&quot;background-image: url('https://scrap.kakaocdn.net/dn/cibczK/hyRdR4Gm0C/HU4H0umvy8O1X8CLJVOoW0/img.png?width=800&amp;amp;height=807&amp;amp;face=0_0_800_807,https://scrap.kakaocdn.net/dn/chr9Q0/hyRdFXm7Og/6uVJKjd2rWhRPxOGnZGG3K/img.png?width=921&amp;amp;height=807&amp;amp;face=0_0_921_807');&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;og-text&quot;&gt;
&lt;p class=&quot;og-title&quot; data-ke-size=&quot;size16&quot;&gt;타이타닉 생존자 예측 분석 (2-3) EDA(상관관계 및 기타) - v.1.0.1&lt;/p&gt;
&lt;p class=&quot;og-desc&quot; data-ke-size=&quot;size16&quot;&gt;이전 포스트 타이타닉 생존자 예측 분석 (2-2) EDA(연령대별) - v.1.0.1 이전 포스트 타이타닉 생존자 예측 분석 (2-1) EDA(성별) - v.1.0.1 - 개요 우선 데이터 사이언티스트 (이하 DS)의 꿈을 가장 크게 꾸&lt;/p&gt;
&lt;p class=&quot;og-host&quot; data-ke-size=&quot;size16&quot;&gt;drewvvv.tistory.com&lt;/p&gt;
&lt;/div&gt;
&lt;/a&gt;&lt;/figure&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;div id=&quot;dicLayer&quot;&gt;
&lt;div id=&quot;dicLayerContents&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div id=&quot;dicLayerSub&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;/div&gt;
&lt;div id=&quot;dicRawData&quot; style=&quot;display: none;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div id=&quot;dicLayerLoader&quot;&gt;&amp;nbsp;&lt;/div&gt;</description>
      <category>Kaggle/타이타닉</category>
      <category>Eda</category>
      <category>모자이크플롯</category>
      <category>연령대별</category>
      <category>이진분류</category>
      <category>타이타닉</category>
      <category>탐색적분석</category>
      <author>qwer.ty_v</author>
      <guid isPermaLink="true">https://drewvvv.tistory.com/15</guid>
      <comments>https://drewvvv.tistory.com/15#entry15comment</comments>
      <pubDate>Thu, 5 Jan 2023 13:33:24 +0900</pubDate>
    </item>
    <item>
      <title>타이타닉 생존자 예측 분석 (2-1) EDA(성별) v.1.0.1</title>
      <link>https://drewvvv.tistory.com/14</link>
      <description>&lt;div id=&quot;dicLayer&quot; style=&quot;color: #000000; font-size: 12px; font-family: Arial; background: -webkit-linear-gradient(bottom, #ffeb00, #ffdc00); width: 400px; height: 150px; --darkreader-inline-color: #fffff6; --darkreader-inline-bgimage: -webkit-linear-gradient(bottom, #aea01f, #ad981e); --darkreader-inline-bgcolor: initial; display: none;&quot; data-darkreader-inline-color=&quot;&quot; data-darkreader-inline-bgimage=&quot;&quot; data-darkreader-inline-bgcolor=&quot;&quot;&gt;
&lt;div id=&quot;dicLayerContents&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div id=&quot;dicLayerSub&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;/div&gt;
&lt;div id=&quot;dicRawData&quot; style=&quot;display: none;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;h2 data-ke-size=&quot;size26&quot;&gt;- 개요&lt;/h2&gt;
&lt;div id=&quot;dicLayerLoader&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&lt;span style=&quot;color: #000000;&quot; data-darkreader-inline-color=&quot;&quot;&gt;우선 데이터 사이언티스트 (이하 DS)의 꿈을 가장 크게 꾸게 해준 타이타닉은 매우 흥미로웠다.&lt;/span&gt;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&lt;span style=&quot;color: #000000;&quot; data-darkreader-inline-color=&quot;&quot;&gt;타이타닉에 탑승했던 사람들의 일련의 데이터들을 토대로 정보로 이끌어 내어 분석하여 그 사람이 살았을지 죽었을지를 예측할 수 있다는 것이 말이다.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style8&quot; /&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;blockquote data-ke-style=&quot;style3&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: #000000;&quot; data-darkreader-inline-color=&quot;&quot;&gt;타이타닉은 생존 여부를 예측하는 이진 분류(binary claasification) 이다.&lt;/span&gt;&lt;/b&gt;&lt;/blockquote&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&lt;span style=&quot;color: #000000;&quot; data-darkreader-inline-color=&quot;&quot;&gt;&lt;span style=&quot;--darkreader-inline-color: #fbebcf;&quot;&gt;일례로 들면, &lt;/span&gt;이는 고양이와 강아지 사진들 속에서 이 사진 속 동물이 고양이인지 강아지인지 맞추는 것과 같다.&lt;/span&gt;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&lt;span style=&quot;color: #000000;&quot; data-darkreader-inline-color=&quot;&quot;&gt;단, 그 사진 속 특징 정보들이 각기 상이한 정보이고, 데이터로서 분산되어 있어서 그 분산된 데이터를 토대로 정보를 도출하여 사진 속 동물을 정확히 분류하는데 목표한다.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&lt;span style=&quot;color: #000000;&quot; data-darkreader-inline-color=&quot;&quot;&gt;따라 아래에서 타이타닉의 데이터들을 토대로 정보를 도출하고 생존자 분류를 시작한다.&lt;/span&gt;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;h2 data-ke-size=&quot;size26&quot;&gt;- EDA (탐색적 분석)&lt;/h2&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;1. 데이터 획득&lt;/h3&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;데이터는 아래 캐글 사이트 내의 타이타닉 컴피티션에서 획득할 수 있다.&lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote data-ke-style=&quot;style3&quot;&gt;&lt;a title=&quot;캐글 타이타닉&quot; href=&quot;https://www.kaggle.com/competitions/titanic/data&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;https://www.kaggle.com/competitions/titanic/data&lt;/a&gt;&lt;/blockquote&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;1459&quot; data-origin-height=&quot;440&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/5RJMl/btrVpfm79av/8zWBugeK6kXjZ9aSzGk0w0/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/5RJMl/btrVpfm79av/8zWBugeK6kXjZ9aSzGk0w0/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/5RJMl/btrVpfm79av/8zWBugeK6kXjZ9aSzGk0w0/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2F5RJMl%2FbtrVpfm79av%2F8zWBugeK6kXjZ9aSzGk0w0%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;1459&quot; height=&quot;440&quot; data-origin-width=&quot;1459&quot; data-origin-height=&quot;440&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&lt;span style=&quot;color: #000000;&quot; data-darkreader-inline-color=&quot;&quot;&gt;데이터를 다운받은 후&lt;/span&gt;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&lt;span style=&quot;color: #000000;&quot; data-darkreader-inline-color=&quot;&quot;&gt;EDA에 기본적으로 필요한 라이브러리를 import하고 데이터를 불러온다.&lt;/span&gt;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;div class=&quot;colorscripter-code&quot; style=&quot;color: #a9b7c6; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; position: relative !important; overflow: auto;&quot; data-darkreader-inline-color=&quot;&quot;&gt;
&lt;table class=&quot;colorscripter-code-table&quot; style=&quot;margin: 0; padding: 0; border: none; background-color: #2b2b2b; border-radius: 4px;&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; data-ke-align=&quot;alignLeft&quot; data-darkreader-inline-border-top=&quot;&quot; data-darkreader-inline-border-right=&quot;&quot; data-darkreader-inline-border-bottom=&quot;&quot; data-darkreader-inline-border-left=&quot;&quot; data-darkreader-inline-bgcolor=&quot;&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&quot;padding: 6px; border-right: 2px solid #4f4f4f;&quot; data-darkreader-inline-border-right=&quot;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; word-break: normal; text-align: right; color: #aaa; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot; data-darkreader-inline-color=&quot;&quot;&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;1&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;2&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;3&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;4&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;5&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;6&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;7&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;8&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;9&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;10&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;11&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;12&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;13&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;padding: 6px 0; text-align: left;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; color: #a9b7c6; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot; data-darkreader-inline-color=&quot;&quot;&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #cc7832;&quot; data-darkreader-inline-color=&quot;&quot;&gt;import&lt;/span&gt;&amp;nbsp;pandas&amp;nbsp;&lt;span style=&quot;color: #cc7832;&quot; data-darkreader-inline-color=&quot;&quot;&gt;as&lt;/span&gt;&amp;nbsp;pd&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #cc7832;&quot; data-darkreader-inline-color=&quot;&quot;&gt;import&lt;/span&gt;&amp;nbsp;numpy&amp;nbsp;&lt;span style=&quot;color: #cc7832;&quot; data-darkreader-inline-color=&quot;&quot;&gt;as&lt;/span&gt;&amp;nbsp;np&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #cc7832;&quot; data-darkreader-inline-color=&quot;&quot;&gt;import&lt;/span&gt;&amp;nbsp;matplotlib.pyplot&amp;nbsp;&lt;span style=&quot;color: #cc7832;&quot; data-darkreader-inline-color=&quot;&quot;&gt;as&lt;/span&gt;&amp;nbsp;plt&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #cc7832;&quot; data-darkreader-inline-color=&quot;&quot;&gt;import&lt;/span&gt;&amp;nbsp;seaborn&amp;nbsp;&lt;span style=&quot;color: #cc7832;&quot; data-darkreader-inline-color=&quot;&quot;&gt;as&lt;/span&gt;&amp;nbsp;sns&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #808080;&quot; data-darkreader-inline-color=&quot;&quot;&gt;#&amp;nbsp;한글&amp;nbsp;폰트&amp;nbsp;적용&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;plt.rc(&lt;span style=&quot;color: #6a8759;&quot; data-darkreader-inline-color=&quot;&quot;&gt;'font'&lt;/span&gt;,&amp;nbsp;family&lt;span style=&quot;color: #a9b7c6;&quot; data-darkreader-inline-color=&quot;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot; data-darkreader-inline-color=&quot;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #6a8759;&quot; data-darkreader-inline-color=&quot;&quot;&gt;'Malgun&amp;nbsp;Gothic'&lt;/span&gt;)&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #808080;&quot; data-darkreader-inline-color=&quot;&quot;&gt;#&amp;nbsp;캔버스&amp;nbsp;사이즈&amp;nbsp;적용&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;plt.rcParams[&lt;span style=&quot;color: #6a8759;&quot; data-darkreader-inline-color=&quot;&quot;&gt;&quot;figure.figsize&quot;&lt;/span&gt;]&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot; data-darkreader-inline-color=&quot;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot; data-darkreader-inline-color=&quot;&quot;&gt;=&lt;/span&gt;&amp;nbsp;(&lt;span style=&quot;color: #6897bb;&quot; data-darkreader-inline-color=&quot;&quot;&gt;12&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #6897bb;&quot; data-darkreader-inline-color=&quot;&quot;&gt;9&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;train&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot; data-darkreader-inline-color=&quot;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot; data-darkreader-inline-color=&quot;&quot;&gt;=&lt;/span&gt;&amp;nbsp;pd.read_csv(&lt;span style=&quot;color: #6a8759;&quot; data-darkreader-inline-color=&quot;&quot;&gt;&quot;../input/train.csv&quot;&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;test&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot; data-darkreader-inline-color=&quot;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot; data-darkreader-inline-color=&quot;&quot;&gt;=&lt;/span&gt;&amp;nbsp;pd.read_csv(&lt;span style=&quot;color: #6a8759;&quot; data-darkreader-inline-color=&quot;&quot;&gt;&quot;../input/test.csv&quot;&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;gender&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot; data-darkreader-inline-color=&quot;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot; data-darkreader-inline-color=&quot;&quot;&gt;=&lt;/span&gt;&amp;nbsp;pd.read_csv(&lt;span style=&quot;color: #6a8759;&quot; data-darkreader-inline-color=&quot;&quot;&gt;&quot;../input/gender_submission.csv&quot;&lt;/span&gt;)&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;vertical-align: bottom; padding: 0 2px 4px 0;&quot;&gt;&lt;a style=&quot;text-decoration: none; color: white;&quot; href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot; data-darkreader-inline-color=&quot;&quot;&gt;&lt;span style=&quot;font-size: 9px; word-break: normal; background-color: #4f4f4f; color: white; border-radius: 10px; padding: 1px;&quot; data-darkreader-inline-bgcolor=&quot;&quot; data-darkreader-inline-color=&quot;&quot;&gt;cs&lt;/span&gt;&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;div style=&quot;color: #a9b7c6;&quot; data-darkreader-inline-color=&quot;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;color: #a9b7c6;&quot; data-darkreader-inline-color=&quot;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;color: #a9b7c6;&quot; data-darkreader-inline-color=&quot;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;blockquote id=&quot;description&quot; style=&quot;color: #a9b7c6;&quot; data-ke-style=&quot;style3&quot; data-darkreader-inline-color=&quot;&quot;&gt;&lt;span style=&quot;color: #000000;&quot; data-darkreader-inline-color=&quot;&quot;&gt;변수 설명 : 캐글 내에 있는 데이터 설명&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #000000;&quot; data-darkreader-inline-color=&quot;&quot;&gt;survival &amp;nbsp; &amp;nbsp;Survival &amp;nbsp; &amp;nbsp;0 = No, 1 = Yes # 생존 여부 - 우리의 target 데이터이다.&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #000000;&quot; data-darkreader-inline-color=&quot;&quot;&gt;pclass &amp;nbsp;Ticket class &amp;nbsp; &amp;nbsp;1 = 1st, 2 = 2nd, 3 = 3rd # 승객의 티켓 등급이다. (객실 등급)&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #000000;&quot; data-darkreader-inline-color=&quot;&quot;&gt;sex Sex&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #000000;&quot; data-darkreader-inline-color=&quot;&quot;&gt;Age Age in years &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #000000;&quot; data-darkreader-inline-color=&quot;&quot;&gt;sibsp &amp;nbsp; # of siblings / spouses aboard the Titanic # 같이 탑승한 형제자매, 배우자 수&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #000000;&quot; data-darkreader-inline-color=&quot;&quot;&gt;parch &amp;nbsp; # of parents / children aboard the Titanic # 같이 탑승한 부모, 자식 수&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #000000;&quot; data-darkreader-inline-color=&quot;&quot;&gt;ticket &amp;nbsp;Ticket number&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #000000;&quot; data-darkreader-inline-color=&quot;&quot;&gt;fare &amp;nbsp; &amp;nbsp;Passenger fare &amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #000000;&quot; data-darkreader-inline-color=&quot;&quot;&gt;cabin &amp;nbsp; Cabin number # 승객의 객실 번호&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #000000;&quot; data-darkreader-inline-color=&quot;&quot;&gt;embarked &amp;nbsp; &amp;nbsp;Port of Embarkation # 승객이 탑승한 항구&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: #000000;&quot; data-darkreader-inline-color=&quot;&quot;&gt;pclass: A proxy for socio-economic status (SES)&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #000000;&quot; data-darkreader-inline-color=&quot;&quot;&gt;1st = Upper&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #000000;&quot; data-darkreader-inline-color=&quot;&quot;&gt;2nd = Middle&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #000000;&quot; data-darkreader-inline-color=&quot;&quot;&gt;3rd = Lower&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: #000000;&quot; data-darkreader-inline-color=&quot;&quot;&gt;age: Age is fractional if less than 1. If the age is estimated, is it in the form of xx.5&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #000000;&quot; data-darkreader-inline-color=&quot;&quot;&gt;&lt;span&gt;# 나이가 1 미만인 경우 1살 미만의 영유아의 개월 수 이다.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/blockquote&gt;
&lt;p style=&quot;color: #a9b7c6;&quot; data-ke-size=&quot;size16&quot; data-darkreader-inline-color=&quot;&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;span&gt;&lt;/span&gt; &lt;span style=&quot;color: #000000;&quot; data-darkreader-inline-color=&quot;&quot;&gt;우리가 모델을 학습시키기 위해 사용할 데이터셋은 train 데이터셋이고&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot; data-darkreader-inline-color=&quot;&quot;&gt;먼저 train에 대한 기술 통계를 확인해본다.&amp;nbsp;&lt;/span&gt;&lt;figure class=&quot;imageblock alignLeft&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;990&quot; data-origin-height=&quot;448&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/OwYCx/btrVpZEh1bx/OMILatt9ivGRdwig3BeuZ0/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/OwYCx/btrVpZEh1bx/OMILatt9ivGRdwig3BeuZ0/img.png&quot; data-alt=&quot;train 데이터셋의 기술통계&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/OwYCx/btrVpZEh1bx/OMILatt9ivGRdwig3BeuZ0/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FOwYCx%2FbtrVpZEh1bx%2FOMILatt9ivGRdwig3BeuZ0%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;990&quot; height=&quot;448&quot; data-origin-width=&quot;990&quot; data-origin-height=&quot;448&quot;/&gt;&lt;/span&gt;&lt;figcaption&gt;train 데이터셋의 기술통계&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;/div&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;&lt;span style=&quot;color: #000000;&quot; data-darkreader-inline-color=&quot;&quot;&gt;사실 describe() 함수는 각 컬럼의 갯수 평균과 표준편차 그리고 사분위 수를 표시해 주는데 해당 자료가 필요한 이터는 연속형 변수인 Age와 Fare 뿐이다.&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: #000000;&quot; data-darkreader-inline-color=&quot;&quot;&gt;passengerId와 Pclass, SibSp, Parch는 명목형 변수이다.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: #000000;&quot; data-darkreader-inline-color=&quot;&quot;&gt;하지만 python의 pandas에서는 해당 자료형들이 아래와 같이 int64이기 때문에 위와 같이 분류하게 된다.&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot; data-darkreader-inline-color=&quot;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot; data-darkreader-inline-color=&quot;&quot;&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignLeft&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;355&quot; data-origin-height=&quot;522&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/WWB1W/btrVpu5EeOM/kO4n77tl8vDpGFkDdneIL1/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/WWB1W/btrVpu5EeOM/kO4n77tl8vDpGFkDdneIL1/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/WWB1W/btrVpu5EeOM/kO4n77tl8vDpGFkDdneIL1/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FWWB1W%2FbtrVpu5EeOM%2FkO4n77tl8vDpGFkDdneIL1%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;355&quot; height=&quot;522&quot; data-origin-width=&quot;355&quot; data-origin-height=&quot;522&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;연속형으로 분류된 column들을 명목형으로 다시 분류하려면 형변환을하면 된다.&lt;/li&gt;
&lt;li&gt;명목형 변수의 describe를 보려면 train.describe(include=['O']) 와 같이 파라미터를 넣어주면 된다.&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style7&quot; /&gt;&lt;/div&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;2. 성별 - EDA (탐색적 현황 분석)&lt;/h3&gt;
&lt;h4 data-ke-size=&quot;size20&quot;&gt;성별 구분에 따른 분포&lt;/h4&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;1322&quot; data-origin-height=&quot;220&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/TPMV7/btrVnZFgNjq/4xhGWEf5kXb0zxSo80C4E1/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/TPMV7/btrVnZFgNjq/4xhGWEf5kXb0zxSo80C4E1/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/TPMV7/btrVnZFgNjq/4xhGWEf5kXb0zxSo80C4E1/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FTPMV7%2FbtrVnZFgNjq%2F4xhGWEf5kXb0zxSo80C4E1%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;1322&quot; height=&quot;220&quot; data-origin-width=&quot;1322&quot; data-origin-height=&quot;220&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;성별에 따른 생존확률을 보면, 각각 여성의 경우 0.74, 남성의 경우 0.19의 평균을 가진다.&amp;nbsp;&lt;/li&gt;
&lt;li&gt;이는 평균적으로 여성이 남성보다 높은 생존 확률을 가지는 것을 볼 수 있다.&lt;/li&gt;
&lt;/ul&gt;
&lt;div id=&quot;dicLayerLoader&quot;&gt;관련된 내용을 막대 그래프를 이용해서 나타내면 다음과 같다.&lt;/div&gt;
&lt;div class=&quot;colorscripter-code&quot; style=&quot;color: #a9b7c6; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; position: relative !important; overflow: auto;&quot;&gt;
&lt;table class=&quot;colorscripter-code-table&quot; style=&quot;margin: 0; padding: 0; border: none; background-color: #2b2b2b; border-radius: 4px;&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; data-ke-align=&quot;alignLeft&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&quot;padding: 6px; border-right: 2px solid #4f4f4f;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; word-break: normal; text-align: right; color: #aaa; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;1&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;2&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;3&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;4&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;5&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;6&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;7&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;8&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;9&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;10&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;11&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;12&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;13&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;14&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;15&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;padding: 6px 0; text-align: left;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; color: #a9b7c6; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;fig&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;plt.figure(figsize&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;(&lt;span style=&quot;color: #6897bb;&quot;&gt;10&lt;/span&gt;,&lt;span style=&quot;color: #6897bb;&quot;&gt;10&lt;/span&gt;))&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;area01&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;fig.add_subplot(&lt;span style=&quot;color: #6897bb;&quot;&gt;2&lt;/span&gt;,&lt;span style=&quot;color: #6897bb;&quot;&gt;2&lt;/span&gt;,&lt;span style=&quot;color: #6897bb;&quot;&gt;1&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;area02&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;fig.add_subplot(&lt;span style=&quot;color: #6897bb;&quot;&gt;2&lt;/span&gt;,&lt;span style=&quot;color: #6897bb;&quot;&gt;2&lt;/span&gt;,&lt;span style=&quot;color: #6897bb;&quot;&gt;2&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;area03&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;fig.add_subplot(&lt;span style=&quot;color: #6897bb;&quot;&gt;2&lt;/span&gt;,&lt;span style=&quot;color: #6897bb;&quot;&gt;2&lt;/span&gt;,&lt;span style=&quot;color: #6897bb;&quot;&gt;3&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;sns.countplot(data&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;train,&amp;nbsp;x&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #6a8759;&quot;&gt;'Sex'&lt;/span&gt;,&amp;nbsp;ax&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;area01)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;area01.set_title(&lt;span style=&quot;color: #6a8759;&quot;&gt;'성별&amp;nbsp;count'&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;sns.barplot(data&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;train,&amp;nbsp;x&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #6a8759;&quot;&gt;&quot;Sex&quot;&lt;/span&gt;,&amp;nbsp;y&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #6a8759;&quot;&gt;&quot;Survived&quot;&lt;/span&gt;,&amp;nbsp;errwidth&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #6897bb;&quot;&gt;0&lt;/span&gt;,&amp;nbsp;ax&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;area02)&amp;nbsp;&lt;span style=&quot;color: #808080;&quot;&gt;# hue로 그룹화가 된다.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;area02.set_title(&lt;span style=&quot;color: #6a8759;&quot;&gt;'성별&amp;nbsp;생존자&amp;nbsp;count'&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;sns.countplot(data&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;train,&amp;nbsp;x&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #6a8759;&quot;&gt;'Sex'&lt;/span&gt;,&amp;nbsp;hue&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #6a8759;&quot;&gt;'Survived'&lt;/span&gt;,&amp;nbsp;ax&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;area03)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;area03.set_title(&lt;span style=&quot;color: #6a8759;&quot;&gt;'성별&amp;nbsp;생존&amp;nbsp;여부&amp;nbsp;count'&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;plt.show()&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: right; margin-top: -13px; margin-right: 5px; font-size: 9px; font-style: italic;&quot;&gt;&lt;a style=&quot;color: #4f4f4ftext-decoration:none;&quot; href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Colored by Color Scripter&lt;/a&gt;&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;vertical-align: bottom; padding: 0 2px 4px 0;&quot;&gt;&lt;a style=&quot;text-decoration: none; color: white;&quot; href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;&lt;span style=&quot;font-size: 9px; word-break: normal; background-color: #4f4f4f; color: white; border-radius: 10px; padding: 1px;&quot;&gt;cs&lt;/span&gt;&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;figure class=&quot;imageblock alignLeft&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-filename=&quot;성별 생존 여부 count.png&quot; data-origin-width=&quot;846&quot; data-origin-height=&quot;852&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/LvKir/btrVpC39fTJ/PUyChCqO2A2YRPupzg3lR0/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/LvKir/btrVpC39fTJ/PUyChCqO2A2YRPupzg3lR0/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/LvKir/btrVpC39fTJ/PUyChCqO2A2YRPupzg3lR0/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FLvKir%2FbtrVpC39fTJ%2FPUyChCqO2A2YRPupzg3lR0%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;846&quot; height=&quot;852&quot; data-filename=&quot;성별 생존 여부 count.png&quot; data-origin-width=&quot;846&quot; data-origin-height=&quot;852&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/div&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;(1,1) 차트를 보면 전체 중에서 남성이 여성보다 2배 가량 많다.&amp;nbsp;&lt;/li&gt;
&lt;li&gt;하지만 (1,2) 차트를 보면 위의 group by 조회 결과 값을 시각적으로 확인할 수 있고, 남성의 생존율은 전체 남성 수에 비해 0.2 미만으로 낮은 것을 볼 수 있다.&lt;/li&gt;
&lt;li&gt;(2,1) 차트는 각 생존 여부에 따라 count한 것인데, 남성은 생존자가 대략 5:1, 여성은 1:3 정도의 수치를 보이고 있다.&lt;/li&gt;
&lt;/ul&gt;
&lt;div id=&quot;dicLayer&quot;&gt;
&lt;div id=&quot;dicLayerContents&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div id=&quot;dicLayerSub&quot;&gt;
&lt;h4 data-ke-size=&quot;size20&quot;&gt;성별/Pclass별 구분에 따른 분포&lt;/h4&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id=&quot;dicRawData&quot; style=&quot;display: none;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;1363&quot; data-origin-height=&quot;307&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/9mZvE/btrVnYUuTxo/HTtWIiKf6eLAUyuwZL8S51/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/9mZvE/btrVnYUuTxo/HTtWIiKf6eLAUyuwZL8S51/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/9mZvE/btrVnYUuTxo/HTtWIiKf6eLAUyuwZL8S51/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2F9mZvE%2FbtrVnYUuTxo%2FHTtWIiKf6eLAUyuwZL8S51%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;1363&quot; height=&quot;307&quot; data-origin-width=&quot;1363&quot; data-origin-height=&quot;307&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li id=&quot;dicLayerLoader&quot;&gt;이번엔 성별과 Pclass별 구분에 따른 분포를 확인해보았는데, 일차적으로 여성이 남성보다 압도적으로 높은 편이고, 객실 등급에 따라 생존율도 차이나는 것을 볼 수 있다.&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;colorscripter-code&quot; style=&quot;color: #a9b7c6; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; position: relative !important; overflow: auto;&quot;&gt;
&lt;table class=&quot;colorscripter-code-table&quot; style=&quot;margin: 0; padding: 0; border: none; background-color: #2b2b2b; border-radius: 4px;&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; data-ke-align=&quot;alignLeft&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&quot;padding: 6px; border-right: 2px solid #4f4f4f;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; word-break: normal; text-align: right; color: #aaa; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;1&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;2&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;3&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;4&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;5&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;6&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;7&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;8&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;9&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;padding: 6px 0; text-align: left;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; color: #a9b7c6; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;fig&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;plt.figure(figsize&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;(&lt;span style=&quot;color: #6897bb;&quot;&gt;10&lt;/span&gt;,&lt;span style=&quot;color: #6897bb;&quot;&gt;5&lt;/span&gt;))&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;area01&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;fig.add_subplot(&lt;span style=&quot;color: #6897bb;&quot;&gt;1&lt;/span&gt;,&lt;span style=&quot;color: #6897bb;&quot;&gt;2&lt;/span&gt;,&lt;span style=&quot;color: #6897bb;&quot;&gt;1&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;area02&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;fig.add_subplot(&lt;span style=&quot;color: #6897bb;&quot;&gt;1&lt;/span&gt;,&lt;span style=&quot;color: #6897bb;&quot;&gt;2&lt;/span&gt;,&lt;span style=&quot;color: #6897bb;&quot;&gt;2&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;sns.countplot(data&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;train,&amp;nbsp;x&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #6a8759;&quot;&gt;'Sex'&lt;/span&gt;,&amp;nbsp;hue&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #6a8759;&quot;&gt;&quot;Pclass&quot;&lt;/span&gt;,&amp;nbsp;ax&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;area01)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;sns.barplot(data&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;train,&amp;nbsp;x&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6a8759;&quot;&gt;&quot;Sex&quot;&lt;/span&gt;,&amp;nbsp;y&amp;nbsp;&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #6a8759;&quot;&gt;&quot;Survived&quot;&lt;/span&gt;,&amp;nbsp;hue&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #6a8759;&quot;&gt;&quot;Pclass&quot;&lt;/span&gt;,&amp;nbsp;errwidth&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #6897bb;&quot;&gt;0&lt;/span&gt;,&amp;nbsp;ax&lt;span style=&quot;color: #a9b7c6;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;=&lt;/span&gt;area02)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;plt.show()&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: right; margin-top: -13px; margin-right: 5px; font-size: 9px; font-style: italic;&quot;&gt;&lt;a style=&quot;color: #4f4f4ftext-decoration:none;&quot; href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Colored by Color Scripter&lt;/a&gt;&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;vertical-align: bottom; padding: 0 2px 4px 0;&quot;&gt;&lt;a style=&quot;text-decoration: none; color: white;&quot; href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;&lt;span style=&quot;font-size: 9px; word-break: normal; background-color: #4f4f4f; color: white; border-radius: 10px; padding: 1px;&quot;&gt;cs&lt;/span&gt;&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignLeft&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-filename=&quot;성별-Pclass별 생존 여부 count.png&quot; data-origin-width=&quot;855&quot; data-origin-height=&quot;456&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/bIYCGL/btrVsKAzWqf/cFy7PAftgc529Ku28BQk20/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/bIYCGL/btrVsKAzWqf/cFy7PAftgc529Ku28BQk20/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/bIYCGL/btrVsKAzWqf/cFy7PAftgc529Ku28BQk20/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FbIYCGL%2FbtrVsKAzWqf%2FcFy7PAftgc529Ku28BQk20%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;855&quot; height=&quot;456&quot; data-filename=&quot;성별-Pclass별 생존 여부 count.png&quot; data-origin-width=&quot;855&quot; data-origin-height=&quot;456&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;div id=&quot;dicRawData&quot; style=&quot;display: none;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;성별/Pclass별&amp;nbsp;count와&amp;nbsp;생존율을&amp;nbsp;시각적으로&amp;nbsp;비교한다.&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style7&quot; /&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;다음 포스트&lt;/p&gt;
&lt;figure id=&quot;og_1672893338692&quot; contenteditable=&quot;false&quot; data-ke-type=&quot;opengraph&quot; data-ke-align=&quot;alignCenter&quot; data-og-type=&quot;article&quot; data-og-title=&quot;타이타닉 생존자 예측 분석 (2-2) EDA(연령대별) - v.1.0.1&quot; data-og-description=&quot;이전 포스트 2023.01.04 - [Kaggle/타이타닉] - 타이타닉 생존자 예측 분석 (2-1) EDA v.1.0.1 타이타닉 생존자 예측 분석 (2) EDA v.1.0.1 - 개요 우선 데이터 사이언티스트 (이하 DS)의 꿈을 가장 크게 꾸게 해준&quot; data-og-host=&quot;drewvvv.tistory.com&quot; data-og-source-url=&quot;https://drewvvv.tistory.com/15&quot; data-og-url=&quot;https://drewvvv.tistory.com/15&quot; data-og-image=&quot;https://scrap.kakaocdn.net/dn/cf6VOk/hyRaFQusif/Mp0D1J5ZOb3obe1qcakb21/img.png?width=800&amp;amp;height=220&amp;amp;face=0_0_800_220,https://scrap.kakaocdn.net/dn/ciKjEw/hyRaFppME2/cKkM318XwjuIggvrVJVjqK/img.png?width=800&amp;amp;height=220&amp;amp;face=0_0_800_220,https://scrap.kakaocdn.net/dn/bPs6iM/hyRaHAMMCC/0kCgR1ZsKpnL6doYa6b3G0/img.png?width=1233&amp;amp;height=340&amp;amp;face=0_0_1233_340&quot;&gt;&lt;a href=&quot;https://drewvvv.tistory.com/15&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot; data-source-url=&quot;https://drewvvv.tistory.com/15&quot;&gt;
&lt;div class=&quot;og-image&quot; style=&quot;background-image: url('https://scrap.kakaocdn.net/dn/cf6VOk/hyRaFQusif/Mp0D1J5ZOb3obe1qcakb21/img.png?width=800&amp;amp;height=220&amp;amp;face=0_0_800_220,https://scrap.kakaocdn.net/dn/ciKjEw/hyRaFppME2/cKkM318XwjuIggvrVJVjqK/img.png?width=800&amp;amp;height=220&amp;amp;face=0_0_800_220,https://scrap.kakaocdn.net/dn/bPs6iM/hyRaHAMMCC/0kCgR1ZsKpnL6doYa6b3G0/img.png?width=1233&amp;amp;height=340&amp;amp;face=0_0_1233_340');&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;og-text&quot;&gt;
&lt;p class=&quot;og-title&quot; style=&quot;max-width: 550px;&quot; data-ke-size=&quot;size16&quot;&gt;타이타닉 생존자 예측 분석 (2-2) EDA(연령대별) - v.1.0.1&lt;/p&gt;
&lt;p class=&quot;og-desc&quot; data-ke-size=&quot;size16&quot;&gt;이전 포스트 2023.01.04 - [Kaggle/타이타닉] - 타이타닉 생존자 예측 분석 (2-1) EDA v.1.0.1 타이타닉 생존자 예측 분석 (2) EDA v.1.0.1 - 개요 우선 데이터 사이언티스트 (이하 DS)의 꿈을 가장 크게 꾸게 해준&lt;/p&gt;
&lt;p class=&quot;og-host&quot; data-ke-size=&quot;size16&quot;&gt;drewvvv.tistory.com&lt;/p&gt;
&lt;/div&gt;
&lt;/a&gt;&lt;/figure&gt;
&lt;div id=&quot;dicLayer&quot;&gt;
&lt;div id=&quot;dicLayerContents&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div id=&quot;dicLayerSub&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;/div&gt;
&lt;div id=&quot;dicRawData&quot; style=&quot;display: none;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div id=&quot;dicLayerLoader&quot;&gt;&amp;nbsp;&lt;/div&gt;</description>
      <category>Kaggle/타이타닉</category>
      <category>Eda</category>
      <category>이진분류</category>
      <category>타이타닉</category>
      <category>탐색적분석</category>
      <author>qwer.ty_v</author>
      <guid isPermaLink="true">https://drewvvv.tistory.com/14</guid>
      <comments>https://drewvvv.tistory.com/14#entry14comment</comments>
      <pubDate>Wed, 4 Jan 2023 14:31:16 +0900</pubDate>
    </item>
    <item>
      <title>타이타닉 생존자 예측 분석 (1) 개요</title>
      <link>https://drewvvv.tistory.com/13</link>
      <description>&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&lt;span style=&quot;color: #000000;&quot; data-darkreader-inline-color=&quot;&quot;&gt;최근 데이터 분석을 다시 시작하게 되었다.&lt;/span&gt;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&lt;span style=&quot;color: #000000;&quot; data-darkreader-inline-color=&quot;&quot;&gt;원래 목표로 삼았던 직업인 데이터 사이언티스트가 되기 위한 준비를 해오고 있었고, 이제 다시 캐글을 시작할 때가 되었다.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style=&quot;text-align: left;&quot; data-ke-size=&quot;size16&quot;&gt;&lt;span style=&quot;color: #000000;&quot; data-darkreader-inline-color=&quot;&quot;&gt;데이터 분석의&amp;nbsp;&lt;b&gt;Hello World!&lt;/b&gt;인 타이타닉을 처음부터 다시 분석해보면서 이전에 내 부족한 부분은 무엇이었고,&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;text-align: left;&quot; data-ke-size=&quot;size16&quot;&gt;&lt;span style=&quot;color: #000000;&quot; data-darkreader-inline-color=&quot;&quot;&gt;지금 나의 부족한 부분은 무엇인지를 알고 더 나아가 훌륭한 데이터 분석가가 되기 위한 준비를 이를 통해 지금부터 다시 해나가겠다.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;text-align: left;&quot; data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style=&quot;text-align: left;&quot; data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style=&quot;text-align: left;&quot; data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style=&quot;text-align: left;&quot; data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style6&quot; /&gt;
&lt;p style=&quot;text-align: center;&quot; data-ke-size=&quot;size16&quot;&gt;&lt;span style=&quot;font-family: 'Noto Serif KR'; color: #000000;&quot; data-darkreader-inline-color=&quot;&quot;&gt;지금부터 써내려가는 이 블로그의 타이타닉 타임랩스는 매 순간순간의 시행착오들을 기록할 것이다.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;text-align: center;&quot; data-ke-size=&quot;size16&quot;&gt;&lt;span style=&quot;font-family: 'Noto Serif KR'; color: #000000;&quot; data-darkreader-inline-color=&quot;&quot;&gt;그 과정이 비록 길고 오답일 수 있지만, 반복되는 시행착오 끝에 그 의미를 정확히 해석할 줄 아는 분석가가 되기 위함이다.&lt;/span&gt;&lt;/p&gt;
&lt;div id=&quot;dicLayer&quot; style=&quot;display: none; color: #000000; font-size: 12px; font-family: Arial; background: -webkit-linear-gradient(bottom, #ffeb00, #ffdc00); width: 400px; height: 150px; --darkreader-inline-color: #fffff6; --darkreader-inline-bgimage: -webkit-linear-gradient(bottom, #aea01f, #ad981e); --darkreader-inline-bgcolor: initial;&quot; data-darkreader-inline-color=&quot;&quot; data-darkreader-inline-bgimage=&quot;&quot; data-darkreader-inline-bgcolor=&quot;&quot;&gt;
&lt;div id=&quot;dicLayerContents&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div id=&quot;dicLayerSub&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;/div&gt;
&lt;div id=&quot;dicRawData&quot; style=&quot;display: none;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;div id=&quot;dicLayerLoader&quot;&gt;&lt;span style=&quot;color: #000000; --darkreader-inline-color: #fbebcf;&quot; data-darkreader-inline-color=&quot;&quot;&gt;매 시행착오를 통해 발전될 때마다 게시글 제목에 버전이 업그레이드 될 것이다.&lt;/span&gt;&lt;/div&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;div id=&quot;dicLayer&quot;&gt;
&lt;div id=&quot;dicLayerContents&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div id=&quot;dicLayerSub&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;/div&gt;
&lt;div id=&quot;dicRawData&quot; style=&quot;display: none;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div id=&quot;dicLayer&quot;&gt;
&lt;div id=&quot;dicLayerContents&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div id=&quot;dicLayerSub&quot;&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style7&quot; /&gt;
&lt;p data-ke-size=&quot;size14&quot;&gt;&lt;b&gt;이후 포스트&lt;/b&gt;&lt;/p&gt;
&lt;div id=&quot;dicLayerLoader&quot;&gt;
&lt;figure id=&quot;og_1672978177241&quot; contenteditable=&quot;false&quot; data-ke-type=&quot;opengraph&quot; data-ke-align=&quot;alignCenter&quot; data-og-type=&quot;article&quot; data-og-title=&quot;타이타닉 생존자 예측 분석 (2-1) EDA(성별) v.1.0.1&quot; data-og-description=&quot;- 개요 우선 데이터 사이언티스트 (이하 DS)의 꿈을 가장 크게 꾸게 해준 타이타닉은 매우 흥미로웠다. 타이타닉에 탑승했던 사람들의 일련의 데이터들을 토대로 정보로 이끌어 내어 분석하여 그&quot; data-og-host=&quot;drewvvv.tistory.com&quot; data-og-source-url=&quot;https://drewvvv.tistory.com/14&quot; data-og-url=&quot;https://drewvvv.tistory.com/14&quot; data-og-image=&quot;https://scrap.kakaocdn.net/dn/KjJhP/hyRaES311X/etsA8Oi0p2Ho3cRjdk5V41/img.png?width=800&amp;amp;height=241&amp;amp;face=0_0_800_241,https://scrap.kakaocdn.net/dn/bmN6p9/hyRbLwh2fx/P4SO0cmvZ7JlVkr1Po4Rj0/img.png?width=800&amp;amp;height=241&amp;amp;face=0_0_800_241,https://scrap.kakaocdn.net/dn/c4Hobc/hyRbx5SFlW/FK2ri6MQ1ihr6DWHNpMbf1/img.png?width=846&amp;amp;height=852&amp;amp;face=0_0_846_852&quot;&gt;&lt;a href=&quot;https://drewvvv.tistory.com/14&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot; data-source-url=&quot;https://drewvvv.tistory.com/14&quot;&gt;
&lt;div class=&quot;og-image&quot; style=&quot;background-image: url('https://scrap.kakaocdn.net/dn/KjJhP/hyRaES311X/etsA8Oi0p2Ho3cRjdk5V41/img.png?width=800&amp;amp;height=241&amp;amp;face=0_0_800_241,https://scrap.kakaocdn.net/dn/bmN6p9/hyRbLwh2fx/P4SO0cmvZ7JlVkr1Po4Rj0/img.png?width=800&amp;amp;height=241&amp;amp;face=0_0_800_241,https://scrap.kakaocdn.net/dn/c4Hobc/hyRbx5SFlW/FK2ri6MQ1ihr6DWHNpMbf1/img.png?width=846&amp;amp;height=852&amp;amp;face=0_0_846_852');&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;og-text&quot;&gt;
&lt;p class=&quot;og-title&quot; data-ke-size=&quot;size16&quot;&gt;타이타닉 생존자 예측 분석 (2-1) EDA(성별) v.1.0.1&lt;/p&gt;
&lt;p class=&quot;og-desc&quot; data-ke-size=&quot;size16&quot;&gt;- 개요 우선 데이터 사이언티스트 (이하 DS)의 꿈을 가장 크게 꾸게 해준 타이타닉은 매우 흥미로웠다. 타이타닉에 탑승했던 사람들의 일련의 데이터들을 토대로 정보로 이끌어 내어 분석하여 그&lt;/p&gt;
&lt;p class=&quot;og-host&quot; data-ke-size=&quot;size16&quot;&gt;drewvvv.tistory.com&lt;/p&gt;
&lt;/div&gt;
&lt;/a&gt;&lt;/figure&gt;
&lt;/div&gt;
&lt;div id=&quot;dicLayer&quot;&gt;
&lt;div id=&quot;dicLayerContents&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div id=&quot;dicLayerSub&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;/div&gt;
&lt;div id=&quot;dicRawData&quot; style=&quot;display: none;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div id=&quot;dicLayerLoader&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div id=&quot;dicLayer&quot;&gt;
&lt;div id=&quot;dicLayerContents&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div id=&quot;dicLayerSub&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;/div&gt;
&lt;div id=&quot;dicRawData&quot; style=&quot;display: none;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div id=&quot;dicLayerLoader&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div id=&quot;dicLayer&quot;&gt;
&lt;div id=&quot;dicLayerContents&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div id=&quot;dicLayerSub&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;/div&gt;
&lt;div id=&quot;dicRawData&quot; style=&quot;display: none;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div id=&quot;dicLayerLoader&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div id=&quot;dicLayer&quot;&gt;
&lt;div id=&quot;dicLayerContents&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div id=&quot;dicLayerSub&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;/div&gt;
&lt;div id=&quot;dicRawData&quot; style=&quot;display: none;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div id=&quot;dicLayerLoader&quot;&gt;&amp;nbsp;&lt;/div&gt;</description>
      <category>Kaggle/타이타닉</category>
      <category>데이터 사이언티스트</category>
      <category>데이터사이언티스트</category>
      <category>캐글</category>
      <category>타이타닉</category>
      <author>qwer.ty_v</author>
      <guid isPermaLink="true">https://drewvvv.tistory.com/13</guid>
      <comments>https://drewvvv.tistory.com/13#entry13comment</comments>
      <pubDate>Wed, 4 Jan 2023 13:36:57 +0900</pubDate>
    </item>
  </channel>
</rss>