Sepal.Length
- numerical function; from online documentation:
y
, . createDataPartition
groups
.
groups
: y
:
groups = min(5, length(y)
)
:
groups
, min(5, 150) = 5
breaks; , , 1- , , , summary
:
> summary(iris$Sepal.Length)
Min. 1st Qu. Median Mean 3rd Qu. Max.
4.300 5.100 5.800 5.843 6.400 7.900
p = 0.1
(4) , (); , :
l1 = length(which(iris$Sepal.Length >= 4.3 & iris$Sepal.Length <= 5.1))
l2 = length(which(iris$Sepal.Length > 5.1 & iris$Sepal.Length <= 5.8))
l3 = length(which(iris$Sepal.Length > 5.8 & iris$Sepal.Length <= 6.4))
l4 = length(which(iris$Sepal.Length > 6.4 & iris$Sepal.Length <= 7.9))
? - № 140 , no. p
; , p = 0.1
:
ceiling(l1*p) + ceiling(l2*p) + ceiling(l3*p) + ceiling(l4*p)
# 17
!:)