| /* ----------------------------------------------------------------------- *//** |
| * |
| * Licensed to the Apache Software Foundation (ASF) under one |
| * or more contributor license agreements. See the NOTICE file |
| * distributed with this work for additional information |
| * regarding copyright ownership. The ASF licenses this file |
| * to you under the Apache License, Version 2.0 (the |
| * "License"); you may not use this file except in compliance |
| * with the License. You may obtain a copy of the License at |
| * |
| * http://www.apache.org/licenses/LICENSE-2.0 |
| * |
| * Unless required by applicable law or agreed to in writing, |
| * software distributed under the License is distributed on an |
| * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| * KIND, either express or implied. See the License for the |
| * specific language governing permissions and limitations |
| * under the License. |
| * |
| *//* ----------------------------------------------------------------------- */ |
| |
| /* ----------------------------------------------------------------------------- |
| * PCA Install Check. |
| * -------------------------------------------------------------------------- */ |
| |
| DROP TABLE IF EXISTS mat; |
| CREATE TABLE mat ( |
| row_id integer, |
| row_vec double precision[] |
| ); |
| |
| COPY mat (row_id, row_vec) FROM stdin delimiter '|'; |
| 1|{396,84,1} |
| 2|{691,58,1} |
| 3|{293,1,1} |
| \. |
| |
| drop table if exists result_table_214712398172490837; |
| drop table if exists result_table_214712398172490837_mean; |
| drop table if exists result_table_214712398172490838; |
| select pca_train('mat', 'result_table_214712398172490837', 'row_id', 3, |
| NULL, 3, FALSE, 'result_table_214712398172490838'); |
| select * from result_table_214712398172490837; |
| select * from result_table_214712398172490838; |
| |
| drop table if exists result_table_214712398172490837; |
| drop table if exists result_table_214712398172490837_mean; |
| drop table if exists result_table_214712398172490838; |
| select pca_train('mat', 'result_table_214712398172490837', 'row_id', 0.8, |
| NULL, 3, FALSE, 'result_table_214712398172490838'); |
| select * from result_table_214712398172490837; |
| select * from result_table_214712398172490838; |