You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

675 lines
28 KiB

5 years ago
<!DOCTYPE HTML>
<html lang="" >
<head>
<meta charset="UTF-8">
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<title>特征工程 · GitBook</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="description" content="">
<meta name="generator" content="GitBook 3.2.3">
<link rel="stylesheet" href="../gitbook/style.css">
<link rel="stylesheet" href="../gitbook/gitbook-plugin-katex/katex.min.css">
<link rel="stylesheet" href="../gitbook/gitbook-plugin-highlight/website.css">
<link rel="stylesheet" href="../gitbook/gitbook-plugin-search/search.css">
<link rel="stylesheet" href="../gitbook/gitbook-plugin-fontsettings/website.css">
<meta name="HandheldFriendly" content="true"/>
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
<link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">
<link rel="next" href="fit and predict.html" />
<link rel="prev" href="EDA.html" />
</head>
<body>
<div class="book">
<div class="book-summary">
<div id="book-search-input" role="search">
<input type="text" placeholder="Type to search" />
</div>
<nav role="navigation">
<ul class="summary">
<li class="chapter " data-level="1.1" data-path="../">
<a href="../">
简介
</a>
</li>
5 years ago
<li class="chapter " data-level="1.2" data-path="../machine_learning.html">
<a href="../machine_learning.html">
机器学习概述
</a>
</li>
<li class="chapter " data-level="1.3" data-path="../algorithm.html">
<a href="../algorithm.html">
常见机器学习算法
</a>
<ul class="articles">
<li class="chapter " data-level="1.3.1" data-path="../kNN.html">
<a href="../kNN.html">
近朱者赤近墨者黑-kNN
</a>
</li>
<li class="chapter " data-level="1.3.2" data-path="../linear_regression.html">
<a href="../linear_regression.html">
最简单的回归算法-线性回归
</a>
</li>
<li class="chapter " data-level="1.3.3" data-path="../logistic_regression.html">
<a href="../logistic_regression.html">
使用回归的思想进行分类-逻辑回归
</a>
</li>
<li class="chapter " data-level="1.3.4" data-path="../decision_tree.html">
<a href="../decision_tree.html">
最接近人类思维的算法-决策树
</a>
</li>
<li class="chapter " data-level="1.3.5" data-path="../random_forest.html">
<a href="../random_forest.html">
群众的力量是伟大的-随机森林
</a>
</li>
<li class="chapter " data-level="1.3.6" data-path="../kMeans.html">
<a href="../kMeans.html">
物以类聚人以群分-kMeans
</a>
</li>
<li class="chapter " data-level="1.3.7" data-path="../AGNES.html">
<a href="../AGNES.html">
以距离为尺-AGNES
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="1.4" data-path="../metrics.html">
<a href="../metrics.html">
模型评估指标
</a>
<ul class="articles">
<li class="chapter " data-level="1.4.1" data-path="../classification_metrics.html">
<a href="../classification_metrics.html">
分类性能评估指标
</a>
</li>
<li class="chapter " data-level="1.4.2" data-path="../regression_metrics.html">
<a href="../regression_metrics.html">
回归性能评估指标
</a>
</li>
<li class="chapter " data-level="1.4.3" data-path="../cluster_metrics.html">
<a href="../cluster_metrics.html">
聚类性能评估指标
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="1.5" data-path="../sklearn.html">
<a href="../sklearn.html">
使用sklearn进行机器学习
</a>
</li>
<li class="chapter " data-level="1.6" >
<span>
综合实战案例
</span>
<ul class="articles">
<li class="chapter " data-level="1.6.1" >
5 years ago
<span>
泰坦尼克生还预测
</span>
<ul class="articles">
5 years ago
<li class="chapter " data-level="1.6.1.1" data-path="introduction.html">
5 years ago
<a href="introduction.html">
简介
</a>
</li>
5 years ago
<li class="chapter " data-level="1.6.1.2" data-path="EDA.html">
5 years ago
<a href="EDA.html">
探索性数据分析(EDA)
</a>
</li>
5 years ago
<li class="chapter active" data-level="1.6.1.3" data-path="feature engerning.html">
5 years ago
<a href="feature engerning.html">
特征工程
</a>
</li>
5 years ago
<li class="chapter " data-level="1.6.1.4" data-path="fit and predict.html">
5 years ago
<a href="fit and predict.html">
构建模型进行预测
</a>
</li>
5 years ago
<li class="chapter " data-level="1.6.1.5" data-path="tuning.html">
5 years ago
<a href="tuning.html">
调参
</a>
</li>
</ul>
</li>
5 years ago
<li class="chapter " data-level="1.6.2" >
5 years ago
<span>
使用强化学习玩乒乓球游戏
</span>
<ul class="articles">
5 years ago
<li class="chapter " data-level="1.6.2.1" data-path="../pingpong/what is reinforce learning.html">
5 years ago
<a href="../pingpong/what is reinforce learning.html">
什么是强化学习
</a>
</li>
5 years ago
<li class="chapter " data-level="1.6.2.2" data-path="../pingpong/Policy Gradient.html">
5 years ago
<a href="../pingpong/Policy Gradient.html">
Policy Gradient原理
</a>
</li>
5 years ago
<li class="chapter " data-level="1.6.2.3" data-path="../pingpong/coding.html">
5 years ago
<a href="../pingpong/coding.html">
使用Policy Gradient玩乒乓球游戏
</a>
</li>
</ul>
</li>
5 years ago
</ul>
</li>
<li class="chapter " data-level="1.7" data-path="../recommand.html">
<a href="../recommand.html">
实训推荐
</a>
</li>
5 years ago
<li class="divider"></li>
<li>
<a href="https://www.gitbook.com" target="blank" class="gitbook-link">
Published with GitBook
</a>
</li>
</ul>
</nav>
</div>
<div class="book-body">
<div class="body-inner">
<div class="book-header" role="navigation">
<!-- Title -->
<h1>
<i class="fa fa-circle-o-notch fa-spin"></i>
<a href=".." >特征工程</a>
</h1>
</div>
<div class="page-wrapper" tabindex="-1" role="main">
<div class="page-inner">
<div id="book-search-results">
<div class="search-noresults">
<section class="normal markdown-section">
<h1 id="&#x7279;&#x5F81;&#x5DE5;&#x7A0B;">&#x7279;&#x5F81;&#x5DE5;&#x7A0B;</h1>
<p>&#x4EC0;&#x4E48;&#x662F;&#x7279;&#x5F81;&#x5DE5;&#x7A0B;&#xFF1F;&#x5176;&#x5B9E;&#x6BCF;&#x5F53;&#x6211;&#x4EEC;&#x62FF;&#x5230;&#x6570;&#x636E;&#x65F6;&#xFF0C;&#x5E76;&#x4E0D;&#x662F;&#x6240;&#x6709;&#x7684;&#x7279;&#x5F81;&#x90FD;&#x662F;&#x6709;&#x7528;&#x7684;&#xFF0C;&#x53EF;&#x80FD;&#x6709;&#x8BB8;&#x591A;&#x5197;&#x4F59;&#x7684;&#x7279;&#x5F81;&#x9700;&#x8981;&#x5220;&#x6389;&#xFF0C;&#x6216;&#x8005;&#x6839;&#x636E; EDA &#x7684;&#x7ED3;&#x679C;&#xFF0C;&#x6211;&#x4EEC;&#x53EF;&#x4EE5;&#x6839;&#x636E;&#x5DF2;&#x6709;&#x7684;&#x7279;&#x5F81;&#x6765;&#x6DFB;&#x52A0;&#x65B0;&#x7684;&#x7279;&#x5F81;&#xFF0C;&#x8FD9;&#x5176;&#x5B9E;&#x5C31;&#x662F;&#x7279;&#x5F81;&#x5DE5;&#x7A0B;&#x3002;</p>
<p>&#x63A5;&#x4E0B;&#x6765;&#x6211;&#x4EEC;&#x6765;&#x5C1D;&#x8BD5;&#x5BF9;&#x4E00;&#x4E9B;&#x7279;&#x5F81;&#x8FDB;&#x884C;&#x5904;&#x7406;&#x3002;</p>
<h2 id="&#x5E74;&#x9F84;&#x79BB;&#x6563;&#x5316;">&#x5E74;&#x9F84;&#x79BB;&#x6563;&#x5316;</h2>
<p>&#x5E74;&#x9F84;&#x662F;&#x4E00;&#x4E2A;&#x8FDE;&#x7EED;&#x578B;&#x7684;&#x6570;&#x503C;&#x7279;&#x5F81;&#xFF0C;&#x6709;&#x7684;&#x673A;&#x5668;&#x5B66;&#x4E60;&#x7B97;&#x6CD5;&#x5BF9;&#x4E8E;&#x8FDE;&#x7EED;&#x6027;&#x6570;&#x503C;&#x7279;&#x5F81;&#x4E0D;&#x592A;&#x53CB;&#x597D;&#xFF0C;&#x4F8B;&#x5982;&#x51B3;&#x7B56;&#x6811;&#x3001;&#x968F;&#x673A;&#x68EE;&#x6797;&#x7B49; tree-base model&#x3002;&#x6240;&#x4EE5;&#x6211;&#x4EEC;&#x53EF;&#x4EE5;&#x8003;&#x8651;&#x5C06;&#x5E74;&#x9F84;&#x8F6C;&#x6362;&#x6210;&#x5E74;&#x9F84;&#x6BB5;&#x3002;&#x4F8B;&#x5982;&#x5C06;&#x5E74;&#x9F84;&#x5C0F;&#x4E8E; 16 &#x7684;&#x8239;&#x5BA2;&#x7F6E;&#x4E3A; 0 &#xFF0C;16 &#x5230; 32 &#x5C81;&#x4E4B;&#x95F4;&#x7684;&#x7F6E;&#x4E3A; 1 &#x7B49;&#x3002;</p>
<pre><code class="lang-python">data[<span class="hljs-string">&apos;Age_band&apos;</span>]=<span class="hljs-number">0</span>
data.loc[data[<span class="hljs-string">&apos;Age&apos;</span>]&lt;=<span class="hljs-number">16</span>,<span class="hljs-string">&apos;Age_band&apos;</span>]=<span class="hljs-number">0</span>
data.loc[(data[<span class="hljs-string">&apos;Age&apos;</span>]&gt;<span class="hljs-number">16</span>)&amp;(data[<span class="hljs-string">&apos;Age&apos;</span>]&lt;=<span class="hljs-number">32</span>),<span class="hljs-string">&apos;Age_band&apos;</span>]=<span class="hljs-number">1</span>
data.loc[(data[<span class="hljs-string">&apos;Age&apos;</span>]&gt;<span class="hljs-number">32</span>)&amp;(data[<span class="hljs-string">&apos;Age&apos;</span>]&lt;=<span class="hljs-number">48</span>),<span class="hljs-string">&apos;Age_band&apos;</span>]=<span class="hljs-number">2</span>
data.loc[(data[<span class="hljs-string">&apos;Age&apos;</span>]&gt;<span class="hljs-number">48</span>)&amp;(data[<span class="hljs-string">&apos;Age&apos;</span>]&lt;=<span class="hljs-number">64</span>),<span class="hljs-string">&apos;Age_band&apos;</span>]=<span class="hljs-number">3</span>
data.loc[data[<span class="hljs-string">&apos;Age&apos;</span>]&gt;<span class="hljs-number">64</span>,<span class="hljs-string">&apos;Age_band&apos;</span>]=<span class="hljs-number">4</span>
</code></pre>
<p><img src="../img/52.jpg" alt=""></p>
<p>&#x6211;&#x4EEC;&#x53EF;&#x4EE5;&#x770B;&#x4E00;&#x4E0B;&#x8F6C;&#x6362;&#x6210;&#x5E74;&#x9F84;&#x6BB5;&#x540E;&#xFF0C;&#x5E74;&#x9F84;&#x6BB5;&#x4E0E;&#x751F;&#x8FD8;&#x7387;&#x7684;&#x5173;&#x7CFB;&#x3002;</p>
<pre><code class="lang-python">sns.factorplot(<span class="hljs-string">&apos;Age_band&apos;</span>,<span class="hljs-string">&apos;Survived&apos;</span>,data=data,col=<span class="hljs-string">&apos;Pclass&apos;</span>)
plt.show()
</code></pre>
<p><img src="../img/53.jpg" alt=""></p>
<p>&#x53EF;&#x4EE5;&#x770B;&#x51FA;&#x548C;&#x6211;&#x4EEC;&#x4E4B;&#x524D; EDA &#x7684;&#x7ED3;&#x679C;&#x76F8;&#x7B26;&#xFF0C;&#x5E74;&#x9F84;&#x8D8A;&#x5927;&#xFF0C;&#x751F;&#x8FD8;&#x7387;&#x8D8A;&#x4F4E;&#x3002;</p>
<h2 id="&#x5BB6;&#x5EAD;&#x6210;&#x5458;&#x6570;&#x91CF;&#x4E0E;&#x662F;&#x5426;&#x5B64;&#x8EAB;&#x4E00;&#x4EBA;">&#x5BB6;&#x5EAD;&#x6210;&#x5458;&#x6570;&#x91CF;&#x4E0E;&#x662F;&#x5426;&#x5B64;&#x8EAB;&#x4E00;&#x4EBA;</h2>
<p>&#x7531;&#x4E8E;&#x5BB6;&#x5EAD;&#x6210;&#x5458;&#x6570;&#x91CF;&#x548C;&#x662F;&#x5426;&#x5B64;&#x8EAB;&#x4E00;&#x4EBA;&#x597D;&#x60F3;&#x5BF9;&#x4E8E;&#x662F;&#x5426;&#x751F;&#x8FD8;&#x6709;&#x5F71;&#x54CD;&#xFF0C;&#x6240;&#x4EE5;&#x6211;&#x4EEC;&#x4E0D;&#x59A8;&#x6DFB;&#x52A0;&#x65B0;&#x7684;&#x7279;&#x5F81;&#x3002;</p>
<pre><code class="lang-python">data[<span class="hljs-string">&apos;Family_Size&apos;</span>]=<span class="hljs-number">0</span>
data[<span class="hljs-string">&apos;Family_Size&apos;</span>]=data[<span class="hljs-string">&apos;Parch&apos;</span>]+data[<span class="hljs-string">&apos;SibSp&apos;</span>]
data[<span class="hljs-string">&apos;Alone&apos;</span>]=<span class="hljs-number">0</span>
data.loc[data.Family_Size==<span class="hljs-number">0</span>,<span class="hljs-string">&apos;Alone&apos;</span>]=<span class="hljs-number">1</span>
</code></pre>
<p>&#x7136;&#x540E;&#x518D;&#x53EF;&#x89C6;&#x5316;&#x770B;&#x4E00;&#x4E0B;</p>
<pre><code class="lang-python">f,ax=plt.subplots(<span class="hljs-number">1</span>,<span class="hljs-number">2</span>,figsize=(<span class="hljs-number">18</span>,<span class="hljs-number">6</span>))
sns.factorplot(<span class="hljs-string">&apos;Family_Size&apos;</span>,<span class="hljs-string">&apos;Survived&apos;</span>,data=data,ax=ax[<span class="hljs-number">0</span>])
ax[<span class="hljs-number">0</span>].set_title(<span class="hljs-string">&apos;Family_Size vs Survived&apos;</span>)
sns.factorplot(<span class="hljs-string">&apos;Alone&apos;</span>,<span class="hljs-string">&apos;Survived&apos;</span>,data=data,ax=ax[<span class="hljs-number">1</span>])
ax[<span class="hljs-number">1</span>].set_title(<span class="hljs-string">&apos;Alone vs Survived&apos;</span>)
plt.close(<span class="hljs-number">2</span>)
plt.close(<span class="hljs-number">3</span>)
plt.show()
</code></pre>
<p><img src="../img/54.jpg" alt=""></p>
<p>&#x4ECE;&#x56FE;&#x4E2D;&#x53EF;&#x4EE5;&#x5F88;&#x660E;&#x663E;&#x7684;&#x770B;&#x51FA;&#xFF0C;&#x5982;&#x679C;&#x4F60;&#x662F;&#x4E00;&#x4E2A;&#x4EBA;&#xFF0C;&#x90A3;&#x4E48;&#x751F;&#x8FD8;&#x7684;&#x51E0;&#x7387;&#x6BD4;&#x8F83;&#x4F4E;&#xFF0C;&#x800C;&#x4E14;&#x5BF9;&#x4E8E;&#x4EBA;&#x6570;&#x5927;&#x4E8E; 4 &#x4EBA;&#x7684;&#x5BB6;&#x5EAD;&#x6765;&#x8BF4;&#x751F;&#x8FD8;&#x7387;&#x4E5F;&#x6BD4;&#x8F83;&#x4F4E;&#x3002;&#x611F;&#x89C9;&#xFF0C;&#x8FD9;&#x53EF;&#x80FD;&#x4E5F;&#x662F;&#x4E00;&#x4E2A;&#x6BD4;&#x8F83;&#x597D;&#x7684;&#x7279;&#x5F81;&#xFF0C;&#x53EF;&#x4EE5;&#x518D;&#x6DF1;&#x5165;&#x7684;&#x770B;&#x4E00;&#x4E0B;&#x3002;</p>
<pre><code class="lang-python">sns.factorplot(<span class="hljs-string">&apos;Alone&apos;</span>,<span class="hljs-string">&apos;Survived&apos;</span>,data=data,hue=<span class="hljs-string">&apos;Sex&apos;</span>,col=<span class="hljs-string">&apos;Pclass&apos;</span>)
plt.show()
</code></pre>
<p><img src="../img/55.jpg" alt=""></p>
<p>&#x53EF;&#x4EE5;&#x770B;&#x51FA;&#xFF0C;&#x9664;&#x4E86;&#x4E09;&#x7B49;&#x8231;&#x7684;&#x5355;&#x8EAB;&#x5973;&#x6027;&#x7684;&#x751F;&#x8FD8;&#x7387;&#x6BD4;&#x975E;&#x5355;&#x8EAB;&#x5973;&#x6027;&#x7684;&#x751F;&#x8FD8;&#x7387;&#x9AD8;&#x5916;&#xFF0C;&#x5355;&#x8EAB;&#x5E76;&#x4E0D;&#x662F;&#x4EC0;&#x4E48;&#x597D;&#x4E8B;&#x3002;</p>
<h2 id="&#x82B1;&#x8D39;&#x79BB;&#x6563;&#x5316;">&#x82B1;&#x8D39;&#x79BB;&#x6563;&#x5316;</h2>
<p>&#x548C;&#x5E74;&#x9F84;&#x4E00;&#x6837;&#xFF0C;&#x82B1;&#x8D39;&#x4E5F;&#x662F;&#x4E00;&#x4E2A;&#x8FDE;&#x7EED;&#x6027;&#x7684;&#x6570;&#x503C;&#x7279;&#x5F81;&#xFF0C;&#x6240;&#x4EE5;&#x6211;&#x4EEC;&#x4E0D;&#x59A8;&#x5C06;&#x5176;&#x79BB;&#x6563;&#x5316;&#x3002;</p>
<pre><code class="lang-python">data[<span class="hljs-string">&apos;Fare_cat&apos;</span>]=<span class="hljs-number">0</span>
data.loc[data[<span class="hljs-string">&apos;Fare&apos;</span>]&lt;=<span class="hljs-number">7.91</span>,<span class="hljs-string">&apos;Fare_cat&apos;</span>]=<span class="hljs-number">0</span>
data.loc[(data[<span class="hljs-string">&apos;Fare&apos;</span>]&gt;<span class="hljs-number">7.91</span>)&amp;(data[<span class="hljs-string">&apos;Fare&apos;</span>]&lt;=<span class="hljs-number">14.454</span>),<span class="hljs-string">&apos;Fare_cat&apos;</span>]=<span class="hljs-number">1</span>
data.loc[(data[<span class="hljs-string">&apos;Fare&apos;</span>]&gt;<span class="hljs-number">14.454</span>)&amp;(data[<span class="hljs-string">&apos;Fare&apos;</span>]&lt;=<span class="hljs-number">31</span>),<span class="hljs-string">&apos;Fare_cat&apos;</span>]=<span class="hljs-number">2</span>
data.loc[(data[<span class="hljs-string">&apos;Fare&apos;</span>]&gt;<span class="hljs-number">31</span>)&amp;(data[<span class="hljs-string">&apos;Fare&apos;</span>]&lt;=<span class="hljs-number">513</span>),<span class="hljs-string">&apos;Fare_cat&apos;</span>]=<span class="hljs-number">3</span>
sns.factorplot(<span class="hljs-string">&apos;Fare_cat&apos;</span>,<span class="hljs-string">&apos;Survived&apos;</span>,data=data,hue=<span class="hljs-string">&apos;Sex&apos;</span>)
plt.show()
</code></pre>
<p><img src="../img/56.jpg" alt=""></p>
<p>&#x5F88;&#x660E;&#x663E;&#xFF0C;&#x82B1;&#x8D39;&#x8D8A;&#x591A;&#x751F;&#x8FD8;&#x7387;&#x8D8A;&#x9AD8;&#xFF0C;&#x91D1;&#x94B1;&#x51B3;&#x5B9A;&#x547D;&#x8FD0;&#x3002;</p>
<h2 id="&#x5C06;&#x5B57;&#x7B26;&#x4E32;&#x7279;&#x5F81;&#x8F6C;&#x6362;&#x4E3A;&#x6570;&#x503C;&#x578B;&#x7279;&#x5F81;">&#x5C06;&#x5B57;&#x7B26;&#x4E32;&#x7279;&#x5F81;&#x8F6C;&#x6362;&#x4E3A;&#x6570;&#x503C;&#x578B;&#x7279;&#x5F81;</h2>
<p>&#x7531;&#x4E8E;&#x6211;&#x4EEC;&#x7684;&#x673A;&#x5668;&#x5B66;&#x4E60;&#x6A21;&#x578B;&#x4E0D;&#x652F;&#x6301;&#x5B57;&#x7B26;&#x4E32;&#xFF0C;&#x6240;&#x4EE5;&#x9700;&#x8981;&#x5C06;&#x4E00;&#x4E9B;&#x6709;&#x7528;&#x7684;&#x5B57;&#x7B26;&#x4E32;&#x7C7B;&#x578B;&#x7684;&#x7279;&#x5F81;&#x8F6C;&#x6362;&#x6210;&#x6570;&#x503C;&#x578B;&#x7684;&#x7279;&#x5F81;&#xFF0C;&#x6BD4;&#x5982;&#xFF1A;&#x6027;&#x522B;&#xFF0C;&#x53E3;&#x5CB8;&#xFF0C;&#x59D3;&#x540D;&#x524D;&#x7F00;&#x3002;</p>
<pre><code class="lang-python">data[<span class="hljs-string">&apos;Sex&apos;</span>].replace([<span class="hljs-string">&apos;male&apos;</span>,<span class="hljs-string">&apos;female&apos;</span>],[<span class="hljs-number">0</span>,<span class="hljs-number">1</span>],inplace=<span class="hljs-keyword">True</span>)
data[<span class="hljs-string">&apos;Embarked&apos;</span>].replace([<span class="hljs-string">&apos;S&apos;</span>,<span class="hljs-string">&apos;C&apos;</span>,<span class="hljs-string">&apos;Q&apos;</span>],[<span class="hljs-number">0</span>,<span class="hljs-number">1</span>,<span class="hljs-number">2</span>],inplace=<span class="hljs-keyword">True</span>)
data[<span class="hljs-string">&apos;Initial&apos;</span>].replace([<span class="hljs-string">&apos;Mr&apos;</span>,<span class="hljs-string">&apos;Mrs&apos;</span>,<span class="hljs-string">&apos;Miss&apos;</span>,<span class="hljs-string">&apos;Master&apos;</span>,<span class="hljs-string">&apos;Other&apos;</span>],[<span class="hljs-number">0</span>,<span class="hljs-number">1</span>,<span class="hljs-number">2</span>,<span class="hljs-number">3</span>,<span class="hljs-number">4</span>],inplace=<span class="hljs-keyword">True</span>)
</code></pre>
<h2 id="&#x5220;&#x6389;&#x6CA1;&#x591A;&#x5927;&#x7528;&#x5904;&#x7684;&#x7279;&#x5F81;">&#x5220;&#x6389;&#x6CA1;&#x591A;&#x5927;&#x7528;&#x5904;&#x7684;&#x7279;&#x5F81;</h2>
<ul>
<li>&#x59D3;&#x540D;&#xFF1A;&#x96BE;&#x9053;&#x59D3;&#x540D;&#x548C;&#x751F;&#x6B7B;&#x6709;&#x5173;&#x7CFB;&#xFF1F;&#x8FD9;&#x4E5F;&#x592A;&#x7384;&#x4E4E;&#x4E86;&#xFF0C;&#x6211;&#x4E0D;&#x4FE1;&#xFF0C;&#x6240;&#x4EE5;&#x628A;&#x5B83;&#x5220;&#x6389;</li>
<li>&#x5E74;&#x9F84;&#xFF1A;&#x7531;&#x4E8E;&#x5DF2;&#x7ECF;&#x6839;&#x636E;&#x5E74;&#x9F84;&#x751F;&#x6210;&#x4E86;&#x65B0;&#x7684;&#x7279;&#x5F81;&#x201C;&#x5E74;&#x9F84;&#x6BB5;&#x201D;&#xFF0C;&#x6240;&#x4EE5;&#x8FD9;&#x4E2A;&#x7279;&#x5F81;&#x4E5F;&#x9700;&#x8981;&#x5220;&#x9664;&#x3002;</li>
<li>&#x7968;&#xFF1A;&#x7968;&#x8FD9;&#x4E2A;&#x7279;&#x5F81;&#x611F;&#x89C9;&#x662F;&#x4E00;&#x5806;&#x968F;&#x673A;&#x7684;&#x5B57;&#x7B26;&#x4E32;&#xFF0C;&#x6240;&#x4EE5;&#x5220;&#x6389;&#x3002;</li>
<li>&#x82B1;&#x8D39;&#xFF1A;&#x548C;&#x5E74;&#x9F84;&#x4E00;&#x6837;&#xFF0C;&#x5220;&#x6389;&#x3002;</li>
<li>&#x8239;&#x8231;&#xFF1A;&#x7531;&#x4E8E;&#x6709;&#x5F88;&#x591A;&#x7F3A;&#x5931;&#x503C;&#xFF0C;&#x4E0D;&#x597D;&#x586B;&#x5145;&#xFF0C;&#x6240;&#x4EE5;&#x53EF;&#x4EE5;&#x8003;&#x8651;&#x5220;&#x6389;&#x3002;</li>
<li>&#x8239;&#x5BA2;ID&#xFF1A;ID&#x548C;&#x751F;&#x6B7B;&#x5E94;&#x8BE5;&#x6CA1;&#x5565;&#x5173;&#x7CFB;&#xFF0C;&#x6240;&#x4EE5;&#x5220;&#x6389;&#x3002;</li>
</ul>
<pre><code class="lang-python">data.drop([<span class="hljs-string">&apos;Name&apos;</span>,<span class="hljs-string">&apos;Age&apos;</span>,<span class="hljs-string">&apos;Ticket&apos;</span>,<span class="hljs-string">&apos;Fare&apos;</span>,<span class="hljs-string">&apos;Cabin&apos;</span>,<span class="hljs-string">&apos;PassengerId&apos;</span>],axis=<span class="hljs-number">1</span>,inplace=<span class="hljs-keyword">True</span>)
</code></pre>
</section>
</div>
<div class="search-results">
<div class="has-results">
<h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
<ul class="search-results-list"></ul>
</div>
<div class="no-results">
<h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
</div>
</div>
</div>
</div>
</div>
</div>
<a href="EDA.html" class="navigation navigation-prev " aria-label="Previous page: 探索性数据分析(EDA)">
<i class="fa fa-angle-left"></i>
</a>
<a href="fit and predict.html" class="navigation navigation-next " aria-label="Next page: 构建模型进行预测">
<i class="fa fa-angle-right"></i>
</a>
</div>
<script>
var gitbook = gitbook || [];
gitbook.push(function() {
5 years ago
gitbook.page.hasChanged({"page":{"title":"特征工程","level":"1.6.1.3","depth":3,"next":{"title":"构建模型进行预测","level":"1.6.1.4","depth":3,"path":"titanic/fit and predict.md","ref":"./titanic/fit and predict.md","articles":[]},"previous":{"title":"探索性数据分析(EDA)","level":"1.6.1.2","depth":3,"path":"titanic/EDA.md","ref":"./titanic/EDA.md","articles":[]},"dir":"ltr"},"config":{"gitbook":"*","theme":"default","variables":{},"plugins":["katex"],"pluginsConfig":{"katex":{},"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"}},"file":{"path":"titanic/feature engerning.md","mtime":"2019-07-05T01:24:43.597Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-07-06T07:31:21.537Z"},"basePath":"..","book":{"language":""}});
5 years ago
});
</script>
</div>
<script src="../gitbook/gitbook.js"></script>
<script src="../gitbook/theme.js"></script>
<script src="../gitbook/gitbook-plugin-search/search-engine.js"></script>
<script src="../gitbook/gitbook-plugin-search/search.js"></script>
<script src="../gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
<script src="../gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
<script src="../gitbook/gitbook-plugin-sharing/buttons.js"></script>
<script src="../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
</body>
</html>