Skip to content

Latest commit

 

History

History
17 lines (17 loc) · 1.31 KB

README.md

File metadata and controls

17 lines (17 loc) · 1.31 KB

clusterpmml

A C# Library for Deploying PMML Clutering Model This is a library for deploying and scoring Clutering model PMML v4.2 implemented in IBM SPSS Modeler software. With this library you can implement a model in software, export the PMML file and deploy the model in your own application.

How to Use

In your application code, you construct a ClusterModel object with path of proper PMML file:

ClusterModel model = new ClusterModel("E:/K-Means.xml");

Then, you should create a dictionary for your data input:

Dictionary<string, object> input = new Dictionary<string, object>();
input.Add("value", 42.712);
input.Add("pmethod", "CHEQUE");
input.Add("sex", "M");
input.Add("homeown", "NO");
input.Add("income", 27000);
input.Add("age", 46);

And finally DetectCluster function returns you a dictionay with cluster number as key and distance to that cluster center as value:

Dictionary<string, double> cluster = model.DetectCluster(input);