Learn R Programming

fsr (version 1.0.0)

spa_creator: Building pgeometry objects from a point dataset

Description

This function builds a set of spatial plateau objects from a given point dataset assigned with domain-specific numerical values.

Usage

spa_creator(tbl, fuzz_policy = "fsp", const_policy = "voronoi", ...)

Arguments

tbl

A data.frame or tibble with the following format: (x, y, z)

fuzz_policy

The fuzzification policy to be employed by the algorithm. See details below.

const_policy

The construction policy to be used by the algorithm. See details below.

...

<dynamic-dots> Parameters for the chosen policies. See details below.

Value

A tibble in the format (class, pgeometry), where class is a character column and pgeometry is a list of pgeometry objects. This means that a spatial plateau object is created for representing a specific class of the point dataset.

Details

It follows the two-stage construction systematic approach described in the research paper of reference.

The input tbl is a point dataset where each point represents the location of a phenomenon treated by the application. Further, each point is annotated with numerical data that describe its meaning in the application. Therefore, tbl must have three columns: x, y for the locations, and z for the domain-specific numeric values.

fuzz_policy refers to the method used by the fuzzification stage. This stage aims to assign membership degrees to each point of the dataset. It accepts two possible values only: either "fsp" (default) or "fcp".

"fsp" stands for fuzzy set policy and requires two parameters that should be informed in ...:

  • classes: A character vector containing the name of classes

  • mfs: A vector of membership functions generated by the function genmf of FuzzyR package. Each membership function i represents the class i, where i in length(classes)

"fcp" stands for fuzzy clustering policy and requires the e1071 package. Its possible parameters, informed in ..., are:

  • k: A numeric value that refers to the number of groups to be created

  • method: A fuzzy clustering method of the package e1071, which can be either "cmeans" (default) or "cshell"

  • use_coords: A Boolean value to indicate whether the columns (x, y) should be used in the clustering algorithm (default is FALSE)

  • iter: A numeric indicating the number of maximum iterations of the clustering algorithm (default is 100)

const_policy refers to the method used by the construction stage. This stage aims to create polygons from the labeled point dataset and use them to build spatial plateau objects. It accepts two possible values only: either "voronoi" (default) or "delaunay".

"voronoi" stands for Voronoi diagram policy and has one optional parameter that can be provided in ...:

  • base_poly: An sfg object that will be used to clip the generated polygons (optional argument). If this parameter is not provided, the Voronoi is created by using a bounding box (standard behavior of sf).

"delaunay" stands for Delaunay triangulation policy, which accepts the following parameters in ...:

  • base_poly: An sfg object that will be used to clip the generated triangles (optional argument).

  • tnorm: A t-norm used to calculate the membership degree of the triangle. It should be the name of a vector function. Possible values are "min" (default), and "prod". Note that it is possible to use your own t-norms. A t-norm should has the following signature: FUN(x) where

  • x is a numeric vector. Such a function should return a single numeric value.

References

Carniel, A. C.; Schneider, M. A Systematic Approach to Creating Fuzzy Region Objects from Real Spatial Data Sets. In Proceedings of the 2019 IEEE International Conference on Fuzzy Systems (FUZZ-IEEE 2019), pp. 1-6, 2019.

Examples

Run this code
# NOT RUN {
library(tibble)
library(FuzzyR)

set.seed(7)
tbl = tibble(x = runif(10, min= 0, max = 30), 
             y = runif(10, min = 0, max = 50), 
             z = runif(10, min = 0, max = 100))
classes <- c("cold", "hot")
cold_mf <- genmf("trapmf", c(0, 10, 20, 35))
hot_mf <- genmf("trimf", c(35, 50, 100))

spa_creator(tbl, classes = classes, mfs = c(cold_mf, hot_mf))

spa_creator(tbl, fuzz_policy = "fcp", k = 4)

spa_creator(tbl, fuzz_policy = "fcp", k = 3, const_policy = "delaunay")

spa_creator(tbl, fuzz_policy = "fcp", const_policy = "delaunay", k = 3, tnorm = "prod")

# }

Run the code above in your browser using DataLab