| hanaml.Sampling {hana.ml.r} | R Documentation |
hanaml.sampling is a R wrapper for PAL sampling.
hanaml.Sampling (conn.context, data, method, interval = NULL,
features = NULL, sampling.size = NULL,
random.state = NULL, percentage = NULL)
conn.context |
|
data |
|
method |
|
interval |
|
features |
|
sampling.size |
|
random.state |
Indicates the seed used to initialize the random number generator.
It can be set to 0 or a positive value.
Default to 0. |
percentage |
|
This function is used to choose a small portion of the records as representatives.
DataFrame
The same column structure (number of columns, column names, and column
types) with the table with which the model is trained.
## Not run:
Input DataFrame data for sampling:
> data$Collect()
EMPNO GENDER INCOME
1 1 male 4000.5
2 2 male 5000.7
3 3 female 5100.8
4 4 male 5400.9
5 5 female 5500.2
....
23 23 male 8576.9
24 24 male 9560.9
25 25 female 8794.9
Call Sampling function:
> sampling <- hanaml.Sampling(conn, data, method = 'first_n',
sampling.size = 8, interval = 5,
features = "GENDER")
Expected output:
> sampling$Collect()
EMPNO GENDER INCOME
1 1 male 4000.5
2 2 male 5000.7
3 3 female 5100.8
4 4 male 5400.9
5 5 female 5500.2
6 6 male 5540.4
7 7 male 4500.9
8 8 female 6000.8
## End(Not run)