PostgreSQL 多元线性回归 - 1 MADLib Installed in PostgreSQL 9.2

7 minute read

背景

MADlib 是伯克利大学的一个开源软件项目. 主要目的是扩展数据库的分析能力. 支持PostgreSQL和Greenplum数据库.

可以非常方便的加载到PostgreSQL或Greenplum, 扩展数据库的分析功能. 当然这和PostgreSQL本身支持模块化加载是分布开的.

在数据库中呈现给用户的是一堆分析函数. 1.0包含71个聚合函数和786个普通函数.

http://db.cs.berkeley.edu/w/source-code/

An open source machine learning library on RDBMS for Big Data age  
  
MADlib is an open-source library for scalable in-database analytics.   
  
It provides data-parallel implementations of mathematical, statistical and machine learning methods for structured and unstructured data.  
  
The MADlib mission is to foster widespread development of scalable analytic skills,   
by harnessing efforts from commercial practice, academic research, and open-source development.   
  
The library consists of various analytics methods including linear regression, logistic regression, k-means clustering,   
decision tree, support vector machine and more.   
  
That's not all; there is also super-efficient user-defined data type for sparse vector with a number of arithmetic methods.   
  
It can be loaded and run in PostgreSQL 8.4 to 9.1 as well as Greenplum 4.0 to 4.2.   
  
This talk covers its concept overall with some introductions to the problems we are tackling and the solutions for them.   
  
It will also contain some topics around parallel data processing which is very hot in both of research and commercial area these days.  

MADLib需要用到Python 2.6或者更高版本, 同时需要PL/Python 2.6或者更高版本.

如果数据库安装时是低版本的python, 那么需要在安装好高版本的python后重新编译一下.

安装python 2.7.5 , 需要用到动态库, 所以在安装python是需要使用–enable-shared选项.

tar -jxvf Python-2.7.5.tar.bz2  
cd Python-2.7.5  
./configure --enable-shared  
make  
make install  

如果报以下错误, 需要将lib库加入到系统环境中,

[root@db-192-168-100-216 ~]# python -V  
python: error while loading shared libraries: libpython2.7.so.1.0: cannot open shared object file: No such file or directory  
  
[root@db-192-168-100-216 ~]# ldconfig -p|grep -i python  
        libpython2.4.so.1.0 (libc6,x86-64) => /usr/lib64/libpython2.4.so.1.0  
        libpython2.4.so (libc6,x86-64) => /usr/lib64/libpython2.4.so  
        libboost_python.so.2 (libc6,x86-64) => /usr/lib64/libboost_python.so.2  
        libboost_python.so.2 (libc6) => /usr/lib/libboost_python.so.2  
        libboost_python.so (libc6,x86-64) => /usr/lib64/libboost_python.so  
        libboost_python.so (libc6) => /usr/lib/libboost_python.so  

加入系统环境 :

[root@db-192-168-100-216 ~]# vi /etc/ld.so.conf.d/python2.7.conf  
/usr/local/lib  
[root@db-192-168-100-216 ~]# ldconfig   
[root@db-192-168-100-216 ~]# ldconfig -p|grep -i python  
        libpython2.7.so.1.0 (libc6,x86-64) => /usr/local/lib/libpython2.7.so.1.0  
        libpython2.7.so (libc6,x86-64) => /usr/local/lib/libpython2.7.so  
        libpython2.4.so.1.0 (libc6,x86-64) => /usr/lib64/libpython2.4.so.1.0  
        libpython2.4.so (libc6,x86-64) => /usr/lib64/libpython2.4.so  
        libboost_python.so.2 (libc6,x86-64) => /usr/lib64/libboost_python.so.2  
        libboost_python.so.2 (libc6) => /usr/lib/libboost_python.so.2  
        libboost_python.so (libc6,x86-64) => /usr/lib64/libboost_python.so  
        libboost_python.so (libc6) => /usr/lib/libboost_python.so  

现在正常了 :

[root@db-192-168-100-216 ~]# python -V  
Python 2.7.5  

