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/09/30 18:16:32 UTC

[lucene-solr] branch SOLR-13105-visual updated: SOLR-13105: Update regression 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 f7c51f4  SOLR-13105: Update regression docs
f7c51f4 is described below

commit f7c51f4c63f83ec5fbf8f90c55f52c1f1384e951
Author: Joel Bernstein <jb...@apache.org>
AuthorDate: Mon Sep 30 14:16:09 2019 -0400

    SOLR-13105: Update regression docs
---
 .../src/images/math-expressions/knnRegress.png     | Bin 265283 -> 245974 bytes
 .../src/images/math-expressions/linear.png         | Bin 253504 -> 250920 bytes
 .../src/images/math-expressions/residual-plot.png  | Bin 288454 -> 276638 bytes
 .../src/images/math-expressions/residual-plot2.png | Bin 285505 -> 289663 bytes
 solr/solr-ref-guide/src/machine-learning.adoc      |   6 ++
 solr/solr-ref-guide/src/regression.adoc            |  66 ++++++++++-----------
 6 files changed, 39 insertions(+), 33 deletions(-)

diff --git a/solr/solr-ref-guide/src/images/math-expressions/knnRegress.png b/solr/solr-ref-guide/src/images/math-expressions/knnRegress.png
index eb1719f..ddc85de 100644
Binary files a/solr/solr-ref-guide/src/images/math-expressions/knnRegress.png and b/solr/solr-ref-guide/src/images/math-expressions/knnRegress.png differ
diff --git a/solr/solr-ref-guide/src/images/math-expressions/linear.png b/solr/solr-ref-guide/src/images/math-expressions/linear.png
index fcf5d80..007d0d6 100644
Binary files a/solr/solr-ref-guide/src/images/math-expressions/linear.png and b/solr/solr-ref-guide/src/images/math-expressions/linear.png differ
diff --git a/solr/solr-ref-guide/src/images/math-expressions/residual-plot.png b/solr/solr-ref-guide/src/images/math-expressions/residual-plot.png
index 490f83e..d39d1cc 100644
Binary files a/solr/solr-ref-guide/src/images/math-expressions/residual-plot.png and b/solr/solr-ref-guide/src/images/math-expressions/residual-plot.png differ
diff --git a/solr/solr-ref-guide/src/images/math-expressions/residual-plot2.png b/solr/solr-ref-guide/src/images/math-expressions/residual-plot2.png
index c42aa83..97b6cb1 100644
Binary files a/solr/solr-ref-guide/src/images/math-expressions/residual-plot2.png and b/solr/solr-ref-guide/src/images/math-expressions/residual-plot2.png differ
diff --git a/solr/solr-ref-guide/src/machine-learning.adoc b/solr/solr-ref-guide/src/machine-learning.adoc
index ecd0221..11fc388 100644
--- a/solr/solr-ref-guide/src/machine-learning.adoc
+++ b/solr/solr-ref-guide/src/machine-learning.adoc
@@ -360,6 +360,12 @@ Below is an example of the `knnRegress` function. In this example 10,000 random
 are taken, each containing the variables `filesize_d`, `service_d` and `response_d`. The pairs of
 `filesize_d` and `service_d` will be used to predict the value of `response_d`.
 
