-
Notifications
You must be signed in to change notification settings - Fork 1
/
setup.R
54 lines (41 loc) · 1.67 KB
/
setup.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
setup_folder <- function() {
# Repetition List
repetition_list <<- c(50, 100, 200, 500, 1000, 1500)
# Define Model Source Directory
polygon_name <<- "test_data.shp"
model_result <<- "classification_result_ontest.rds"
# Attributes
polygonid_column <<- "PolygonId"
classid_column <<- "ClassId"
prediction_column <<- "Predictions"
# Area Calculation on the Map
area_matrix <<- data.frame(
area_list = c(2471.446, 539.2134, 890.6652,
2396.22, 5463.848, 504.6588,
97.4421, 6666.021, 661.9248,
322.569, 506.1456, 2335.543,
117.3798),
row.names = c(11, 12, 13, 14,
15, 16, 17, 18,
19, 21, 22, 23,
24))
# Visualization Lists - Dropping Water Class for visual purposes
class_id <<- c(12, 13, 14,
15, 16, 17,
18, 19, 21)
class_decoder <<- c("Sunflower", "Capia Pepper", "Paddy",
"Tomato", "Watermelon", "Melon",
"Corn", "Orchard", "Alfalfa")
class_color <<- c("#0044FF", "#4BFF00", "#00FFF2",
"#FF0000", "#107717", "#B1BC00",
"#F0FF00", "#720E91", "#46FFA1")
# Visualization on Integer values is sometimes problematic.
# We are adding "C" to work properly on bootstrap visualizations
class_list <<- paste0("C", class_id)
# Prepare Class DF
class_df <<- data.frame(class_list, class_decoder, class_color,
stringsAsFactors = FALSE)
# Prepare Color DF
color_df <- data.frame(class_decoder, class_color)
color_df <<- dplyr::arrange(color_df, class_decoder)
}