Skip to content

Commit 0eff424

Browse files
authored
DOC: Correct typos in Polynomial Regression notebook (#940)
* DOC: Correct a typo: an 1d -> a 1d * DOC: Correct typos in Polynomial Regression notebook
1 parent 656a0cf commit 0eff424

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

bambi/transformations.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ def truncated(x, lb=None, ub=None):
9595
if lb is None and ub is None:
9696
raise ValueError("'lb' and 'ub' cannot both be None")
9797

98-
# Process lower bound so we get an 1d array with the adequate values
98+
# Process lower bound so we get a 1d array with the adequate values
9999
if lb is not None:
100100
lower = np.asarray(lb)
101101
if lower.ndim == 0:
@@ -107,7 +107,7 @@ def truncated(x, lb=None, ub=None):
107107
else:
108108
lower = np.full(len(x), -np.inf)
109109

110-
# Process upper bound so we get an 1d array with the adequate values
110+
# Process upper bound so we get a 1d array with the adequate values
111111
if ub is not None:
112112
upper = np.asarray(ub)
113113
if upper.ndim == 0:

docs/notebooks/polynomial_regression.ipynb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
"\n",
3939
"$$x_f = \\frac{1}{2} a t^2 + v_0 t + x_0$$\n",
4040
"\n",
41-
"Where $x_0$ and $x_f$ are the initial and final locations, $v_0$ is the initial velocity, and $a$ is acceleration.\n",
41+
"where $x_0$ and $x_f$ are the initial and final locations, $v_0$ is the initial velocity, and $a$ is acceleration.\n",
4242
"\n",
4343
"## A falling ball\n",
4444
"\n",
@@ -87,7 +87,7 @@
8787
"cell_type": "markdown",
8888
"metadata": {},
8989
"source": [
90-
"Casting the equation $x_f = \\frac{1}{2} g t^2 + x_0$ into a regression context, we let time ($t$) be the independent variable, and final location ($x_f$) be the response/dependent variable. This allows our coefficients to be proportional to $g$ and $x_0$. The intercept, $\\beta_0$ corresponds exactly to $x_0$. Letting $\\beta_1 = \\frac{1}{2} g$ then gives $g = 2\\beta_1$ when $x_1 = t^2$, meaning we\"re doing _polynomial regression_. We can put this into Bambi via the following, optionally including the `+ 1` to emphasize that we choose to include the coefficient. "
90+
"Casting the equation $x_f = \\frac{1}{2} g t^2 + x_0$ into a regression context, we let time ($t$) be the independent variable, and final location ($x_f$) be the response/dependent variable. This allows our coefficients to be proportional to $g$ and $x_0$. The intercept, $\\beta_0$ corresponds exactly to $x_0$. Letting $\\beta_1 = \\frac{1}{2} g$ then gives $g = 2\\beta_1$ when $x_1 = t^2$, meaning we're doing _polynomial regression_. We can put this into Bambi via the following, optionally including the `+ 1` to emphasize that we choose to include the coefficient. "
9191
]
9292
},
9393
{
@@ -145,13 +145,13 @@
145145
"cell_type": "markdown",
146146
"metadata": {},
147147
"source": [
148-
"The term `I(t**2)` indicates to evaluate inside the `I`. For including _just the $t^2$ term_, you can express it any of the following ways: \n",
148+
"The term `I(t**2)` indicates to evaluate inside the `I`. For including _just the $t^2$ term_, you can express it in any of the following ways: \n",
149149
"\n",
150150
"- `I(t**2)`\n",
151151
"- `{t**2}`\n",
152152
"- Square the data directly, and pass it as a new column\n",
153153
"\n",
154-
"To verify, we\"ll fit the other two versions as well."
154+
"To verify, we'll fit the other two versions as well."
155155
]
156156
},
157157
{
@@ -487,7 +487,7 @@
487487
"\n",
488488
"$$x_f = \\beta_0 + \\beta_1 t + \\beta_2 t^2$$\n",
489489
"\n",
490-
"Which then maps the solved coefficents to the following: $\\beta_0 = x_0$, $\\beta_1 = v_0$, and $\\beta_2 = \\frac{g}{2}$."
490+
"which then maps the solved coefficents to the following: $\\beta_0 = x_0$, $\\beta_1 = v_0$, and $\\beta_2 = \\frac{g}{2}$."
491491
]
492492
},
493493
{

0 commit comments

Comments
 (0)