Description Usage Arguments Details Value Author(s) References See Also Examples
Frequency polygons are graphics to reveal the shapes of data distributions as histograms do. The peaks of frequency polygons are required in several data mining applications. findpolypeaks
finds the peaks in a frequency polygon by using the frequencies and middles values of the classes of it.
1 | findpolypeaks(xm, xc, tcmethod, tc)
|
xm |
a numeric vector contains the middle values of the classes of the frequency polygon (or the bins of a histogram). |
xc |
an integer vector contains the frequencies of the classes of the frequency polygon. |
tcmethod |
a string represents the threshold method to discard the empty and the small bins whose frequencies are smaller than a threshold frequency value. Default method is usr. Alternatively, the methods given below can be used to compute a threshold frequency value using the descriptive statistics of the frequencies in
|
tc |
an integer which is used as the threshold frequency value for discarding the empty and small height classes in the frequency polygon. Default value is 1 if the threshold option usr is chosen. Depending on the selected methods, the value of
|
The peaks are determined after removing the empty and small height classes whose frequencies are below the chosen threshold frequency. Default threshold value is 1 that means that all the classes which have frequencies of 0 and 1 are removed in the input vectors xm
and xc
.
pm |
a data frame with two columns which are pvalues and pfreqs containing the middle values and frequencies of the peaks which determined in the frequency polygon, respectively. |
np |
an integer representing the number of peaks in the frequency polygon. |
Zeynel Cebeci, Cagatay Cebeci
Cebeci, Z. & Cebeci, C. (2018). "A novel technique for fast determination of K in partitioning cluster analysis", Journal of Agricultural Informatics, 9(2), 1-11. doi: 10.17700/jai.2018.9.2.442.
Cebeci, Z. & Cebeci, C. (2018). "kpeaks: An R Package for Quick Selection of K for Cluster Analysis", In 2018 International Conference on Artificial Intelligence and Data Processing (IDAP), IEEE. doi: 10.1109/IDAP.2018.8620896.
findk
,
genpolygon
,
rmshoulders
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | data(x5p4c)
# Using a user-specified number of bins, build the frequency polygon of p2 in the data set x5p4c
hvals <- genpolygon(x5p4c$p2, binrule="usr", nbins=20)
plotpolygon(x5p4c$p2, nbins=hvals$nbins, ptype="ph")
# Find the peaks in the frequency polygon by using the threshold method min
resfpp1 <- findpolypeaks(hvals$mids, hvals$freqs, tcmethod="min")
print(resfpp1)
# Find the peaks in the frequency polygon by using the threshold equals to 5
resfpp2 <- findpolypeaks(hvals$mids, hvals$freqs, tcmethod="usr", tc=5)
print(resfpp2)
data(iris)
# By using Doane rule, build the frequency polygon of the 4th feature in the data set iris
hvals <- genpolygon(iris[,4], binrule="doane")
plotpolygon(iris[,4], nbins=hvals$nbins, ptype="p")
#Find the peaks in the frequency polygon by using the threshold method avg
resfpp3 <- findpolypeaks(hvals$mids, hvals$freqs, tcmethod="avg")
print(resfpp3)
|
$pm
pvalues pfreqs
[1,] 37.5 38
[2,] 57.5 39
[3,] 77.5 42
[4,] 97.5 50
$np
[1] 4
$pm
pvalues pfreqs
[1,] 37.5 38
[2,] 57.5 39
[3,] 77.5 42
[4,] 97.5 50
$np
[1] 4
$pm
pvalues pfreqs
[1,] 0.1 34
[2,] 1.3 21
[3,] 2.3 11
$np
[1] 3
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.