Skip to content

Commit

Permalink
Elastic Net: Remove buggy doc example
Browse files Browse the repository at this point in the history
  • Loading branch information
Rahul Iyer committed Sep 11, 2013
1 parent 703a8fe commit 9a0a772
Showing 1 changed file with 42 additions and 42 deletions.
84 changes: 42 additions & 42 deletions src/ports/postgres/modules/elastic_net/elastic_net.sql_in
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ This module implements elastic net regularization for linear and logistic regres
@anchor help
@par Online Help

View a summary of the Elastic Net Regularization Module by calling the \ref elastic_net_train() function with no arguments:
View a summary of the Elastic Net Regularization Module by calling the \ref elastic_net_train() function with no arguments:
@verbatim
SELECT madlib.elastic_net_train();
@endverbatim
Expand All @@ -46,19 +46,19 @@ SELECT madlib.elastic_net_train();
The training function has the following syntax:
@verbatim
elastic_net_train(
tbl_source,
tbl_result,
col_dep_var,
tbl_source,
tbl_result,
col_dep_var,
col_ind_var,
regress_family,
alpha,
lambda_value,
regress_family,
alpha,
lambda_value,
standardize,
grouping_col,
grouping_col,
optimizer,
optimizer_params,
optimizer_params,
excluded,
max_iter,
max_iter,
tolerance)
@endverbatim
\note It is \b strongly \b recommended that you run
Expand Down Expand Up @@ -139,14 +139,14 @@ to specify the value of a parameter, otherwise the parameter is ignored.

When the \ref elastic_net_train() \e optimizer argument value is \b 'fista', the \e optimizer_params argument is a string containing name-value pairs with the following format. (Line breaks are inserted for readability.)
@verbatim
'max_stepsize = <value>,
eta = <value>,
warmup = <value>,
'max_stepsize = <value>,
eta = <value>,
warmup = <value>,
warmup_lambdas = <value>,
warmup_lambda_no = <value>,
warmup_tolerance = <value>,
warmup_lambda_no = <value>,
warmup_tolerance = <value>,
use_active_set = <value>,
activeset_tolerance = <value>,
activeset_tolerance = <value>,
random_stepsize = <value>'
@endverbatim
\b Parameters
Expand Down Expand Up @@ -199,11 +199,11 @@ When the \ref elastic_net_train() \e optimizer argument value is \b 'igd', the
the following format. (Line breaks are inserted for readability.)
@verbatim
'stepsize = <value>,
step_decay = <value>,
threshold = <value>,
step_decay = <value>,
threshold = <value>,
warmup = <value>,
warmup_lambdas = <value>,
warmup_lambda_no = <value>,
warmup_lambdas = <value>,
warmup_lambda_no = <value>,
warmup_tolerance = <value>,
parallel = <value>'
@endverbatim
Expand Down Expand Up @@ -309,17 +309,17 @@ There are several different formats of the prediction function:
-#
@code
elastic_net_gaussian_predict (
coefficients,
intercept,
coefficients,
intercept,
ind_var
) FROM tbl_result, tbl_new_source LIMIT 10;
@endcode

-#
@code
SELECT madlib.elastic_net_binomial_predict (
coefficients,
intercept,
coefficients,
intercept,
ind_var
) FROM tbl_result, tbl_new_source LIMIT 10;
@endcode
Expand All @@ -329,8 +329,8 @@ This returns 10 BOOLEAN values.
-#
@code
SELECT madlib.elastic_net_binomial_prob (
coefficients,
intercept,
coefficients,
intercept,
ind_var
) FROM tbl_result, tbl_new_source LIMIT 10;
@endcode
Expand All @@ -344,7 +344,7 @@ general cross validation function.
SELECT madlib.elastic_net_predict(
tbl_model,
tbl_new_sourcedata,
col_id,
col_id,
tbl_predict)
@endcode
\b Arguments
Expand All @@ -357,7 +357,7 @@ SELECT madlib.elastic_net_predict(
<dd>TEXT. The unique ID associated with each row.</dd>
<dt>tbl_predict</dt>
<dd>TEXT. The name of table to store the prediction result. </dd>
</dl>
</dl>
You do not need to specify whether the model is "linear" or "logistic" because this information is already included in the \e tbl_model table.

@anchor examples
Expand Down Expand Up @@ -389,19 +389,19 @@ COPY houses FROM STDIN WITH DELIMITER '|';
@verbatim
DROP TABLE IF EXISTS houses_en;
SELECT madlib.elastic_net_train(
'houses',
'houses_en',
'price',
'houses',
'houses_en',
'price',
'array[tax, bath, size]',
'gaussian',
0.5,
0.1,
TRUE,
NULL,
'gaussian',
0.5,
0.1,
TRUE,
NULL,
'fista',
'',
NULL,
10000,
NULL,
10000,
1e-6);
@endverbatim
-# View the resulting model.
Expand All @@ -413,12 +413,12 @@ SELECT * FROM houses_en;
-# Use the prediction function to evaluate residuals.
@verbatim
SELECT *, price - predict as residual FROM (
SELECT
SELECT
houses.*,
madlib.elastic_net_predict(
'gaussian',
m.coef_nonzero,
m.intercept,
'gaussian',
m.coef_all,
m.intercept,
ARRAY[tax,bath,size]
) as predict
FROM houses, houses_en m) s;
Expand Down

0 comments on commit 9a0a772

Please sign in to comment.