library("rplatypus")
spec <- platypus_spec(
data = classification_data("train/", "valid/", classes = c("benign", "malignant")),
models = list(classifier("cnn", input_shape = c(128, 128)))
)
class_balance(spec)How many images each class has, before anything is trained
Description
The number every decision about this task’s metrics turned on, and the person who most needs it is the one who has just written a specification and not yet run anything. A prevalence a reader does not know is one they will discover from a score that looks fine.
Usage
class_balance(spec, split = "train")
Arguments
spec
|
A platypus_spec() describing a classification task.
|
split
|
Which split to count: “train”, “validation” or “test”. A split that carries no labelling is refused by name rather than counted - which is the ordinary shape of a test set, since 0.8.0a52 reads a CSV of key, images as a prediction split. Counted anyway it would report every class at zero and read as a finding about the dataset rather than about there being nothing to count.
|
Details
The sentence under the table is the engine’s own, printed rather than reproduced: the threshold it fires below is the engine’s number, and a copy of it here would be a second place for one fact to live.
Value
A data frame of one row per class, in class order, with columns class, n and share, of class platypus_class_balance so that printing it adds the engine’s own remark about how lopsided the split is. The engine’s sentence is carried on the remark attribute.
See Also
classification_data(), split()