function [mean_value,var_value,rmse_value] = SVM_regression(train_data,test_data,n_train_datapoints,n_train_classes,test_class_values,n_test_datapoints,kernel,c_value,epsilon_value,gamma_value,train_label_values)
    %Assigning labels
    i = 1;
    while(i <= n_train_classes)
        label((i-1)*n_train_datapoints+1:(i)*n_train_datapoints) = train_label_values(i)*ones(n_train_datapoints,1);
        i = i + 1;
    end
    label = label';
    
    %SVM Regression paramters
    r1 = strcmp(kernel,'rbf');
    r2 = strcmp(kernel,'linear');    
    if(r2 == 1)
        options = ['-s 3 ',' -t 0 ',' -c ',num2str(2^c_value),' -p ',num2str(epsilon_value)];
    end
    if(r1 == 1)
        options = ['-s 3 ',' -t 2 ',' -g ',num2str(2^gamma_value),' -c ',num2str(2^c_value),' -p ',num2str(epsilon_value)];
    end
    %SVM Regression model and prediction. 
    model = svmtrain(label,train_data, options);
    size_test = size(test_data);
    [predicted_label, accuracy, decision_values] = svmpredict(zeros(size_test(1),1), test_data, model);
    %Prediction results
    mean_value = 0;
    var_value = 0;
    rmse_value = 0;
    i = 1;
    while(i <= length(test_class_values))
        mean_value(i) = mean(decision_values((i-1)*n_test_datapoints+1:i*n_test_datapoints));
        var_value(i) = var(decision_values((i-1)*n_test_datapoints+1:i*n_test_datapoints));
        rmse_value(i) = sqrt(((decision_values((i-1)*n_test_datapoints+1:i*n_test_datapoints)-test_class_values(i))'*(decision_values((i-1)*n_test_datapoints+1:i*n_test_datapoints)-test_class_values(i)))/n_test_datapoints);
        i = i + 1;
    end
end