Database Reference
In-Depth Information
-- one regression model
SELECT madlib.linregr_train(
'items', 'items_lr', 'price', 'array[1,
tax]');
-- different output models
SELECT madlib.linregr_train(
'items', 'items_lr_quantity', 'price',
'array[1, tax]', 'quantity');
3. Analyze the results:
SELECT * from items_lr;
SELECT * FROM items_lr_quantity;
4. Check the residues using prediction function for removing data noise.
SELECT items.*,
madlib.linregr_predict(array[1,tax],
m.coef) as predict, price -
madlib.linregr_predict(array[1,tax],
m.coef) as residual FROM items, items_lr
quantity;
Refer http://doc.madlib.net/v1.1/index.html for more documentation on functions and
examples.
Search WWH ::




Custom Search