安装完python2.7.5后编译PostgreSQL :

tar -jxvf postgresql-9.2.4.tar.bz2  
cd postgresql-9.2.4  
./configure --prefix=/home/pg92/pgsql9.2.4 --with-pgport=2921 --with-perl --with-tcl --with-python --with-openssl --with-pam --without-ldap --with-libxml --with-libxslt --enable-thread-safety --with-wal-blocksize=16 && gmake world && gmake install-world  

初始化, 启动数据库 :

[root@db-192-168-100-216 ~]# su - pg92  
pg92@db-192-168-100-216-> initdb -D $PGDATA -E UTF8 --locale=C -W -U postgres  
pg_ctl start  
psql  
create database digoal;  

安装madlib 1.0 :

wget http://www.madlib.net/files/madlib-1.0-Linux.rpm  
rpm -ivh madlib-1.0-Linux.rpm  

安装完后的目录在/usr/local/madlib

rpm -ql madlib  
/usr/local/madlib/.....  

将madlib安装到数据库中 :

确保psql以及python在路径中.

pg92@db-192-168-100-216-> which psql  
~/pgsql/bin/psql  
pg92@db-192-168-100-216-> which python  
/usr/local/bin/python  
pg92@db-192-168-100-216-> python -V  
Python 2.7.5  
pg92@db-192-168-100-216-> /usr/local/madlib/bin/madpack -p postgres -c postgres@127.0.0.1:2921/digoal install  

检查安装是否正确.

pg92@db-192-168-100-216-> /usr/local/madlib/bin/madpack -p postgres -c postgres@127.0.0.1:2921/digoal install-check  

madlib安装在一个名为madlib的schema中.

pg92@db-192-168-100-216-> psql  
psql (9.2.4)  
Type "help" for help.  
digoal=# \dn  
  List of schemas  
  Name  |  Owner     
--------+----------  
 madlib | postgres  
 public | postgres  
(2 rows)  

新增表和多个函数 :

digoal=# set search_path="$user",madlib,public;  
SET  
digoal=# \dt  
              List of relations  
 Schema |       Name       | Type  |  Owner     
--------+------------------+-------+----------  
 madlib | migrationhistory | table | postgres  
 madlib | training_info    | table | postgres  
(2 rows)  
digoal=# select * from migrationhistory;  
 id | version |          applied             
----+---------+----------------------------  
  1 | 1.0     | 2013-07-31 15:05:50.900619  
(1 row)  
  
digoal=# select * from training_info ;  
 classifier_name | result_table_oid | training_table_oid | training_metatable_oid | training_encoded_table_oid | validation_table_oi  
d | how2handle_missing_value | split_criterion | sampling_percentage | num_feature_chosen | num_trees   
-----------------+------------------+--------------------+------------------------+----------------------------+--------------------  
--+--------------------------+-----------------+---------------------+--------------------+-----------  
(0 rows)  

新增函数 :

digoal=# select proname from pg_proc where pronamespace=(select oid from pg_namespace where nspname='madlib') order by proname;  
                      proname                        
