Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

master build status

[!https://ci-builds.apache.org/job/Madlib/job/madlib-build/job/master/badge/icon!|https://ci-builds.apache.org/job/Madlib/job/madlib-build/job/master/]

This guide explains all of the elements needed to successfully develop and plug in a new MADlib® module.

...

Code Block
languagesql
SELECT madlib.avg_var(second_attack) FROM patients;

    -- ************ --
    --    Result    --
    -- ************ --
    +-------------------+
    | avg_var           |
    |-------------------|
    | [0.5, 0.25, 20.0] |
    +-------------------+
-- (average, variance, count) --

...


Anchor
Adding Iterative Module
Adding Iterative Module
Adding An Iterative UDF

...

The example below demonstrates the usage of madlib.logregr_simple_train on the patients table we used earlier. The trained classification model is stored in the table called logreg_mdl and can be viewed using standard SQL query. 


Code Block
languagesql
SELECT madlib.logregr_simple_train( 
    'patients',                                 -- source table
    'logreg_mdl',                               -- output table
    'second_attack',                            -- labels
    'ARRAY[1, treatment, trait_anxiety]');      -- features
SELECT * FROM logreg_mdl;

-- ************ --
--    Result    --
-- ************ --
+--------------------------------------------------+------------------+
| coef                                             |   log_likelihood |
|--------------------------------------------------+------------------|
| [-6.27176619714, -0.84168872422, 0.116267554551] |         -9.42379 |
+--------------------------------------------------+------------------+

...