This example assumes the td_analyze function is installed in a database named val_user.
The resulting model in table cust_analysis_clusters scores the customer_analysis table, producing score table cust_analysis_data.
call td_analyze ( 'kmeansscore', 'database = val_source; tablename = customer_analysis; outputdatabase = val_results; outputtablename = cust_analysis_data; index = cust_id; modeldatabase = val_user; modeltablename = cust_analysis_clusters; operatordatabase = val_user; samplescoresize = 10; retain = city_name, state_code; clustername = mycluster; fallback = true;' );
Sample of Scored Rows
Explanation of column names:
- mycluster: Contains cluster number of users
- cust_id: Index column
- city_name and state_code: Retained columns
mycluster | cust_id | city_name | state_code |
---|---|---|---|
2 | 1363413 | Jacksonville | FL |
2 | 1363433 | Albuquerque | NM |
2 | 1362586 | Norfolk | VA |
2 | 1362855 | Corpus Christi | TX |
2 | 1363053 | Baltimore | MD |
2 | 1363196 | Los Angeles | CA |
1 | 1363018 | Phoenix | AZ |
3 | 1363167 | Newark | NJ |
2 | 1363428 | Indianapolis | IN |
2 | 1362876 | Birmingham | AL |