@@ -81,10 +81,10 @@ break_points <- stats::quantile(
8181)
8282break_points[1] <- 0.0 # ensure starting at 0
8383break_points[n_intervals + 1] <- max(observed_times, na.rm = TRUE) * 1.001 # ensure ending at max time
84- units_of_cpius <- diff(break_points)
84+ intervals <- diff(break_points)
8585cpiu_wide <- patients_to_cpius(
8686 data_to_convert = df,
87- units_of_cpiu = units_of_cpiu
87+ units_of_cpiu = intervals
8888)
8989names(cpiu_wide)
9090class(cpiu_wide)
@@ -128,7 +128,14 @@ cpiu_wide <- cpius_to_dummy(cpiu_wide, cols_to_keep = NULL)
128128``` {r}
129129fit <- Rforce(
130130 cpius = cpiu_wide,
131- split_rule = "Rforce-QLR"
131+ split_rule = "Rforce-QLR",
132+ n_trees = 1
133+ )
134+
135+ fitt <- Rforce(
136+ cpius = cpiu_wide,
137+ split_rule = "Rforce-QLR",
138+ n_trees = 1
132139)
133140```
134141
@@ -138,12 +145,26 @@ fit <- Rforce(
138145* ` Rforce ` is also a bigger wrapper function for ` Step 1 - 3 `
139146
140147``` {r}
141- fit <- Rforce(
148+ fit1 <- Rforce(
149+ data = df,
150+ formula = Surv(Id, X, Status) ~ .,
151+ n_intervals = 10,
152+ split_rule = "Rforce-QLR",
153+ n_trees = 200
154+ )
155+
156+ fit2 <- Rforce(
142157 data = df,
143158 formula = Surv(Id, X, Status) ~ .,
144159 n_intervals = 10,
145- split_rule = "Rforce-QLR"
160+ split_rule = "Rforce-QLR",
161+ n_trees = 200
146162)
163+ all.equal(fit1, fit2)
164+ saveRforce(fit1, "output/fit1/")
165+ saveRforce(fit2, "output/fit2/")
166+
167+ fit1 <- loadRforce("/home/yu89975/r-dev/Rforce/output/fit1/")
147168```
148169
149170## Reference
0 commit comments