Title: | Classification Using Binary Procrustes Rotation |
---|---|
Description: | Implements a classification method described by Grice (2011, ISBN:978-0-12-385194-9) using binary procrustes rotation; a simplified version of procrustes rotation. |
Authors: | Timothy Beechey [aut, cre] |
Maintainer: | Timothy Beechey <[email protected]> |
License: | GPL (>= 3) |
Version: | 0.6.2 |
Built: | 2024-11-05 06:32:26 UTC |
Source: | CRAN |
Classification accuracy for each observation.
accuracy(m)
accuracy(m)
m |
an object of class "clubprofit" produced by |
Returns a character vector containing a string corresponding to each observation indicating whether classification of that observation was "correct", "incorrect", or "ambigous".
a table
mod <- club(rate ~ dose, data = caffeine) accuracy(mod)
mod <- club(rate ~ dose, data = caffeine) accuracy(mod)
Convert the output of csi() to a data.frame.
## S3 method for class 'clubprocsi' as.data.frame(x, row.names = NULL, optional = FALSE, ...)
## S3 method for class 'clubprocsi' as.data.frame(x, row.names = NULL, optional = FALSE, ...)
x |
an object of class "clubprocsi" |
row.names |
ignored |
optional |
ignored |
... |
ignored |
This function is useful to format pcc replicates data for plotting.
mod <- club(rate ~ dose, data = caffeine) z <- csi(mod) as.data.frame(z)
mod <- club(rate ~ dose, data = caffeine) z <- csi(mod) as.data.frame(z)
Convert the output of pcc_replicates() to a data.frame.
## S3 method for class 'clubprorand' as.data.frame(x, row.names = NULL, optional = FALSE, ...)
## S3 method for class 'clubprorand' as.data.frame(x, row.names = NULL, optional = FALSE, ...)
x |
an object of class "clubprorand" |
row.names |
ignored |
optional |
ignored |
... |
ignored |
This function is useful to format pcc replicates data for plotting.
mod <- club(rate ~ dose, data = caffeine) z <- pcc_replicates(mod) as.data.frame(z)
mod <- club(rate ~ dose, data = caffeine) z <- pcc_replicates(mod) as.data.frame(z)
Effect of three different doses of caffeine on finger tapping rate.
caffeine
caffeine
A data frame with 30 rows and 2 columns:
dose of caffeine in mg
finger taps per minute
Hand D.J., Daly F., Lunn A.D., McConway K.J., Ostrowski E. (1994) A Handbook of Small Data Sets. London: Chapman & Hall. Data set 50.
club()
is used to classify obervations using binary procrustes
rotation.
club( f, data, imprecision, nreps, normalise_cols, reorder_obs, display_progress )
club( f, data, imprecision, nreps, normalise_cols, reorder_obs, display_progress )
f |
a formula. |
data |
a data.frame. |
imprecision |
a number indicting the margin of imprecision allowed in classification. |
nreps |
the number of replicates to use in the randomisation test. |
normalise_cols |
a boolean indicating whether to normalise matrix columns. |
reorder_obs |
a string indicating the method for reordering observations to calculate c-values. |
display_progress |
a boolean indictaing whether a progress bar should be displayed. |
an object of class "clubprofit" is a list containing the folllowing components:
a character vector of predicted classifications.
a character vector indicating whether each classification is "correct", "incorrect", or "ambiguous".
the percentage of correct classifications.
the chance of randomly reordered data producing a PCC >= the observed PCC.
a vector of PCCs generated from randomly reordered
data used to calculate cval
.
the matched call.
mod <- club(rate ~ dose, data = caffeine)
mod <- club(rate ~ dose, data = caffeine)
Compare models.
compare(m1, m2)
compare(m1, m2)
m1 |
an object of class "clubprofit" produced by |
m2 |
an object of class "clubprofit" produced by |
Compare the PCC of two clubprofit models and compute the chance-value of the difference.
an object of type "clubprocomparison"
m1 <- club(width ~ location, jellyfish) m2 <- club(length ~ location, jellyfish) compare(m1, m2)
m1 <- club(width ~ location, jellyfish) m2 <- club(length ~ location, jellyfish) compare(m1, m2)
Classification strength indices.
csi(m)
csi(m)
m |
an object of class "clubprofit" produced by |
Returns a vector containing the classification strength index for each observation.
a numeric vector.
mod <- club(rate ~ dose, data = caffeine) csi(mod)
mod <- club(rate ~ dose, data = caffeine) csi(mod)
Chance value.
cval(m)
cval(m)
m |
an object of class "clubprofit" produced by |
Compute the chance that randomly reordered data results in a percentage of correctly classified observations at least as high as the observed data.
a numeric value.
mod <- club(rate ~ dose, data = caffeine) cval(mod)
mod <- club(rate ~ dose, data = caffeine) cval(mod)
Individual level classification results.
individual_results(m, digits)
individual_results(m, digits)
m |
an object of class "clubprofit" produced by |
digits |
an integer |
Returns a data.frame containing predicted classifications and classification accuracy for each individual observation.
a data.frame containing a columns of predictions and prediction accuracy
mod <- club(rate ~ dose, data = caffeine) individual_results(mod)
mod <- club(rate ~ dose, data = caffeine) individual_results(mod)
Sizes of jellyfish from two locations in the Hawkesbury River, New South Wales, Australia.
jellyfish
jellyfish
A data frame with 46 rows and 3 columns:
location where jellyfish was caught
jellyfish width in mm
jellyfish length in mm
Hand D.J., Daly F., Lunn A.D., McConway K.J., Ostrowski E. (1994) A Handbook of Small Data Sets. London: Chapman & Hall. Data set 225.
Median classification strength index.
median_csi(m)
median_csi(m)
m |
an object of class "clubprofit" produced by |
Returns the median classification strength index.
a numeric vector.
mod <- club(rate ~ dose, data = caffeine) median_csi(mod)
mod <- club(rate ~ dose, data = caffeine) median_csi(mod)
Number of ambiguous classifications.
n_ambiguous(m)
n_ambiguous(m)
m |
an object of class "clubprofit" produced by |
Returns the number of observations which were classified ambiguously by the model.
an integer.
mod <- club(rate ~ dose, data = caffeine) n_ambiguous(mod)
mod <- club(rate ~ dose, data = caffeine) n_ambiguous(mod)
Number of correct classifications.
n_correct(m)
n_correct(m)
m |
an object of class "clubprofit" produced by |
Returns the number of observations which were classified correctly by the model.
an integer.
mod <- club(rate ~ dose, data = caffeine) n_correct(mod)
mod <- club(rate ~ dose, data = caffeine) n_correct(mod)
Number of incorrect classifications.
n_incorrect(m)
n_incorrect(m)
m |
an object of class "clubprofit" produced by |
Returns the number of observations which were classified incorrectly by the model.
an integer.
mod <- club(rate ~ dose, data = caffeine) n_incorrect(mod)
mod <- club(rate ~ dose, data = caffeine) n_incorrect(mod)
Percentage of correct classifications.
pcc(m)
pcc(m)
m |
an object of class "clubprofit" produced by |
Returns the percentage of correctly classified observations.
a numeric value.
mod <- club(rate ~ dose, data = caffeine) pcc(mod)
mod <- club(rate ~ dose, data = caffeine) pcc(mod)
PCC replicates.
pcc_replicates(m)
pcc_replicates(m)
m |
an object of class "clubprofit" produced by |
Returns an object containing a vector of PCC replicates used to calculate the chance-value.
an object of class clubprorand.
mod <- club(rate ~ dose, data = caffeine) head(pcc_replicates(mod))
mod <- club(rate ~ dose, data = caffeine) head(pcc_replicates(mod))
Plot accuracy.
## S3 method for class 'clubproaccuracy' plot(x, ...)
## S3 method for class 'clubproaccuracy' plot(x, ...)
x |
an object of class "clubproaccuracy" |
... |
ignored |
Produces a mosaic plot of predictio naccuracy by category
called for side-effects only
mod <- club(rate ~ dose, data = caffeine) z <- accuracy(mod) plot(z)
mod <- club(rate ~ dose, data = caffeine) z <- accuracy(mod) plot(z)
Plot model comparison.
## S3 method for class 'clubprocomparison' plot(x, ...)
## S3 method for class 'clubprocomparison' plot(x, ...)
x |
an object of class "clubprocomparison". |
... |
ignored |
Plot a distribution of PCCs computed from randomly reordered data used to calculate the chance-value for a model comparison.
no return value, called for side effects only.
m1 <- club(width ~ location, jellyfish) m2 <- club(length ~ location, jellyfish) z <- compare(m1, m2) plot(z)
m1 <- club(width ~ location, jellyfish) m2 <- club(length ~ location, jellyfish) z <- compare(m1, m2) plot(z)
Plot classification strength indices.
## S3 method for class 'clubprocsi' plot(x, ...)
## S3 method for class 'clubprocsi' plot(x, ...)
x |
an object of class "clubprocsi" |
... |
ignored |
Produces dotplot showing classification strength for each individual.
called for side-effects only
mod <- club(rate ~ dose, data = caffeine) z <- csi(mod) plot(z)
mod <- club(rate ~ dose, data = caffeine) z <- csi(mod) plot(z)
Plot classification accuracy.
## S3 method for class 'clubprofit' plot(x, ...)
## S3 method for class 'clubprofit' plot(x, ...)
x |
an object of class "clubprofit" produced by |
... |
ignored |
Produces bar plot showing counts of individuals against observed values within each target grouping. Fill colours indicate whether each individual was classified correctly, incorrectly or ambiguously.
called for side-effects only
mod <- club(rate ~ dose, data = caffeine) plot(mod)
mod <- club(rate ~ dose, data = caffeine) plot(mod)
Plot predictions.
## S3 method for class 'clubpropredictions' plot(x, ...)
## S3 method for class 'clubpropredictions' plot(x, ...)
x |
an object of class "clubpropredictions" |
... |
ignored |
Produces a mosaic plot of observed versus predicted categories
called for side-effects only
mod <- club(rate ~ dose, data = caffeine) z <- predict(mod) plot(z)
mod <- club(rate ~ dose, data = caffeine) z <- predict(mod) plot(z)
Plot PCC replicates.
## S3 method for class 'clubprorand' plot(x, ...)
## S3 method for class 'clubprorand' plot(x, ...)
x |
an object of class "clubprofit" produced by |
... |
ignored |
Plot the distribution of PCCs computed from randomly reordered data used to calculate the chance-value.
no return value, called for side effects only.
mod <- club(rate ~ dose, data = caffeine) plot(pcc_replicates(mod))
mod <- club(rate ~ dose, data = caffeine) plot(pcc_replicates(mod))
Plot PCC as a function of binary category boundary location.
## S3 method for class 'clubprothreshold' plot(x, ...)
## S3 method for class 'clubprothreshold' plot(x, ...)
x |
an object of class "clubprothreshold" |
... |
ignored |
Produces an xyplot showing the PCC returned for each possible category boundary.
called for side-effects only
mod <- club(rate ~ dose, data = caffeine) z <- threshold(mod) plot(z)
mod <- club(rate ~ dose, data = caffeine) z <- threshold(mod) plot(z)
Predicted category for each observation.
## S3 method for class 'clubprofit' predict(object, ...)
## S3 method for class 'clubprofit' predict(object, ...)
object |
an object of class "clubprofit" produced by |
... |
ignored |
Returns a character vector containing the name of the predicted category for each observed value.
a table
mod <- club(rate ~ dose, data = caffeine) predict(mod)
mod <- club(rate ~ dose, data = caffeine) predict(mod)
Generate a summary of a comparison of clubprofit models.
## S3 method for class 'clubprocomparison' summary(object, ...)
## S3 method for class 'clubprocomparison' summary(object, ...)
object |
an object of class "clubprocomparison". |
... |
ignored |
No return value, called for side effects.
m1 <- club(width ~ location, jellyfish) m2 <- club(length ~ location, jellyfish) z <- compare(m1, m2) summary(z)
m1 <- club(width ~ location, jellyfish) m2 <- club(length ~ location, jellyfish) z <- compare(m1, m2) summary(z)
Generate a summary of results from a fitted clubpro model.
## S3 method for class 'clubprofit' summary(object, ...)
## S3 method for class 'clubprofit' summary(object, ...)
object |
an object of class "clubprofit". |
... |
ignored |
No return value, called for side effects.
mod <- club(rate ~ dose, data = caffeine) summary(mod)
mod <- club(rate ~ dose, data = caffeine) summary(mod)
Classification strength indices.
threshold(m)
threshold(m)
m |
an object of class "clubprofit" produced by |
Returns a vector containing the classification strength index for each observation.
an object of class clubprothreshold
mod <- club(width ~ location, data = jellyfish) threshold(mod)
mod <- club(width ~ location, data = jellyfish) threshold(mod)