@prefix ccdm: <http://cookingbigdata.com/linkeddata/ccdm#> .
@prefix rdf: 		<http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: 		<http://www.w3.org/2000/01/rdf-schema#> .
@prefix owl: 		<http://www.w3.org/2002/07/owl#> .
@prefix foaf: 		<http://xmlns.com/foaf/0.1/> .
@prefix dc:			<http://purl.org/dc/terms/> .
@prefix xsd: 		<http://www.w3.org/2001/XMLSchema#> .
@prefix cc: 		<http://creativecommons.org/ns#> .
@prefix mls: <http://www.w3.org/ns/mls#> .

<http://example.org/cc/MLService#KMeansClustering> a ccdm:MLFunction;	
	dc:created "2017-04-20" ;
	dc:creator "Manuel Parra, Ruben Castro, J. Antonio Cortes" ;
	dc:title "KMeansClustering" ;
	dc:description "The data given by x are clustered by the k-means method, which aims to partition the points into k groups such that the sum of squares from points to the assigned cluster centres is minimized. At the minimum, all cluster centres are at the mean of their Voronoi sets (the set of data points which are nearest to the cluster centre)." ;
	dc:modified "2018-05-20" ;
	dc:publisher "DICITS_ML" ;
    ccdm:hasInputParameters _:KMeansClustering_Service_InputParameters ;
    mls:hasInput _:KMeansClustering_Service_Input ;
    mls:hasOutput _:KMeansClustering_Service_Output	
	.
	
_:KMeansClustering_Service_Input a ccdm:MLServiceInput ;
    ccdm:contains _:contains_dataset_01 ;
    dc:description "Input data contains Dataset or Feature/s" ;
    dc:title "InputDataSet" 
	.	

_:contains_dataset_01 a ccdm:contains ;
    mls:Data _:dataset_01 
	.

_:dataset_01  a mls:DataSet ;
    ccdm:format _:ParameterFormat_CVS_00 ;
    ccdm:mandatory "true" ;
    ccdm:storagebucket "dicits://" ;
    dc:description "Dataset on which the service is applied" ;
    dc:title "DataSet" 
	.

_:ParameterFormat_CVS_00 a ccdm:csv ;
	dc:description "CSV Source file format" 
	.

_:KMeansClustering_Service_Output a ccdm:MLServiceOutput ;
    dc:description "Output of the service contains Model or ModelEvaluation or Data" ;
    mls:Model _:KMeansClustering_Model ;
    mls:ModelEvaluation _:KMeansClustering_ModelEvaluation 
	.

_:KMeansClustering_Model a ccdm:PMML_Model ;
    ccdm:storagebucket "dicits://models/" ;
    dc:description "PMML model to represent mining models" ;
    dc:title "PMML Model related" 
	.

_:KMeansClustering_ModelEvaluation a ccdm:ModelEvaluation ;
    ccdm:storagebucket "dicits://modelevaluation/" ;
    dc:description "Model Evaluation" ;
    dc:title "Model evaluation" 
	.


_:KMeansClustering_Service_InputParameters a ccdm:MLServiceInputParameters;
	dc:description "Input Parameters" ;
	dc:title "Input" ;    
	ccdm:Parameters _:response_parameter_01,
	                _:response_parameter_02,
                    _:response_parameter_03;
	.
	
_:response_parameter_01 a ccdm:MLServiceInputParameter ;
	ccdm:defaultvalue "" ;
    ccdm:mandatory "true" ;
    dc:description "numeric matrix of data, or an object that can be coerced to such a matrix (such as a numeric vector or a data frame with all numeric columns)." ;
    dc:title "x"
	.
	
_:response_parameter_02 a ccdm:MLServiceInputParameter ;
	ccdm:defaultvalue "3" ;
    ccdm:mandatory "true" ;
    dc:description "either the number of clusters, say k, or a set of initial (distinct) cluster centres. If a number, a random set of (distinct) rows in x is chosen as the initial centres." ;
    dc:title "centers" 
	.

_:response_parameter_03 a ccdm:MLServiceInputParameter ;
	ccdm:defaultvalue "1000" ;
    ccdm:mandatory "optional" ;
    dc:description "the maximum number of iterations allowed." ;
    dc:title "iter__max" 
	.