+
+image::images/math-expressions/knnRegress.png[]
+
+
+
+
 [source,text]
 ----
 let(samples=random(collection1, q="*:*", rows="10000", fl="filesize_d, service_d, response_d"),
diff --git a/solr/solr-ref-guide/src/regression.adoc b/solr/solr-ref-guide/src/regression.adoc
index 08d193b..5b73935 100644
--- a/solr/solr-ref-guide/src/regression.adoc
+++ b/solr/solr-ref-guide/src/regression.adoc
@@ -39,7 +39,7 @@ analysis.
 
 [source,text]
 ----
-let(a=random(testapp, q="*:*", rows="50000", fl="filesize_d, response_d"),
+let(a=random(logs, q="*:*", rows="50000", fl="filesize_d, response_d"),
     x=col(a, filesize_d),
     y=col(a, response_d),
     r=regress(x, y))
@@ -91,7 +91,7 @@ the value of `response_d` for the `filesize_d` value of `40000`.
 
 [source,text]
 ----
-let(a=random(testapp, q="*:*", rows="5000", fl="filesize_d, response_d"),
+let(a=random(logs, q="*:*", rows="5000", fl="filesize_d, response_d"),
     x=col(a, filesize_d),
     y=col(a, response_d),
     r=regress(x, y),
@@ -126,7 +126,7 @@ In this case 5000 predictions are returned.
 
 [source,text]
 ----
-let(a=random(testapp, q="*:*", rows="5000", fl="filesize_d, response_d"),
+let(a=random(logs, q="*:*", rows="5000", fl="filesize_d, response_d"),
     x=col(a, filesize_d),
     y=col(a, response_d),
     r=regress(x, y),
@@ -171,7 +171,7 @@ Using *zplot* and the Zeppelin-Solr interpreter we can visualize both the observ
 the same scatter plot. In the example below zplot is plotting the filesize_d observations on the
 *x* axis, the response_d observations on the *y* access and the predictions on the *y1* access.
 
-image::images/math-expressions/regression-plot.png[]
+image::images/math-expressions/linear.png[]
 
 === Residuals
 
@@ -186,7 +186,7 @@ the array of residuals.
 
 [source,text]
 ----
-let(a=random(testapp, q="*:*", rows="500", fl="filesize_d, response_d"),
+let(a=random(logs, q="*:*", rows="500", fl="filesize_d, response_d"),
     x=col(a, filesize_d),
     y=col(a, response_d),
     r=regress(x, y),
@@ -196,7 +196,7 @@ let(a=random(testapp, q="*:*", rows="500", fl="filesize_d, response_d"),
 
 When this expression is sent to the `/stream` handler it responds with:
 
-[source,json]
+[source,text]
 ----
 {
   "result-set": {
@@ -338,13 +338,13 @@ the first value represents a `filesize_d` of `40000` and the second value repres
 
 [source,text]
 ----
-let(a=random(testapp, q="*:*", rows="5000", fl="filesize_d, load_d, response_d"),
-    b=col(a, filesize_d),
-    c=col(a, load_d),
-    d=col(a, response_d),
-    e=transpose(matrix(b, c)),
-    f=olsRegress(e, d),
-    g=predict(f, array(40000, 4)))
+let(a=random(logs, q="*:*", rows="5000", fl="filesize_d, load_d, response_d"),
+    x=col(a, filesize_d),
+    y=col(a, load_d),
+    z=col(a, response_d),
+    m=transpose(matrix(x, y)),
+    r=olsRegress(m, z),
+    p=predict(r, array(40000, 4)))
 ----
 
 When this expression is sent to the `/stream` handler it responds with:
@@ -355,7 +355,7 @@ When this expression is sent to the `/stream` handler it responds with:
   "result-set": {
     "docs": [
       {
-        "g": 801.7725344814675
+        "p": 801.7725344814675
       },
       {
         "EOF": true,
@@ -374,24 +374,24 @@ is passed to the `predict` function and it returns an array of predictions.
 
 [source,text]
 ----
-let(a=random(testapp, q="*:*", rows="5000", fl="filesize_d, load_d, response_d"),
-    b=col(a, filesize_d),
-    c=col(a, load_d),
-    d=col(a, response_d),
-    e=transpose(matrix(b, c)),
-    f=olsRegress(e, d),
-    g=predict(f, e))
+let(a=random(logs, q="*:*", rows="5000", fl="filesize_d, load_d, response_d"),
+    x=col(a, filesize_d),
+    y=col(a, load_d),
+    z=col(a, response_d),
+    m=transpose(matrix(x, y)),
+    r=olsRegress(m, z),
+    p=predict(r, m))
 ----
 
 When this expression is sent to the `/stream` handler it responds with:
 
-[source,json]
+[source,text]
 ----
 {
   "result-set": {
     "docs": [
       {
-        "g": [
+        "p": [
           917.7122088913725,
           900.5418518783401,
           871.7805676516689,
@@ -426,25 +426,25 @@ the predictions stored variable *`g`* are subtracted from observed values stored
 
 [source,text]
 ----
-let(a=random(testapp, q="*:*", rows="5000", fl="filesize_d, load_d, response_d"),
-    b=col(a, filesize_d),
-    c=col(a, load_d),
-    d=col(a, response_d),
-    e=transpose(matrix(b, c)),
-    f=olsRegress(e, d),
-    g=predict(f, e),
-    r=ebeSubtract(d, g))
+let(a=random(logs, q="*:*", rows="5000", fl="filesize_d, load_d, response_d"),
+    x=col(a, filesize_d),
+    y=col(a, load_d),
+    z=col(a, response_d),
+    m=transpose(matrix(x, y)),
+    r=olsRegress(m, z),
+    p=predict(r, m),
+    e=ebeSubtract(z, p))
 ----
 
 When this expression is sent to the `/stream` handler it responds with:
 
-[source,json]
+[source,text]
 ----
 {
   "result-set": {
     "docs": [
       {
-        "r": [
+        "e": [
           21.452271655340496,
           9.647947283595727,
           -23.02328008866334,