Skip to content

Commit 87b01f0

Browse files
authored
Merge branch 'master' into ValueError_indexing
2 parents 64e7a68 + 460419a commit 87b01f0

File tree

123 files changed

+1140
-1064
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

123 files changed

+1140
-1064
lines changed

CONTRIBUTING.md

+1-3
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@ This guide shows how to make contributions to [tensorflow.org](https://www.tenso
66

77
See the
88
[TensorFlow docs contributor guide](https://www.tensorflow.org/community/contribute/docs)
9-
for guidance. For questions, the
10-
[[email protected]](https://groups.google.com/a/tensorflow.org/forum/#!forum/docs)
11-
mailing list is available.
9+
for guidance. For questions, check out [TensorFlow Forum](https://discuss.tensorflow.org/).
1210

1311
Questions about TensorFlow usage are better addressed on
1412
[Stack Overflow](https://stackoverflow.com/questions/tagged/tensorflow) or the

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ To file a docs issue, use the issue tracker in the
1616
[tensorflow/tensorflow](https://github.com/tensorflow/tensorflow/issues/new?template=20-documentation-issue.md) repo.
1717

1818
And join the TensorFlow documentation contributors on the
19-
[[email protected] mailing list](https://groups.google.com/a/tensorflow.org/forum/#!forum/docs).
19+
[TensorFlow Forum](https://discuss.tensorflow.org/).
2020

2121
## Community translations
2222

site/en/community/contribute/docs.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ To participate in the TensorFlow docs community:
3232

3333
For details, use the [TensorFlow API docs contributor guide](docs_ref.md). This
3434
shows you how to find the
35-
[source file](https://www.tensorflow.org/code/tensorflow/python/)
35+
[source file](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/python/)
3636
and edit the symbol's
3737
<a href="https://www.python.org/dev/peps/pep-0257/" class="external">docstring</a>.
3838
Many API reference pages on tensorflow.org include a link to the source file
@@ -53,9 +53,9 @@ main
5353
<a href="https://github.com/tensorflow/tensorflow" class="external">tensorflow/tensorflow</a>
5454
repo. The reference documentation is generated from code comments
5555
and docstrings in the source code for
56-
<a href="https://www.tensorflow.org/code/tensorflow/python/" class="external">Python</a>,
57-
<a href="https://www.tensorflow.org/code/tensorflow/cc/" class="external">C++</a>, and
58-
<a href="https://www.tensorflow.org/code/tensorflow/java/" class="external">Java</a>.
56+
<a href="https://github.com/tensorflow/tensorflow/blob/master/tensorflow/python/" class="external">Python</a>,
57+
<a href="https://github.com/tensorflow/tensorflow/blob/master/tensorflow/cc/" class="external">C++</a>, and
58+
<a href="https://github.com/tensorflow/tensorflow/blob/master/tensorflow/java/" class="external">Java</a>.
5959

6060
Previous versions of the TensorFlow documentation are available as
6161
[rX.x branches](https://github.com/tensorflow/docs/branches) in the TensorFlow

site/en/community/contribute/docs_ref.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ TensorFlow uses [DocTest](https://docs.python.org/3/library/doctest.html) to
88
test code snippets in Python docstrings. The snippet must be executable Python
99
code. To enable testing, prepend the line with `>>>` (three left-angle
1010
brackets). For example, here's a excerpt from the `tf.concat` function in the
11-
[array_ops.py](https://www.tensorflow.org/code/tensorflow/python/ops/array_ops.py)
11+
[array_ops.py](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/python/ops/array_ops.py)
1212
source file:
1313

1414
```
@@ -178,7 +178,7 @@ There are two ways to test the code in the docstring locally:
178178
179179
* If you are only changing the docstring of a class/function/method, then you
180180
can test it by passing that file's path to
181-
[tf_doctest.py](https://www.tensorflow.org/code/tensorflow/tools/docs/tf_doctest.py).
181+
[tf_doctest.py](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/tools/docs/tf_doctest.py).
182182
For example:
183183
184184
<pre class="prettyprint lang-bsh">

site/en/community/contribute/docs_style.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,10 @@ repository like this:
6363
* <code>\[Basics\]\(../../guide/basics.ipynb\)</code> produces
6464
[Basics](../../guide/basics.ipynb).
6565

66-
This is the prefered approach because this way the links on
66+
This is the preferred approach because this way the links on
6767
[tensorflow.org](https://www.tensorflow.org),
68-
[GitHub](https://github.com/tensorflow/docs){:.external} and
69-
[Colab](https://github.com/tensorflow/docs/tree/master/site/en/guide/bazics.ipynb){:.external}
68+
[GitHub](https://github.com/tensorflow/docs) and
69+
[Colab](https://github.com/tensorflow/docs/tree/master/site/en/guide/bazics.ipynb)
7070
all work. Also, the reader stays in the same site when they click a link.
7171

7272
Note: You should include the file extension—such as `.ipynb` or `.md`—for
@@ -83,10 +83,10 @@ To link to source code, use a link starting with
8383
by the file name starting at the GitHub root.
8484

8585
When linking off of [tensorflow.org](https://www.tensorflow.org), include a
86-
`{:.external}` on the Markdown link so that the "external link" symbol is shown.
86+
`` on the Markdown link so that the "external link" symbol is shown.
8787

88-
* `[GitHub](https://github.com/tensorflow/docs){:.external}` produces
89-
[GitHub](https://github.com/tensorflow/docs){:.external}
88+
* `[GitHub](https://github.com/tensorflow/docs)` produces
89+
[GitHub](https://github.com/tensorflow/docs)
9090

9191
Do not include URI query parameters in the link:
9292

site/en/guide/core/logistic_regression_core.ipynb

+15-15
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,9 @@
6868
"id": "DauaqJ7WhIhO"
6969
},
7070
"source": [
71-
"This guide demonstrates how to use the [TensorFlow Core low-level APIs](https://www.tensorflow.org/guide/core) to perform [binary classification](https://developers.google.com/machine-learning/glossary#binary_classification){:.external} with [logistic regression](https://developers.google.com/machine-learning/crash-course/logistic-regression/){:.external}. It uses the [Wisconsin Breast Cancer Dataset](https://archive.ics.uci.edu/ml/datasets/breast+cancer+wisconsin+(original)){:.external} for tumor classification.\n",
71+
"This guide demonstrates how to use the [TensorFlow Core low-level APIs](https://www.tensorflow.org/guide/core) to perform [binary classification](https://developers.google.com/machine-learning/glossary#binary_classification) with [logistic regression](https://developers.google.com/machine-learning/crash-course/logistic-regression/). It uses the [Wisconsin Breast Cancer Dataset](https://archive.ics.uci.edu/ml/datasets/breast+cancer+wisconsin+(original)) for tumor classification.\n",
7272
"\n",
73-
"[Logistic regression](https://developers.google.com/machine-learning/crash-course/logistic-regression/){:.external} is one of the most popular algorithms for binary classification. Given a set of examples with features, the goal of logistic regression is to output values between 0 and 1, which can be interpreted as the probabilities of each example belonging to a particular class. "
73+
"[Logistic regression](https://developers.google.com/machine-learning/crash-course/logistic-regression/) is one of the most popular algorithms for binary classification. Given a set of examples with features, the goal of logistic regression is to output values between 0 and 1, which can be interpreted as the probabilities of each example belonging to a particular class. "
7474
]
7575
},
7676
{
@@ -81,7 +81,7 @@
8181
"source": [
8282
"## Setup\n",
8383
"\n",
84-
"This tutorial uses [pandas](https://pandas.pydata.org){:.external} for reading a CSV file into a [DataFrame](https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.html){:.external}, [seaborn](https://seaborn.pydata.org){:.external} for plotting a pairwise relationship in a dataset, [Scikit-learn](https://scikit-learn.org/){:.external} for computing a confusion matrix, and [matplotlib](https://matplotlib.org/){:.external} for creating visualizations."
84+
"This tutorial uses [pandas](https://pandas.pydata.org) for reading a CSV file into a [DataFrame](https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.html), [seaborn](https://seaborn.pydata.org) for plotting a pairwise relationship in a dataset, [Scikit-learn](https://scikit-learn.org/) for computing a confusion matrix, and [matplotlib](https://matplotlib.org/) for creating visualizations."
8585
]
8686
},
8787
{
@@ -128,7 +128,7 @@
128128
"source": [
129129
"## Load the data\n",
130130
"\n",
131-
"Next, load the [Wisconsin Breast Cancer Dataset](https://archive.ics.uci.edu/ml/datasets/breast+cancer+wisconsin+(original)){:.external} from the [UCI Machine Learning Repository](https://archive.ics.uci.edu/ml/){:.external}. This dataset contains various features such as a tumor's radius, texture, and concavity."
131+
"Next, load the [Wisconsin Breast Cancer Dataset](https://archive.ics.uci.edu/ml/datasets/breast+cancer+wisconsin+(original)) from the [UCI Machine Learning Repository](https://archive.ics.uci.edu/ml/). This dataset contains various features such as a tumor's radius, texture, and concavity."
132132
]
133133
},
134134
{
@@ -156,7 +156,7 @@
156156
"id": "A3VR1aTP92nV"
157157
},
158158
"source": [
159-
"Read the dataset into a pandas [DataFrame](){:.external} using [`pandas.read_csv`](https://pandas.pydata.org/docs/reference/api/pandas.read_csv.html){:.external}:"
159+
"Read the dataset into a pandas [DataFrame]() using [`pandas.read_csv`](https://pandas.pydata.org/docs/reference/api/pandas.read_csv.html):"
160160
]
161161
},
162162
{
@@ -207,7 +207,7 @@
207207
"id": "s4-Wn2jzVC1W"
208208
},
209209
"source": [
210-
"Split the dataset into training and test sets using [`pandas.DataFrame.sample`](https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.sample.html){:.external}, [`pandas.DataFrame.drop`](https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.drop.html){:.external} and [`pandas.DataFrame.iloc`](https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.iloc.html){:.external}. Make sure to split the features from the target labels. The test set is used to evaluate your model's generalizability to unseen data."
210+
"Split the dataset into training and test sets using [`pandas.DataFrame.sample`](https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.sample.html), [`pandas.DataFrame.drop`](https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.drop.html) and [`pandas.DataFrame.iloc`](https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.iloc.html). Make sure to split the features from the target labels. The test set is used to evaluate your model's generalizability to unseen data."
211211
]
212212
},
213213
{
@@ -277,7 +277,7 @@
277277
"\n",
278278
"This dataset contains the mean, standard error, and largest values for each of the 10 tumor measurements collected per example. The `\"diagnosis\"` target column is a categorical variable with `'M'` indicating a malignant tumor and `'B'` indicating a benign tumor diagnosis. This column needs to be converted into a numerical binary format for model training.\n",
279279
"\n",
280-
"The [`pandas.Series.map`](https://pandas.pydata.org/docs/reference/api/pandas.Series.map.html){:.external} function is useful for mapping binary values to the categories.\n",
280+
"The [`pandas.Series.map`](https://pandas.pydata.org/docs/reference/api/pandas.Series.map.html) function is useful for mapping binary values to the categories.\n",
281281
"\n",
282282
"The dataset should also be converted to a tensor with the `tf.convert_to_tensor` function after the preprocessing is complete."
283283
]
@@ -301,7 +301,7 @@
301301
"id": "J4ubs136WLNp"
302302
},
303303
"source": [
304-
"Use [`seaborn.pairplot`](https://seaborn.pydata.org/generated/seaborn.pairplot.html){:.external} to review the joint distribution of a few pairs of mean-based features from the training set and observe how they relate to the target:"
304+
"Use [`seaborn.pairplot`](https://seaborn.pydata.org/generated/seaborn.pairplot.html) to review the joint distribution of a few pairs of mean-based features from the training set and observe how they relate to the target:"
305305
]
306306
},
307307
{
@@ -343,7 +343,7 @@
343343
"id": "_8pDCIFjMla8"
344344
},
345345
"source": [
346-
"Given the inconsistent ranges, it is beneficial to standardize the data such that each feature has a zero mean and unit variance. This process is called [normalization](https://developers.google.com/machine-learning/glossary#normalization){:.external}."
346+
"Given the inconsistent ranges, it is beneficial to standardize the data such that each feature has a zero mean and unit variance. This process is called [normalization](https://developers.google.com/machine-learning/glossary#normalization)."
347347
]
348348
},
349349
{
@@ -384,19 +384,19 @@
384384
"\n",
385385
"### Logistic regression fundamentals\n",
386386
"\n",
387-
"Linear regression returns a linear combination of its inputs; this output is unbounded. The output of a [logistic regression](https://developers.google.com/machine-learning/glossary#logistic_regression){:.external} is in the `(0, 1)` range. For each example, it represents the probability that the example belongs to the _positive_ class.\n",
387+
"Linear regression returns a linear combination of its inputs; this output is unbounded. The output of a [logistic regression](https://developers.google.com/machine-learning/glossary#logistic_regression) is in the `(0, 1)` range. For each example, it represents the probability that the example belongs to the _positive_ class.\n",
388388
"\n",
389389
"Logistic regression maps the continuous outputs of traditional linear regression, `(-∞, ∞)`, to probabilities, `(0, 1)`. This transformation is also symmetric so that flipping the sign of the linear output results in the inverse of the original probability.\n",
390390
"\n",
391-
"Let $Y$ denote the probability of being in class `1` (the tumor is malignant). The desired mapping can be achieved by interpreting the linear regression output as the [log odds](https://developers.google.com/machine-learning/glossary#log-odds){:.external} ratio of being in class `1` as opposed to class `0`:\n",
391+
"Let $Y$ denote the probability of being in class `1` (the tumor is malignant). The desired mapping can be achieved by interpreting the linear regression output as the [log odds](https://developers.google.com/machine-learning/glossary#log-odds) ratio of being in class `1` as opposed to class `0`:\n",
392392
"\n",
393393
"$$\\ln(\\frac{Y}{1-Y}) = wX + b$$\n",
394394
"\n",
395395
"By setting $wX + b = z$, this equation can then be solved for $Y$:\n",
396396
"\n",
397397
"$$Y = \\frac{e^{z}}{1 + e^{z}} = \\frac{1}{1 + e^{-z}}$$\n",
398398
"\n",
399-
"The expression $\\frac{1}{1 + e^{-z}}$ is known as the [sigmoid function](https://developers.google.com/machine-learning/glossary#sigmoid_function){:.external} $\\sigma(z)$. Hence, the equation for logistic regression can be written as $Y = \\sigma(wX + b)$.\n",
399+
"The expression $\\frac{1}{1 + e^{-z}}$ is known as the [sigmoid function](https://developers.google.com/machine-learning/glossary#sigmoid_function) $\\sigma(z)$. Hence, the equation for logistic regression can be written as $Y = \\sigma(wX + b)$.\n",
400400
"\n",
401401
"The dataset in this tutorial deals with a high-dimensional feature matrix. Therefore, the above equation must be rewritten in a matrix vector form as follows:\n",
402402
"\n",
@@ -437,7 +437,7 @@
437437
"source": [
438438
"### The log loss function\n",
439439
"\n",
440-
"The [log loss](https://developers.google.com/machine-learning/glossary#Log_Loss){:.external}, or binary cross-entropy loss, is the ideal loss function for a binary classification problem with logistic regression. For each example, the log loss quantifies the similarity between a predicted probability and the example's true value. It is determined by the following equation:\n",
440+
"The [log loss](https://developers.google.com/machine-learning/glossary#Log_Loss), or binary cross-entropy loss, is the ideal loss function for a binary classification problem with logistic regression. For each example, the log loss quantifies the similarity between a predicted probability and the example's true value. It is determined by the following equation:\n",
441441
"\n",
442442
"$$L = -\\frac{1}{m}\\sum_{i=1}^{m}y_i\\cdot\\log(\\hat{y}_i) + (1- y_i)\\cdot\\log(1 - \\hat{y}_i)$$\n",
443443
"\n",
@@ -471,7 +471,7 @@
471471
"source": [
472472
"### The gradient descent update rule\n",
473473
"\n",
474-
"The TensorFlow Core APIs support automatic differentiation with `tf.GradientTape`. If you are curious about the mathematics behind the logistic regression [gradient updates](https://developers.google.com/machine-learning/glossary#gradient_descent){:.external}, here is a short explanation:\n",
474+
"The TensorFlow Core APIs support automatic differentiation with `tf.GradientTape`. If you are curious about the mathematics behind the logistic regression [gradient updates](https://developers.google.com/machine-learning/glossary#gradient_descent), here is a short explanation:\n",
475475
"\n",
476476
"In the above equation for the log loss, recall that each $\\hat{y}_i$ can be rewritten in terms of the inputs as $\\sigma({\\mathrm{X_i}}w + b)$.\n",
477477
"\n",
@@ -754,7 +754,7 @@
754754
"\n",
755755
"For this problem, the FPR is the proportion of malignant tumor predictions amongst tumors that are actually benign. Conversely, the FNR is the proportion of benign tumor predictions among tumors that are actually malignant.\n",
756756
"\n",
757-
"Compute a confusion matrix using [`sklearn.metrics.confusion_matrix`](https://scikit-learn.org/stable/modules/generated/sklearn.metrics.confusion_matrix.html#sklearn.metrics.confusion_matrix){:.external}, which evaluates the accuracy of the classification, and use matplotlib to display the matrix:"
757+
"Compute a confusion matrix using [`sklearn.metrics.confusion_matrix`](https://scikit-learn.org/stable/modules/generated/sklearn.metrics.confusion_matrix.html#sklearn.metrics.confusion_matrix), which evaluates the accuracy of the classification, and use matplotlib to display the matrix:"
758758
]
759759
},
760760
{

0 commit comments

Comments
 (0)