@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#LinearRegression> a ccdm:MLFunction;	
	dc:created "2017-04-20" ;
	dc:creator "Manuel Parra, Ruben Castro, J. Antonio Cortes" ;
	dc:title "Linear Regression" ;
	dc:description "Linear regression is an approach for modeling the relationship between a scalar dependent variable y and one or more explanatory variables (or independent variables) denoted X. The case of one explanatory variable is called simple linear regression." ;
	dc:modified "2018-05-20" ;
	dc:publisher "DICITS_ML" ;
    ccdm:hasInputParameters _:LinearRegression_Service_InputParameters ;
    mls:hasInput _:LinearRegression_Service_Input ;
    mls:hasOutput _:LinearRegression_Service_Output	
	.
	
_:LinearRegression_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 ccdm: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" 
	.

_:LinearRegression_Service_Output a ccdm:MLServiceOutput ;
    dc:description "Output of the service contains Model or ModelEvaluation or Data" ;
    mls:Model _:LinearRegression_Model ;
    mls:ModelEvaluation _:LinearRegression_ModelEvaluation 
	.

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

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


_:LinearRegression_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_04 ;
	.
	
_:response_parameter_01 a ccdm:MLServiceInputParameter ;
    ccdm:defaultvalue "" ;
    ccdm:mandatory "true" ;
    dc:description "Response variable and Formulae" ;
    dc:title "formula" 
	.
	
_:response_parameter_02 a ccdm:MLServiceInputParameter ;
    ccdm:defaultvalue "NULL" ;
    ccdm:mandatory "optional" ;
    dc:description "Optional vector specifying a subset of observations to be used in the fitting process" ;
    dc:title "subset" .

_:response_parameter_03 a ccdm:MLServiceInputParameter ;
    ccdm:defaultvalue "na.remove" ;
    ccdm:mandatory "optional" ;
    dc:description "A function which indicates what should happen when the data contain NAs" ;
    dc:title "na__action" .

_:response_parameter_04 a ccdm:MLServiceInputParameter ;
    ccdm:defaultvalue "NULL" ;
    ccdm:mandatory "optional" ;
    dc:description "Optional vector of weights to be used in the fitting process. If non-NULL, weighted least squares is used with weights weights (that is, minimizing sum(w*e^2)); otherwise ordinary least squares is used" ;
    dc:title "weights" .