Association Rules: Add check for support and confidence

Jira: MADLIB-442 MADLIB-443
Association Rules: Make the result stable

Jira: MADLIB-461 MADLIB-449

We use the MADLIB_SCHEMA.svec_to_string(svec) as a unique identifier for a svec, so
that the results are stable now.  According to the definition of support and confidence,
the support and confidence of the generated association rules should be >= give values
rather than >.  We also fix that. Furthurmore, we remove the dead code of the
implementation.
Association Rules: Avoid hash aggregate on svec

Jira: MADLIB-416

GPDB apparently chooses hash aggregate although svec doesn't support it.
Use text type to make the plan correct.
Quantile: Beautify code format

Replace all tabs with 4 spaces. Using 4 spaces as indent character
other than tabs.
Quantile: Suppress integer overflow

Jira: MADLIB-601

quantile_big used INT/FLOAT to store the number of rows in the table.
If the number of rows in the table exceeds 2^31, the integer will
overflow.  At the same time, cast count(*) to FLOAT may cause issues.

To fix it, we use INT8 to store the number of rows in the table.
Doxygen: linregr
k-means: Replace row_number() for scalability

Jira: MADLIB-643

Because we don't need continous values for the id, we replace row_number()
with serial data type to enhance scalability.
Association Rules: Rewrite Apriori for performance improvement

Jira: MADLIB-462 MADLIB-475 MADLIB-638

After studying the current implementation of Apriori, we found the following
issues:

1) The result was unstable, since it used the hash key to unique identify a
   svec.  As we know, two svecs may have the same hash key.  Therefore, we
   will not use the hash key.
2) There were a lot cross joins.  Actually, we can use inner join to do the
   same thing as the cross join did.  The cross join was making the process
   anti-scalable.
3) It was changing the sparse vector in many place, which caused the memory
   issues.  Now, we don't change the svec.  We just construct the svec and
   then do some operations(such as minus, multiply, etc) on that.
4) It used PLPGSQL to implement the algorithm, including aggregate function.

Based on the above analysis, we rewrite it. We use PLPYTHON and C++ AL to
address these.

Although we add code in UDF class for SRF, it is still pretty premature.
It has a lot of spaces to redesign for general purpose.
k-means: Check uniqueness of user-provided IDs

Jira: MADLIB-649
Madpack: Add pg_catalog prefix to version() call

Jira: MADLIB-473

Users may have search_path with madlib, public and madpack gets confused
when calling version() function.  Add pg_catalog prefix to make sure it's
the one in the platform.
k-means: Improve performance with array

Jira: MADLIB-454

It seems sparse vector was the bottleneck of the scalability.  We see 10
times faster in some of our use cases by using arrays instead of sparse
vectors.  Although we still have concerns around space efficiency, we
saw the arrays are also packed enough by the compression and toast mechanism.
Let's see by having this fix if our test cases verify the improvement.
 SVM: Limit the number of features in the training table

Jjra: MADLIB-602

If the number of features of a dataset is greater than 102400, then we will
report error.  This is due to the current implementation with array, which
has 1G size limit per datum.  If the table is empty, we will report an error,
too.
Build System: Remove GREENPLUM from m4_ifdef macro

Jira: MADLIB-639
New Method: Add linear-chain conditional random field for NLP

Jira: MADLIB-647

This is the addition of CRF on top of the existing Viterbi module.  The design
document still has some space to be improved, but hope additional work on it
in the future.
Association Rules: Disable in GPDB4.0

Jira: MADLIB-661

Comment out the 'assoc_rule' from src/ports/greenplum/4.0/config/Modules.yml,
as it's now using array_agg() which is not supported in GPDB 4.0.  We hope
to support this again by replacing array_agg() with our implementation in the
near future.
New k-means implementation, rewritten as an iteratively called aggregate function

Jira: MADLIB-522, MADLIB-585

k-Means:
- Complete redesign and rewrite. Main new features: 1) The new implementation is nothing more but an iteratively called aggregate function. No conversion between temporary tables and iteration states takes place. 2) The distance metric is fully pluggable. 3) Clear separation between the seeding algorithm and Lloyd's local search heuristic 4) The new code should be much easier to read and maintain
- Uses C++ AL
- First incarnation of general Python abstraction layer (currently still in kmeans.py, though). Main feature: No data movement between backend and PL/Python.

Utilities:
- Implemented a C function exec_sql_using() that can be used to emulate the EXECUTE ... USING command that is not available before PostgreSQL 8.4. This seems to be the only "guaranteed lossless" way to write function arguments into a table.
k-Means: Modularized recentering

Jira: MADLIB-522, MADLIB-586

Linear Algebra:
- Added the avg_vector UDA that computes the average of a set of vectors

k-means:
- Removed the internal kmeans_step aggregate. Instead, kmeans now asks for an aggregate function that calculates the mean, given a set of vectors.
- Added UDFs for simulating default arguments

Other changes:
- Renamed C file containing code for exec_sql_using()
- Added verbose mode to Python IterationController
k-means: Minor changes in SQL/Python code to reflect changes in design document

Jira: None

Changes:
- In the k-means SQL/Python code, replaced "col_" by "expr_", because users are
  not limited to passing column names but any expression that has the correct
  type.
- Fixed a compiler warning in avg_vector.cpp.
Vector operations: Added "distances" and normalized average

Jira: MADLIB-522, MADLIB-532

List of changes:

Vector operations:
- New functions: "sqaured_angle" and "squared_tanimoto"
- Added a UDA "normalized_avg"
- Changed UDA "avg_vector" to "avg".
- New unit tests

k-Means:
- Parameters "fn_squared_dist" and "agg_mean" now of type TEXT, so that
  specifying overloaded functions is easier and does not require passing a
  regprocedure value any more
k-Means: Verify that function parameters have correct signature

Jira: MADLIB-522