From 3c2337a5d1d7ce552e4f11fa0257c0db76e7a834 Mon Sep 17 00:00:00 2001 From: Cancan <37414062+cancan233@users.noreply.github.com> Date: Mon, 22 Jul 2019 01:40:03 -0400 Subject: [PATCH] revise some minor typos --- docs/6.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/6.md b/docs/6.md index 1dd5ff9..f9d67b7 100644 --- a/docs/6.md +++ b/docs/6.md @@ -20,7 +20,7 @@ tips = sns.load_dataset("tips") ## 绘制线性回归模型的函数 -seaborn中两个主要函数主要用于显示回归确定的线性关系。这些函数,[`regplot()`](../ generated / seaborn.regplot.html#seaborn.regplot"seaborn.regplot")和[`lmplot()`](../ generated / seaborn.lmplot.html #seaborn.lmplot"seaborn.lmplot"), 之间密切关联,并且共享核心功能。但是,了解它们的不同之处非常重要,这样你就可以快速为特定工作选择正确的工具。 +seaborn中两个主要函数主要用于显示回归确定的线性关系。这些函数,[`regplot()`](../generated/seaborn.regplot.html#seaborn.regplot"seaborn.regplot") 和 [`lmplot()`](../generated/seaborn.lmplot.html#seaborn.lmplot"seaborn.lmplot"), 之间密切关联,并且共享核心功能。但是,了解它们的不同之处非常重要,这样你就可以快速为特定工作选择正确的工具。 在最简单的调用中,两个函数都绘制了两个变量,`x`和`y`,然后拟合回归模型`y~x`并绘制得到回归线和该回归的95%置信区间: @@ -36,7 +36,7 @@ sns.lmplot(x="total_bill", y="tip", data=tips); ![http://seaborn.pydata.org/_images/regression_8_0.png](img/ff165b205839381bf1fa11c2df3d176d.jpg) -你应当注意到,除了图形形状不同,两幅结果图是完全一致的。我们会在后面解释原因。目前,要了解的另一个主要区别是[`regplot()`](../ generated / seaborn.regplot.html#seaborn.regplot"seaborn.regplot")接受多种格式的`x`和`y`变量,包括简单的numpy数组,pandas `Series`对象,或者作为对传递给`data`的pandas `DataFrame`对象。相反,[`lmplot()`](../ generated / seaborn.lmplot.html#seaborn.lmplot"seaborn.lmplot")将`data`作为必须参数,`x`和`y`变量必须被指定为字符串。这种数据格式被称为"长格式"或["整齐"](https://vita.had.co.nz/papers/tidy-data.pdf)数据。 除了这种输入的灵活性之外,[`regplot()`](../ generated / seaborn.regplot.html#seaborn.regplot"seaborn.regplot")拥有[`lmplot()`](../ generated / seaborn.lmplot.html#seaborn.lmplot"seaborn.lmplot")一个子集的功能,所以我们将使用后者来演示它们。 +你应当注意到,除了图形形状不同,两幅结果图是完全一致的。我们会在后面解释原因。目前,要了解的另一个主要区别是[`regplot()`](../generated/seaborn.regplot.html#seaborn.regplot"seaborn.regplot")接受多种格式的`x`和`y`变量,包括简单的numpy数组,pandas `Series`对象,或者作为对传递给`data`的pandas `DataFrame`对象。相反,[`lmplot()`](../generated/seaborn.lmplot.html#seaborn.lmplot"seaborn.lmplot")将`data`作为必须参数,`x`和`y`变量必须被指定为字符串。这种数据格式被称为"长格式"或["整齐"](https://vita.had.co.nz/papers/tidy-data.pdf)数据。 除了这种输入的灵活性之外,[`regplot()`](../ generated / seaborn.regplot.html#seaborn.regplot"seaborn.regplot")拥有[`lmplot()`](../generated/seaborn.lmplot.html#seaborn.lmplot"seaborn.lmplot")一个子集的功能,所以我们将使用后者来演示它们。 当其中一个变量采用离散值时,可以拟合线性回归。但是,这种数据集生成的简单散点图通常不是最优的: @@ -86,7 +86,7 @@ sns.lmplot(x="x", y="y", data=anscombe.query("dataset == 'II'"), ![http://seaborn.pydata.org/_images/regression_19_0.png](img/af2ff74dd015731938ea83ab029d73e7.jpg) -在这些存在高阶关系的情况下,[`regplot()`](../ generated / seaborn.regplot.html#seaborn.regplot"seaborn.regplot")和[`lmplot()`](./generated/seaborn.regplot.html#seaborn.regplot"seaborn.regplot")可以拟合多项式回归模型来探索数据集中的简单非线性趋势: +在这些存在高阶关系的情况下,[`regplot()`](../generated/seaborn.regplot.html#seaborn.regplot"seaborn.regplot")和[`lmplot()`](./generated/seaborn.regplot.html#seaborn.regplot"seaborn.regplot")可以拟合多项式回归模型来探索数据集中的简单非线性趋势: ```python sns.lmplot(x="x", y="y", data=anscombe.query("dataset == 'II'"), -- GitLab