This is an automated email from the ASF dual-hosted git repository.

myui pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-hivemall.git


The following commit(s) were added to refs/heads/master by this push:
     new dc2cc9d  Trivial doc fix
dc2cc9d is described below

commit dc2cc9de6063249e36af0cc2751d1b7f1a94fb63
Author: Makoto Yui <[email protected]>
AuthorDate: Fri Aug 21 18:54:15 2020 +0900

    Trivial doc fix
---
 docs/gitbook/binaryclass/news20_generic_bagging.md | 26 ++++++++--------------
 1 file changed, 9 insertions(+), 17 deletions(-)

diff --git a/docs/gitbook/binaryclass/news20_generic_bagging.md 
b/docs/gitbook/binaryclass/news20_generic_bagging.md
index ba5b949..0e8c5f0 100644
--- a/docs/gitbook/binaryclass/news20_generic_bagging.md
+++ b/docs/gitbook/binaryclass/news20_generic_bagging.md
@@ -37,23 +37,13 @@ WITH train as (
      ) as (feature,weight)
   from
      news20b_train_x3
-),
-models as (
-  select
-    taskid() as modelid,
-    feature,
-    weight
-  from 
-    train
 )
 select
-  modelid,
+  taskid() as modelid,
   feature,
-  voted_avg(weight) as weight -- or simply avg(weight)
-from
-  models
-group by
-  modelid, feature;
+  weight
+from 
+  train;
 ```
 
 ## prediction
@@ -73,10 +63,10 @@ WITH weights as (
   group by
     rowid, modelid
 ),
-voted as (
+bagging as (
   select
     rowid,
-    voted_avg(total_weight) as total_weight
+    avg(total_weight) as total_weight
   from 
     weights
   group by
@@ -85,9 +75,11 @@ voted as (
 select
   rowid,
   max(total_weight) as total_weight, -- max is dummy 
+  -- Note: sum(total_weight) > 0.0 equals to sigmoid((total_weight)) > 0.5
+  -- https://en.wikipedia.org/wiki/Sigmoid_function
   case when sum(total_weight) > 0.0 then 1 else -1 end as label
 from
-  voted
+  bagging
 group by
   rowid;
 ```

Reply via email to