You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by jb...@apache.org on 2019/10/16 12:46:27 UTC
[lucene-solr] branch SOLR-13105-visual updated: SOLR-13105: Improve
curve fitting docs
This is an automated email from the ASF dual-hosted git repository.
jbernste pushed a commit to branch SOLR-13105-visual
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git
The following commit(s) were added to refs/heads/SOLR-13105-visual by this push:
new fd3d50c SOLR-13105: Improve curve fitting docs
fd3d50c is described below
commit fd3d50c5807b3c1097bb4a7639f35bff94b11dc6
Author: Joel Bernstein <jb...@apache.org>
AuthorDate: Wed Oct 16 08:46:04 2019 -0400
SOLR-13105: Improve curve fitting docs
---
solr/solr-ref-guide/src/curve-fitting.adoc | 31 +++++++++++++--------
.../src/images/math-expressions/gaussfit.png | Bin 267094 -> 251329 bytes
.../src/images/math-expressions/gaussfit2.png | Bin 267254 -> 250671 bytes
.../images/math-expressions/polyfit-predict.png | Bin 0 -> 96813 bytes
.../src/images/math-expressions/polyfit-resid.png | Bin 288725 -> 263482 bytes
.../src/images/math-expressions/polyfit.png | Bin 240003 -> 234032 bytes
6 files changed, 19 insertions(+), 12 deletions(-)
diff --git a/solr/solr-ref-guide/src/curve-fitting.adoc b/solr/solr-ref-guide/src/curve-fitting.adoc
index 54ed2e7..c111acf 100644
--- a/solr/solr-ref-guide/src/curve-fitting.adoc
+++ b/solr/solr-ref-guide/src/curve-fitting.adoc
@@ -44,10 +44,22 @@ are the predicted curve.
image::images/math-expressions/polyfit.png[]
-In the example above the `polyfit` function returns a model that can be used
-by the `predict` function in the same manner as linear regression.
-In this example the predictions are generated for the original x-axis points
-of the observation.
+In the example above a random sample containing two fields, *filesize_d*
+and *response_d*, is drawn from the *logs* collection.
+The two fields are vectorized and set to the variables *x* and *y*.
+
+Then the `polyfit` function is used to fit a non-linear model to the data using a 5 degree
+polynomial. The `polyfit` function returns a model that is then directly plotted
+by `zplot` along with the original observations.
+
+The fitted model can also be used
+by the `predict` function in the same manner as linear regression. The example below
+uses the fitted model to predict a response time for a files size of 42000.
+
+
+image::images/math-expressions/polyfit-predict.png[]
+
+If an array of predictor values is provided an array of predictions will be returned.
The `polyfit` model performs both *interpolation* and *extrapolation*,
which means that it can predict results both within the bounds of the data set
@@ -57,14 +69,13 @@ and beyond the bounds.
The residuals can be calculated and visualized in the same manner as linear
regression as well. In the example below the `ebeSubtract` function is used
-to subtract the observed *y* values from the predicted *y* values, to
-calculate a vector of residuals. The residuals are then plotted.
-
+to subtract the fitted model from the observed values, to
+calculate a vector of residuals. The residuals are then plotted in a *residual plot*
+with the predictions along the *x* axis and the model error on the *y* axis.
image::images/math-expressions/polyfit-resid.png[]
-
== Gaussian Curve Fitting
The `gaussfit` function fits a smooth curve through a Gaussian peak. The `gaussfit`
@@ -103,10 +114,6 @@ The second plot shows the two curves overlaid with an area chart:
image::images/math-expressions/gaussfit2.png[]
-
-
-
-
== Harmonic Curve Fitting
The `harmonicFit` function (or `harmfit`, for short) fits a smooth line through control points of a sine wave.
diff --git a/solr/solr-ref-guide/src/images/math-expressions/gaussfit.png b/solr/solr-ref-guide/src/images/math-expressions/gaussfit.png
index 2943851..98348a7 100644
Binary files a/solr/solr-ref-guide/src/images/math-expressions/gaussfit.png and b/solr/solr-ref-guide/src/images/math-expressions/gaussfit.png differ
diff --git a/solr/solr-ref-guide/src/images/math-expressions/gaussfit2.png b/solr/solr-ref-guide/src/images/math-expressions/gaussfit2.png
index 4bd5aee..796b6a6 100644
Binary files a/solr/solr-ref-guide/src/images/math-expressions/gaussfit2.png and b/solr/solr-ref-guide/src/images/math-expressions/gaussfit2.png differ
diff --git a/solr/solr-ref-guide/src/images/math-expressions/polyfit-predict.png b/solr/solr-ref-guide/src/images/math-expressions/polyfit-predict.png
new file mode 100644
index 0000000..58c9f90
Binary files /dev/null and b/solr/solr-ref-guide/src/images/math-expressions/polyfit-predict.png differ
diff --git a/solr/solr-ref-guide/src/images/math-expressions/polyfit-resid.png b/solr/solr-ref-guide/src/images/math-expressions/polyfit-resid.png
index 2835157..a7130cc 100644
Binary files a/solr/solr-ref-guide/src/images/math-expressions/polyfit-resid.png and b/solr/solr-ref-guide/src/images/math-expressions/polyfit-resid.png differ
diff --git a/solr/solr-ref-guide/src/images/math-expressions/polyfit.png b/solr/solr-ref-guide/src/images/math-expressions/polyfit.png
index 11bb87a..4ce63c0 100644
Binary files a/solr/solr-ref-guide/src/images/math-expressions/polyfit.png and b/solr/solr-ref-guide/src/images/math-expressions/polyfit.png differ