---------------------------------------------------  
 __array_add  
 __array_elem_in  
 __array_indexed_agg  
 __array_indexed_agg_ffunc  
 __array_indexed_agg_prefunc  
 __array_indexed_agg_sfunc  
 __array_search  
 __array_sort  
 __array_sum  
 __assert  
 __assert_table  
 __best_scv_aggr  
 __best_scv_prefunc  
 __best_scv_sfunc  
 __bigint_array_add  
 __bigint_array_sum  
 __binomial_fista_final  
 __binomial_fista_merge  
 __binomial_fista_result  
 __binomial_fista_state_diff  
 __binomial_fista_step  
 __binomial_fista_transition  
 __binomial_igd_final  
 __binomial_igd_merge  
 __binomial_igd_result  
 __binomial_igd_state_diff  
 __binomial_igd_step  
 __binomial_igd_step_single_seg  
 __binomial_igd_transition  
 __breakup_table  
 __check_dt_common_params  
 __check_training_table  
 __clustered_err_lin_final  
 __clustered_err_lin_merge  
 __clustered_err_lin_step  
 __clustered_err_lin_transition  
 __clustered_err_log_final  
 __clustered_err_log_merge  
 __clustered_err_log_step  
 __clustered_err_log_transition  
 __clustered_err_mlog_final  
 __clustered_err_mlog_merge  
 __clustered_err_mlog_step  
 __clustered_err_mlog_transition  
 __clustered_lin_compute_stats  
 __clustered_log_compute_stats  
 __clustered_mlog_compute_stats  
 __cmsketch_base64_final  
 __cmsketch_final  
 __cmsketch_int8_trans  
 __cmsketch_int8_trans  
 __cmsketch_int8_trans  
 __cmsketch_int8_trans  
 __cmsketch_merge  
 __column_exists  
 __columns_in_table  
 __compute_mlogregr  
 __create_metatable  
 __create_tree_tables  
 __csvstr_to_array  
 __delete_traininginfo  
 __display_node_sfunc  
 __display_tree_aggr  
 __display_tree_no_ordered_aggr  
 __distinct_feature_value  
 __drop_metatable  
 __dt_acc_count_aggr  
 __dt_acc_count_sfunc  
 __dt_get_node_split_fids  
 __ebp_calc_errors  
 __ebp_prune_tree  
 __elastic_net_binomial_loglikelihood  
 __encode_and_train  
 __encode_columns  
 __encode_table  
 __encode_table  
 __filter_input_relation  
 __find_best_split  
 __fmsketch_count_distinct  
 __fmsketch_merge  
 __fmsketch_trans  
 __format  
 __format  
 __format  
 __format  
 __format  
 __gaussian_fista_final  
 __gaussian_fista_merge  
 __gaussian_fista_result  
 __gaussian_fista_state_diff  
 __gaussian_fista_step  
 __gaussian_fista_transition  
 __gaussian_igd_final  
 __gaussian_igd_merge  
 __gaussian_igd_result  
 __gaussian_igd_state_diff  
 __gaussian_igd_step  
 __gaussian_igd_step_single_seg  
 __gaussian_igd_transition  
 __gen_acc  
 __gen_enc_meta_names  
 __gen_horizontal_encoded_table  
 __gen_vertical_encoded_table  
 __generate_final_tree  
 __get_class_column_name  
 __get_class_value  
 __get_classtable_name  
 __get_column_value  
 __get_encode_table_name  
 __get_feature_name  
 __get_feature_value  
 __get_features_of_nodes  
 __get_id_column_name  
 __get_metatable_name  
 __get_routine_id  
 __get_routine_name  
 __get_schema_name  
 __get_tree_table_name  
 __insert_into_metatable  
 __insert_into_traininginfo  
 __internal_get_col_names_except_dep_variable  
 __internal_get_cox_prop_hazards_insert_string  
 __internal_get_cox_prop_hazards_result  
 __internal_get_hsk_result  
 __internal_get_linreg_result  
 __internal_get_linregr_insert_string  
 __internal_get_robust_linregr_insert_string  
 __internal_get_robust_linregr_result  
 __internal_get_robust_logregr_insert_string  
 __internal_get_robust_logregr_result  
 __internal_get_robust_mlogregr_insert_string  
 __internal_linregr_train_hetero  
 __internal_mlogregr_irls_result  
 __internal_mlogregr_irls_step_distance  
 __is_valid_enc_table  
 __lda_count_topic_agg  
 __lda_count_topic_prefunc  
 __lda_count_topic_sfunc  
 __lda_gibbs_sample  
 __lda_perplexity_agg  
 __lda_perplexity_ffunc  
 __lda_perplexity_prefunc  
 __lda_perplexity_sfunc  
 __lda_random_assign  
 __lda_util_conorm_data  
 __lda_util_index_sort  
 __lda_util_norm_dataset  
 __lda_util_norm_vocab  
 __lda_util_norm_with_smoothing  
 __lda_util_transpose  
 __lda_util_unnest  
 __logregr_cg_result  
 __logregr_cg_step  
 __logregr_cg_step_distance  
 __logregr_cg_step_final  
 __logregr_cg_step_merge_states  
 __logregr_cg_step_transition  
 __logregr_igd_result  
 __logregr_igd_step  
 __logregr_igd_step_distance  
 __logregr_igd_step_final  
 __logregr_igd_step_merge_states  
 __logregr_igd_step_transition  
 __logregr_irls_result  
 __logregr_irls_step  
 __logregr_irls_step_distance  
 __logregr_irls_step_final  
 __logregr_irls_step_merge_states  
 __logregr_irls_step_transition  
 __matrix_blockize_agg  
 __matrix_blockize_sfunc  
 __matrix_column_to_array_format  
 __matrix_densify_agg  
 __matrix_densify_sfunc  
 __matrix_mem_sum  
 __matrix_mem_sum_sfunc  
 __matrix_row_split  
 __matrix_unblockize_agg  
 __matrix_unblockize_sfunc  
 __matrix_unnest_block  
 __mfvsketch_final  
 __mfvsketch_merge  
 __mfvsketch_trans  
 __mlogregr_irls_step  
 __mlogregr_irls_step_final  
 __mlogregr_irls_step_merge_states  
 __mlogregr_irls_step_transition  
 __num_of_class  
 __num_of_columns  
 __num_of_feature  
 __rand_block  
 __rand_block  
 __rand_vector  
 __regclass_to_text  
 __rep_aggr_class_count  
 __rep_aggr_class_count_ffunc  
 __rep_aggr_class_count_sfunc  
 __rep_prune_tree  
 __sample_with_replacement  
 __sample_within_range  
 __scv_aggr  
 __scv_aggr_ffunc  
 __scv_aggr_prefunc  
 __scv_aggr_sfunc  
 __sketch_array_set_bit_in_place  
 __sketch_leftmost_zero  
 __sketch_rightmost_one  
 __strip_schema_name  
 __svm_random_ind  
 __svm_random_ind2  
 __svm_target_cl_func  
 __svm_target_reg_func  
 __table_exists  
 __to_char  
 __train_tree  
 __treemodel_classify_internal  
 __treemodel_classify_internal_serial  
 __treemodel_clean  
 __treemodel_display_no_ordered_aggr  
 __treemodel_display_with_ordered_aggr  
 __treemodel_get_vote_result  
 __treemodel_score  
 __unique_string  
 __utils_var_scales_final  
 __utils_var_scales_merge  
 __utils_var_scales_result  
 __utils_var_scales_transition  
 __validate_input_table  
 __validate_metatable  
 _string_to_array  
 angle  
 argmax  
 argmax_combine  
 argmax_final  
 argmax_transition  
 array_add  
 array_agg  
 array_collapse  
 array_contains  
 array_div  
 array_dot  
 array_fill  
 array_max  
 array_mean  
 array_min  
 array_mult  
 array_of_bigint  
 array_of_float  
 array_scalar_mult  
 array_sqrt  
 array_stddev  
 array_sub  
 array_sum  
 array_sum_big  
 array_union  
 assert  
 assoc_rules  
 assoc_rules  
 avg  
 avg_vector_final  
 avg_vector_merge  
 avg_vector_transition  
 bernoulli_cdf  
 bernoulli_pmf  
 bernoulli_quantile  
 beta_cdf  
 beta_pdf  
 beta_quantile  
 big_or  
 binomial_cdf  
 binomial_pmf  
 binomial_quantile  
 bool_to_text  
 bytea8in  
 bytea8out  
 bytea8recv  
 bytea8send  
 c45_classify  
 c45_classify  
 c45_clean  
 c45_display  
 c45_display  
 c45_genrule  
 c45_genrule  
 c45_score  
 c45_score  
 c45_train  
 c45_train  
 c45_train  
 cauchy_cdf  
 cauchy_pdf  
 cauchy_quantile  
 check_if_col_exists  
 check_if_raises_error  
 chi2_gof_test  
 chi2_gof_test  
 chi2_gof_test  
 chi2_gof_test_final  
 chi2_gof_test_merge_states  
 chi2_gof_test_transition  
 chi2_gof_test_transition  
 chi2_gof_test_transition  
 chi_squared_cdf  
 chi_squared_pdf  
 chi_squared_quantile  
 closest_column  
 closest_column  
 closest_columns  
 closest_columns  
 clustered_variance_linregr  
 clustered_variance_linregr  
 clustered_variance_linregr  
 clustered_variance_linregr  
 clustered_variance_logregr  
 clustered_variance_logregr  
 clustered_variance_logregr  
 clustered_variance_logregr  
 clustered_variance_logregr  
 clustered_variance_logregr  
 clustered_variance_logregr  
 clustered_variance_logregr  
 clustered_variance_mlogregr  
 clustered_variance_mlogregr  
 clustered_variance_mlogregr  
 clustered_variance_mlogregr  
 clustered_variance_mlogregr  
 clustered_variance_mlogregr  
 clustered_variance_mlogregr  
 clustered_variance_mlogregr  
 clustered_variance_mlogregr  
 cmsketch  
 cmsketch_centile  
 cmsketch_count  
 cmsketch_depth_histogram  
 cmsketch_median  
 cmsketch_rangecount  
 cmsketch_width_histogram  
 compute_cox_prop_hazards_regr  
 compute_lincrf  
 conjugate_gradient  
 conjugate_gradient  
 correlation  
 correlation  
 correlation  
 correlation  
 cox_prop_hazards  
 cox_prop_hazards  
 cox_prop_hazards  
 cox_prop_hazards  
 cox_prop_hazards_regr  
 cox_prop_hazards_regr  
 cox_prop_hazards_regr  
 cox_prop_hazards_regr  
 cox_prop_hazards_step  
 cox_prop_hazards_step_final  
 cox_prop_hazards_step_transition  
 create_nb_classify_fn  
 create_nb_classify_fn  
 create_nb_classify_view  
 create_nb_classify_view  
 create_nb_prepared_data_tables  
 create_nb_probs_view  
 create_nb_probs_view  
 create_schema_pg_temp  
 create_table_as  
 create_table_as  
 create_temp_table_as  
 create_temp_table_as  
 create_temporary_table_as  
 create_temporary_table_as  
 crf_test_data  
 crf_test_fgen  
 crf_train_data  
 crf_train_fgen  
 cross_validation_general  
 cross_validation_general  
 cv_linregr_predict  
 cv_linregr_train  
 cv_logregr_accuracy  
 cv_logregr_predict  
 dist_angle  
 dist_norm1  
 dist_norm2  
 dist_tanimoto  
 elastic_net_binomial_predict  
 elastic_net_binomial_prob  
 elastic_net_gaussian_predict  
 elastic_net_predict  
 elastic_net_predict  
 elastic_net_train  
 elastic_net_train  
 elastic_net_train  
 elastic_net_train  
 elastic_net_train  
 elastic_net_train  
 elastic_net_train  
 elastic_net_train  
 elastic_net_train  
 elastic_net_train  
 exponential_cdf  
 exponential_pdf  
 exponential_quantile  
 extreme_value_cdf  
 extreme_value_pdf  
 extreme_value_quantile  
 f_test  
 f_test_final  
 fisher_f_cdf  
 fisher_f_pdf  
 fisher_f_quantile  
 float8arr_cast_float4  
 float8arr_cast_float8  
 float8arr_cast_int2  
 float8arr_cast_int4  
 float8arr_cast_int8  
 float8arr_cast_numeric  
 float8arr_div_float8arr  
 float8arr_div_svec  
 float8arr_eq  
 float8arr_minus_float8arr  
 float8arr_minus_svec  
 float8arr_mult_float8arr  
 float8arr_mult_svec  
 float8arr_plus_float8arr  
 float8arr_plus_svec  
 fmsketch_dcount  
 gamma_cdf  
 gamma_pdf  
 gamma_quantile  
 gen_rules_from_cfp  
 geometric_cdf  
 geometric_pmf  
 geometric_quantile  
 hetero_linregr_final  
 hetero_linregr_merge_states  
 hetero_linregr_transition  
 heteroskedasticity_test_linregr  
 hypergeometric_cdf  
 hypergeometric_pmf  
 hypergeometric_quantile  
 insert_into  
 intermediate_cox_prop_hazards  
 internal_compute_kmeans  
 internal_compute_kmeans_random_seeding  
 internal_compute_kmeanspp_seeding  
 internal_compute_lmf_igd  
 internal_cox_prop_hazards_result  
 internal_cox_prop_hazards_step_distance  
 internal_create_table_as  
 internal_execute_using_kmeans_args  
 internal_execute_using_kmeans_args  
 internal_execute_using_kmeans_random_seeding_args  
 internal_execute_using_kmeanspp_seeding_args  
 internal_execute_using_lmf_igd_args  
 internal_execute_using_silhouette_args  
 internal_lincrf_lbfgs_converge  
 internal_lincrf_lbfgs_result  
 internal_lmf_igd_distance  
 internal_lmf_igd_result  
 inverse_gamma_cdf  
 inverse_gamma_pdf  
 inverse_gamma_quantile  
 isnan  
 kmeans  
 kmeans  
 kmeans  
 kmeans  
 kmeans  
 kmeans  
 kmeans  
 kmeans  
 kmeans  
 kmeans  
 kmeans_random  
 kmeans_random  
 kmeans_random  
 kmeans_random  
 kmeans_random  
 kmeans_random_seeding  
 kmeans_random_seeding  
 kmeanspp  
 kmeanspp  
 kmeanspp  
 kmeanspp  
 kmeanspp  
 kmeanspp_seeding  
 kmeanspp_seeding  
 kmeanspp_seeding  
 kolmogorov_cdf  
 ks_test  
 ks_test_final  
 ks_test_transition  
 l1norm  
 l2norm  
 laplace_cdf  
 laplace_pdf  
 laplace_quantile  
 lda_get_perplexity  
 lda_get_topic_desc  
 lda_get_topic_word_count  
 lda_get_word_topic_count  
 lda_predict  
 lda_predict  
 lda_train  
 lincrf  
 lincrf  
 lincrf_lbfgs_step  
 lincrf_lbfgs_step_final  
 lincrf_lbfgs_step_merge_states  
 lincrf_lbfgs_step_transition  
 linregr  
 linregr_final  
 linregr_merge_states  
 linregr_predict  
 linregr_train  
 linregr_train  
 linregr_train  
 linregr_transition  
 lmf_igd_final  
 lmf_igd_merge  
 lmf_igd_run  
 lmf_igd_run  
 lmf_igd_run  
 lmf_igd_run  
 lmf_igd_run  
 lmf_igd_step  
 lmf_igd_transition  
 logistic  
 logistic_cdf  
 logistic_pdf  
 logistic_quantile  
 lognormal_cdf  
 lognormal_pdf  
 lognormal_quantile  
 logregr_accuracy  
 logregr_predict  
 logregr_train  
 logregr_train  
 logregr_train  
 logregr_train  
 logregr_train  
 logregr_train  
 lsvm_classification  
 lsvm_classification  
 lsvm_predict  
 lsvm_predict_batch  
 lsvm_predict_combo  
 lsvm_sgd_agg  
 lsvm_sgd_update  
 marginal_logregr  
 marginal_logregr_step_final  
 marginal_logregr_step_merge_states  
 marginal_logregr_step_transition  
 marginal_mlogregr  
 margins_logregr  
 margins_logregr  
 margins_logregr  
 margins_logregr  
 margins_logregr  
 margins_logregr  
 margins_logregr  
 margins_logregr  
 margins_logregr  
 margins_mlogregr  
 margins_mlogregr  
 margins_mlogregr  
 margins_mlogregr  
 margins_mlogregr  
 margins_mlogregr  
 margins_mlogregr  
 margins_mlogregr  
 margins_mlogregr  
 margins_mlogregr  
 matrix_agg  
 matrix_agg_final  
 matrix_agg_transition  
 matrix_block_mult  
 matrix_block_square  
 matrix_block_trans  
 matrix_blockize  
 matrix_column  
 matrix_densify  
 matrix_mem_mult  
 matrix_mem_mult  
 matrix_mem_trans  
 matrix_mult  
 matrix_mult  
 matrix_sparsify  
 matrix_square  
 matrix_trans  
 matrix_trans  
 matrix_unblockize  
 mean  
 mfvsketch_quick_histogram  
 mfvsketch_top_histogram  
 mlogregr  
 mlogregr  
 mlogregr  
 mlogregr  
 mlogregr_marginal_step_final  
 mlogregr_marginal_step_merge_states  
 mlogregr_marginal_step_transition  
 mlogregr_robust_step_final  
 mlogregr_robust_step_merge_states  
 mlogregr_robust_step_transition  
 mse_error  
 mw_test  
 mw_test_final  
 mw_test_transition  
 negative_binomial_cdf  
 negative_binomial_pmf  
 negative_binomial_quantile  
 non_central_beta_cdf  
 non_central_beta_pdf  
 non_central_beta_quantile  
 non_central_chi_squared_cdf  
 non_central_chi_squared_pdf  
 non_central_chi_squared_quantile  
 non_central_f_cdf  
 non_central_f_pdf  
 non_central_f_quantile  
 non_central_t_cdf  
 non_central_t_pdf  
 non_central_t_quantile  
 noop  
 norm1  
 norm2  
 normal_cdf  
 normal_cdf  
 normal_cdf  
 normal_pdf  
 normal_pdf  
 normal_pdf  
 normal_quantile  
 normal_quantile  
 normal_quantile  
 normalize  
 normalize  
 normalized_avg  
 normalized_avg_vector_final  
 normalized_avg_vector_transition  
 one_way_anova  
 one_way_anova_final  
 one_way_anova_merge_states  
 one_way_anova_transition  
 pareto_cdf  
 pareto_pdf  
 pareto_quantile  
 poisson_cdf  
 poisson_pmf  
 poisson_quantile  
 profile  
 profile_full  
 quantile  
 quantile_big  
 rayleigh_cdf  
 rayleigh_pdf  
 rayleigh_quantile  
 relative_error  
 relative_error  
 rf_classify  
 rf_classify  
 rf_classify  
 rf_clean  
 rf_display  
 rf_display  
 rf_display  
 rf_score  
 rf_score  
 rf_train  
 rf_train  
 robust_input_checking  
 robust_linregr  
 robust_linregr_final  
 robust_linregr_merge_states  
 robust_linregr_transition  
 robust_logregr  
 robust_logregr_step_final  
 robust_logregr_step_merge_states  
 robust_logregr_step_transition  
 robust_mlogregr  
 robust_variance_linregr  
 robust_variance_linregr  
 robust_variance_linregr  
 robust_variance_linregr  
 robust_variance_logregr  
 robust_variance_logregr  
 robust_variance_logregr  
 robust_variance_logregr  
 robust_variance_logregr  
 robust_variance_logregr  
 robust_variance_logregr  
 robust_variance_logregr  
 robust_variance_mlogregr  
 robust_variance_mlogregr  
 robust_variance_mlogregr  
 robust_variance_mlogregr  
 robust_variance_mlogregr  
 robust_variance_mlogregr  
 robust_variance_mlogregr  
 robust_variance_mlogregr  
 robust_variance_mlogregr  
 simple_silhouette  
 simple_silhouette  
 squared_dist_norm2  
 students_t_cdf  
 students_t_pdf  
 students_t_quantile  
 summary  
 summary  
 summary  
 summary  
 summary  
 summary  
 summary  
 summary  
 summary  
 summary  
 svdmf_run  
 svdmf_run  
 svec_agg  
 svec_append  
 svec_cast_float4  
 svec_cast_float8  
 svec_cast_float8arr  
 svec_cast_int2  
 svec_cast_int4  
 svec_cast_int8  
 svec_cast_numeric  
 svec_cast_positions_float8arr  
 svec_change  
 svec_concat  
 svec_concat_replicate  
 svec_contains  
 svec_count  
 svec_count_nonzero  
 svec_dimension  
 svec_div  
 svec_div_float8arr  
 svec_dmax  
 svec_dmin  
 svec_dot  
 svec_dot  
 svec_dot  
 svec_dot  
 svec_elsum  
 svec_elsum  
 svec_eq  
 svec_eq_non_zero  
 svec_from_string  
 svec_hash  
 svec_in  
 svec_l1norm  
 svec_l1norm  
 svec_l2_cmp  
 svec_l2_eq  
 svec_l2_ge  
 svec_l2_gt  
 svec_l2_le  
 svec_l2_lt  
 svec_l2_ne  
 svec_l2norm  
 svec_l2norm  
 svec_lapply  
 svec_log  
 svec_mean_final  
 svec_mean_prefunc  
 svec_mean_transition  
 svec_median  
 svec_median  
 svec_median_inmemory  
 svec_minus  
 svec_minus_float8arr  
 svec_mult  
 svec_mult_float8arr  
 svec_nonbase_positions  
 svec_nonbase_values  
 svec_out  
 svec_pivot  
 svec_plus  
 svec_plus_float8arr  
 svec_pow  
 svec_proj  
 svec_recv  
 svec_return_array  
 svec_reverse  
 svec_send  
 svec_sfv  
 svec_sort  
 svec_subvec  
 svec_sum  
 svec_to_string  
 svec_unnest  
 svm_classification  
 svm_classification  
 svm_cls_agg  
 svm_cls_update  
 svm_data_normalization  
 svm_dot  
 svm_drop_model  
 svm_gaussian  
 svm_generate_cls_data  
 svm_generate_nd_data  
 svm_generate_reg_data  
 svm_nd_agg  
 svm_nd_update  
 svm_novelty_detection  
 svm_novelty_detection  
 svm_polynomial  
 svm_predict  
 svm_predict  
 svm_predict_batch  
 svm_predict_combo  
 svm_predict_sub  
 svm_reg_agg  
 svm_reg_update  
 svm_regression  
 svm_regression  
 svm_store_model  
 t_test_merge_states  
 t_test_one  
 t_test_one_final  
 t_test_one_transition  
 t_test_two_pooled  
 t_test_two_pooled_final  
 t_test_two_transition  
 t_test_two_unpooled  
 t_test_two_unpooled_final  
 tanimoto_distance  
 triangular_cdf  
 triangular_pdf  
 triangular_quantile  
 uniform_cdf  
 uniform_pdf  
 uniform_quantile  
 utils_normalize_data  
 utils_var_scales  
 vcrf_label  
 vcrf_top1_label  
 vcrf_top1_view  
 version  
 weibull_cdf  
 weibull_pdf  
 weibull_quantile  
 weighted_sample  
 weighted_sample  
 weighted_sample_final_int64  
 weighted_sample_final_vector  
 weighted_sample_merge_int64  
 weighted_sample_merge_vector  
 weighted_sample_transition_int64  
 weighted_sample_transition_vector  
 wsr_test  
 wsr_test  
 wsr_test_final  
 wsr_test_transition  
 wsr_test_transition  
(857 rows)  

具体用法本文不做介绍.

参考

1. http://www.mil-oss.org/

2. http://db.cs.berkeley.edu/papers/vldb09-madskills.pdf

3. https://github.com/madlib/madlib/wiki/Installation-Guide

4. http://www.pgcon.org/2012/schedule/events/404.en.html

5. http://doc.madlib.net/v1.0/index.html

6. http://madlib.net/

7. http://devdoc.madlib.net/master/

8. http://www.eecs.berkeley.edu/Pubs/TechRpts/2012/EECS-2012-38.pdf

9. http://db.cs.berkeley.edu/papers/vldb09-madskills.pdf

Flag Counter

digoal’s 大量PostgreSQL文章入口