fsSimilarity | R Documentation |
fsSimilarity
implements different methods for calculation similarity of two feature sets.
fsSimilarity( feature.set1, feature.set2, cutoff = FALSE, threshold = 1, method = c("Kuncheva", "Jaccard", "Hamming") )
feature.set1 |
a matrix that contains feature weights. |
feature.set2 |
a matrix that contains feature weights. |
cutoff |
logical. If true, ihe input features sets are cut-off using the |
threshold |
the threshold for feature selection using the |
method |
a similarity metric. Implemented metrics:
|
returns a value from the [-1, 1] interval for Kuncheva and from the [0,1] interval for other algorithms, where 1 is for absolutely identical feature sets.
Kuncheva L., 2007, A stability index for feature selection. In: 25th IASTED international multi-conference: artificial intelligence and applications, pp. 390–395
# Load traffic data data(traffic.mini) # Scaling is sometimes useful for feature selection # Exclude the first column - it contains timestamps data <- scale(traffic.mini$data[,-1]) mCCF<-fsMTS(data, max.lag=3, method="CCF") mLARS<-fsMTS(data, max.lag=3, method="LARS") fsSimilarity(mCCF, mLARS, cutoff=TRUE, threshold=0.2, method="Kuncheva") fsSimilarity(mCCF, mLARS, cutoff=TRUE, threshold=0.2, method="Jaccard") fsSimilarity(mCCF, mLARS, cutoff=TRUE, threshold=0.2, method="Hamming")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.