neighborhood {ECoL}  R Documentation 
Classification task. The Neighborhood measures analyze the neighborhoods of the data items and try to capture class overlapping and the shape of the decision boundary. They work over a distance matrix storing the distances between all pairs of data points in the dataset.
neighborhood(...)
## Default S3 method:
neighborhood(x, y, measures = "all",
summary = c("mean", "sd"), ...)
## S3 method for class 'formula'
neighborhood(formula, data, measures = "all",
summary = c("mean", "sd"), ...)
... 
Not used. 
x 
A data.frame contained only the input attributes. 
y 
A factor response vector with one label for each row/component of x. 
measures 
A list of measures names or 
summary 
A list of summarization functions or empty for all values. See
summarization method to more information. (Default:

formula 
A formula to define the class column. 
data 
A data.frame dataset contained the input attributes and class. 
The following measures are allowed for this method:
Fraction of borderline points (N1) computes the percentage of vertexes incident to edges connecting examples of opposite classes in a Minimum Spanning Tree (MST).
Ratio of intra/extra class nearest neighbor distance (N2) computes the ratio of two sums: intraclass and interclass. The former corresponds to the sum of the distances between each example and its closest neighbor from the same class. The later is the sum of the distances between each example and its closest neighbor from another class (nearest enemy).
Error rate of the nearest neighbor (N3) classifier corresponds to the error rate of a one Nearest Neighbor (1NN) classifier, estimated using a leaveoneout procedure in dataset.
Nonlinearity of the nearest neighbor classifier (N4) creates a new dataset randomly interpolating pairs of training examples of the same class and then induce a the 1NN classifier on the original data and measure the error rate in the new data points.
Fraction of hyperspheres covering data (T1) builds hyperspheres centered at each one of the training examples, which have their radios growth until the hypersphere reaches an example of another class. Afterwards, smaller hyperspheres contained in larger hyperspheres are eliminated. T1 is finally defined as the ratio between the number of the remaining hyperspheres and the total number of examples in the dataset.
Local Set Average Cardinality (LSC) is based on Local Set (LS) and defined as the set of points from the dataset whose distance of each example is smaller than the distance from the exemples of the different class. LSC is the average of the LS.
A list named by the requested neighborhood measure.
Albert OrriolsPuig, Nuria Macia and Tin K Ho. (2010). Documentation for the data complexity library in C++. Technical Report. La Salle  Universitat Ramon Llull.
Enrique Leyva, Antonio Gonzalez and Raul Perez. (2014). A Set of Complexity Measures Designed for Applying MetaLearning to Instance Selection. IEEE Transactions on Knowledge and Data Engineering 27, 2, 354–367.
Other complexitymeasures: balance
,
correlation
, dimensionality
,
linearity
, network
,
overlapping
, smoothness
## Extract all neighborhood measures for classification task
data(iris)
neighborhood(Species ~ ., iris)