Commit e2f8c33c authored by Boulangeat Isabelle's avatar Boulangeat Isabelle
Browse files

init copy

parent d82ffcf8
No preview for this file type
This diff is collapsed.
......@@ -47,10 +47,6 @@ ggplot(dat_h_veg, aes(x = reorder(ref_typoveg, hmean, na.rm=TRUE), y = hmean)) +
labs(y="Hauteur moyenne (est. biomasse)", x="Type vegetation")
```
```
## Warning: Removed 145 rows containing non-finite values (stat_boxplot).
```
![](README_files/figure-html/unnamed-chunk-2-1.png)<!-- -->
......@@ -64,10 +60,6 @@ pl <- ggplot(dat_h_veg, aes(x = date_releve, y = hmean)) +
pl + theme(legend.position = "none")
```
```
## Warning: Removed 135 row(s) containing missing values (geom_path).
```
![](README_files/figure-html/unnamed-chunk-3-1.png)<!-- -->
......@@ -140,10 +132,6 @@ ggplot(dat_h_veg, aes(x = hmad, y = hsd)) +
geom_point()
```
```
## Warning: Removed 145 rows containing missing values (geom_point).
```
![](README_files/figure-html/unnamed-chunk-6-1.png)<!-- -->
......@@ -154,10 +142,6 @@ ggplot(dat_h_veg, aes(x = date_releve, y = hmad)) +
facet_wrap(~ref_typoveg)
```
```
## Warning: Removed 135 row(s) containing missing values (geom_path).
```
![](README_files/figure-html/unnamed-chunk-7-1.png)<!-- -->
```r
......@@ -171,10 +155,6 @@ ggplot(dat_h_veg, aes(x = reorder(ref_typoveg, hmad, na.rm=TRUE), y = hmad)) +
labs(y="Variation intra de hauteur", x="Type vegetation")
```
```
## Warning: Removed 145 rows containing non-finite values (stat_boxplot).
```
![](README_files/figure-html/unnamed-chunk-8-1.png)<!-- -->
......@@ -184,10 +164,6 @@ ggplot(dat_h_veg, aes(x = reorder(ref_typoveg, hmad/hmean, na.rm=TRUE), y = hmad
labs(y="Variation intra de hauteur (stand. moy.)", x="Type vegetation")
```
```
## Warning: Removed 145 rows containing non-finite values (stat_boxplot).
```
![](README_files/figure-html/unnamed-chunk-9-1.png)<!-- -->
## Sites topography
......@@ -254,7 +230,7 @@ dim(dat)
```
```
## [1] 326 29
## [1] 392 29
```
```r
......@@ -268,31 +244,31 @@ inertia.dudi(pca, row=FALSE, col =TRUE)
##
## Decomposition of total inertia:
## inertia cum cum(%)
## Ax1 1.214e+01 12.14 41.87
## Ax2 3.815e+00 15.96 55.03
## Ax3 2.938e+00 18.90 65.16
## Ax4 2.495e+00 21.39 73.76
## Ax5 2.155e+00 23.55 81.19
## Ax6 1.097e+00 24.64 84.98
## Ax7 9.678e-01 25.61 88.31
## Ax8 8.821e-01 26.49 91.36
## Ax9 6.313e-01 27.12 93.53
## Ax10 5.531e-01 27.68 95.44
## Ax11 3.860e-01 28.06 96.77
## Ax12 2.496e-01 28.31 97.63
## Ax13 2.234e-01 28.54 98.40
## Ax14 1.103e-01 28.65 98.78
## Ax15 1.040e-01 28.75 99.14
## Ax16 8.821e-02 28.84 99.45
## Ax17 4.356e-02 28.88 99.60
## Ax18 3.133e-02 28.91 99.70
## Ax19 2.890e-02 28.94 99.80
## Ax20 2.208e-02 28.97 99.88
## Ax21 1.484e-02 28.98 99.93
## Ax22 1.126e-02 28.99 99.97
## Ax23 5.520e-03 29.00 99.99
## Ax24 3.240e-03 29.00 100.00
## Ax25 1.676e-05 29.00 100.00
## Ax1 1.224e+01 12.24 42.21
## Ax2 3.975e+00 16.22 55.92
## Ax3 2.757e+00 18.97 65.43
## Ax4 2.449e+00 21.42 73.87
## Ax5 1.951e+00 23.37 80.60
## Ax6 1.043e+00 24.42 84.20
## Ax7 9.911e-01 25.41 87.61
## Ax8 8.523e-01 26.26 90.55
## Ax9 6.562e-01 26.92 92.82
## Ax10 5.695e-01 27.49 94.78
## Ax11 4.174e-01 27.90 96.22
## Ax12 2.635e-01 28.17 97.13
## Ax13 2.431e-01 28.41 97.97
## Ax14 1.488e-01 28.56 98.48
## Ax15 1.137e-01 28.67 98.87
## Ax16 1.047e-01 28.78 99.23
## Ax17 8.827e-02 28.87 99.54
## Ax18 4.498e-02 28.91 99.69
## Ax19 2.629e-02 28.94 99.78
## Ax20 2.245e-02 28.96 99.86
## Ax21 2.195e-02 28.98 99.94
## Ax22 9.689e-03 28.99 99.97
## Ax23 6.386e-03 29.00 99.99
## Ax24 2.434e-03 29.00 100.00
## Ax25 1.135e-04 29.00 100.00
##
## Column contributions (%):
## alti slope lf northing
......@@ -313,100 +289,100 @@ inertia.dudi(pca, row=FALSE, col =TRUE)
## 3.448
##
## Column absolute contributions (%):
## Axis1 Axis2 Axis3 Axis4
## alti 2.35689 9.71773 0.78391 1.266e+00
## slope 0.57743 3.75004 0.84670 5.896e-02
## lf 0.01174 2.01464 1.31009 1.490e-01
## northing 1.10364 0.33057 2.65148 3.062e-01
## easting 0.76428 1.59800 0.03336 7.096e-02
## snowfree_time 0.59547 9.49618 11.35769 1.095e+00
## cumgdd0 0.76251 15.99983 5.03075 6.603e-01
## cumgdd60d 0.67773 17.29617 4.14299 4.977e-01
## albedo.gdd300 7.49195 0.17806 0.71629 8.400e-01
## albedo.gdd600 7.63105 0.19890 0.07115 6.415e-01
## albedo.gdd900 5.70258 1.73350 0.56764 2.602e-01
## frost_severe.gdd300 1.64300 0.04100 1.73959 2.947e+01
## frost_severe.gdd600 1.64300 0.04100 1.73959 2.947e+01
## frost_severe.gdd900 1.59739 0.01727 1.62883 2.936e+01
## frost.gdd300 6.40042 0.68087 0.82578 4.488e-01
## frost.gdd600 6.40042 0.68087 0.82578 4.488e-01
## frost.gdd900 5.91168 1.46054 0.65286 3.809e-01
## gddspeed.gdd300 7.19982 0.38288 0.10875 4.519e-01
## gddspeed.gdd600 6.82718 0.40637 1.89308 1.875e-01
## gddspeed.gdd900 3.57737 0.21330 7.70715 4.415e-04
## radiations.gdd300 5.53633 0.21733 2.59806 8.290e-03
## radiations.gdd600 3.99008 0.74914 4.79785 1.218e-01
## radiations.gdd900 2.48107 1.44946 7.83808 6.309e-01
## rainfall.gdd300 2.03240 8.53988 5.09403 5.156e-03
## rainfall.gdd600 0.86467 7.75374 11.52810 3.083e-01
## rainfall.gdd900 0.45027 6.73033 12.71229 1.262e-01
## snowdays.gdd300 5.39061 2.36479 3.81811 9.447e-01
## snowdays.gdd600 5.39061 2.36479 3.81811 9.447e-01
## snowdays.gdd900 4.98841 3.59283 3.16190 8.390e-01
## Axis1 Axis2 Axis3 Axis4
## alti 1.88684 12.503795 0.379400 0.070526
## slope 0.38863 1.824692 2.883965 1.124328
## lf 0.05152 2.695300 0.433258 0.156529
## northing 1.16929 0.017120 5.008874 0.670210
## easting 0.30203 1.785746 0.118264 0.353976
## snowfree_time 0.20115 16.271269 2.376843 0.898279
## cumgdd0 0.38307 20.050495 0.099405 0.256145
## cumgdd60d 0.45963 19.603017 0.010073 0.217251
## albedo.gdd300 7.45170 0.028048 0.909561 1.116098
## albedo.gdd600 7.62254 0.013528 0.201225 1.018595
## albedo.gdd900 5.73004 2.324344 0.006299 1.049656
## frost_severe.gdd300 1.67987 0.007216 3.376269 27.582779
## frost_severe.gdd600 1.67987 0.007216 3.376269 27.582779
## frost_severe.gdd900 1.41349 0.020023 3.016406 27.132134
## frost.gdd300 6.67997 0.004085 1.656608 0.251167
## frost.gdd600 6.67997 0.004085 1.656608 0.251167
## frost.gdd900 5.66624 0.464192 1.507108 0.327239
## gddspeed.gdd300 7.02741 0.623171 0.360003 0.209820
## gddspeed.gdd600 6.81882 0.116551 2.352370 0.102467
## gddspeed.gdd900 3.35579 2.645354 4.578697 0.098988
## radiations.gdd300 5.35155 1.407271 2.891876 0.002754
## radiations.gdd600 3.78032 3.389705 4.646890 0.206905
## radiations.gdd900 2.40817 5.596005 6.093349 0.495999
## rainfall.gdd300 2.80555 4.020595 3.802905 0.442277
## rainfall.gdd600 1.84102 2.071210 13.857263 0.795847
## rainfall.gdd900 1.17491 1.021128 15.588913 0.490008
## snowdays.gdd300 5.39901 0.365188 6.325854 2.353370
## snowdays.gdd600 5.39901 0.365188 6.325854 2.353370
## snowdays.gdd900 5.19260 0.754463 6.159591 2.389336
##
## Signed column relative contributions:
## Axis1 Axis2 Axis3 Axis4
## alti -28.6203 -37.07608 2.3028 3.157825
## slope -7.0119 -14.30755 -2.4872 -0.147095
## lf 0.1425 -7.68647 3.8485 -0.371675
## northing -13.4019 -1.26123 -7.7889 -0.763863
## easting 9.2808 6.09687 -0.0980 0.177033
## snowfree_time -7.2309 -36.23082 33.3638 2.732736
## cumgdd0 -9.2594 -61.04422 14.7781 1.647412
## cumgdd60d -8.2298 -65.99013 12.1703 1.241669
## albedo.gdd300 90.9769 -0.67935 -2.1041 -2.095804
## albedo.gdd600 92.6660 -0.75887 -0.2090 -1.600464
## albedo.gdd900 69.2480 -6.61381 1.6675 -0.649227
## frost_severe.gdd300 19.9514 0.15641 -5.1101 73.533219
## frost_severe.gdd600 19.9514 0.15641 -5.1101 73.533219
## frost_severe.gdd900 19.3976 0.06589 -4.7848 73.254688
## frost.gdd300 77.7221 -2.59773 -2.4258 -1.119687
## frost.gdd600 77.7221 -2.59773 -2.4258 -1.119687
## frost.gdd900 71.7872 -5.57239 -1.9178 -0.950205
## gddspeed.gdd300 87.4295 1.46080 0.3195 -1.127433
## gddspeed.gdd600 82.9044 1.55044 5.5610 -0.467794
## gddspeed.gdd900 43.4410 -0.81380 22.6402 0.001101
## radiations.gdd300 67.2292 -0.82917 7.6319 -0.020684
## radiations.gdd600 48.4527 -2.85821 14.0939 0.303766
## radiations.gdd900 30.1283 -5.53013 23.0248 1.574111
## rainfall.gdd300 24.6799 32.58222 14.9640 -0.012863
## rainfall.gdd600 10.5000 29.58286 33.8644 0.769237
## rainfall.gdd900 5.4678 25.67824 37.3431 0.314976
## snowdays.gdd300 65.4597 -9.02240 -11.2159 -2.357037
## snowdays.gdd600 65.4597 -9.02240 -11.2159 -2.357037
## snowdays.gdd900 60.5756 -13.70774 -9.2883 -2.093141
## Axis1 Axis2 Axis3 Axis4
## alti -23.0990 -49.69868 -1.04617 0.172712
## slope -4.7577 -7.25258 -7.95230 -2.753384
## lf 0.6307 -10.71297 1.19467 -0.383327
## northing -14.3146 -0.06805 -13.81156 -1.641289
## easting 3.6975 7.09778 -0.32610 0.866856
## snowfree_time -2.4625 -64.67320 6.55395 2.199809
## cumgdd0 -4.6896 -79.69445 0.27410 0.627278
## cumgdd60d -5.6269 -77.91586 0.02778 0.532028
## albedo.gdd300 91.2247 0.11148 -2.50804 -2.733229
## albedo.gdd600 93.3161 -0.05377 -0.55486 -2.494452
## albedo.gdd900 70.1478 -9.23854 0.01737 -2.570518
## frost_severe.gdd300 20.5651 0.02868 -9.30979 67.547889
## frost_severe.gdd600 20.5651 0.02868 -9.30979 67.547889
## frost_severe.gdd900 17.3041 -0.07959 -8.31749 66.444298
## frost.gdd300 81.7770 -0.01623 -4.56796 -0.615087
## frost.gdd600 81.7770 -0.01623 -4.56796 -0.615087
## frost.gdd900 69.3668 -1.84502 -4.15573 -0.801380
## gddspeed.gdd300 86.0304 2.47691 0.99268 -0.513832
## gddspeed.gdd600 83.4769 0.46325 6.48647 -0.250933
## gddspeed.gdd900 41.0820 -10.51446 12.62538 -0.242413
## radiations.gdd300 65.5144 -5.59346 7.97411 0.006743
## radiations.gdd600 46.2792 -13.47302 12.81342 0.506694
## radiations.gdd900 29.4812 -22.24237 16.80191 1.214659
## rainfall.gdd300 34.3459 15.98061 10.48620 1.083100
## rainfall.gdd600 22.5380 8.23241 38.21027 1.948962
## rainfall.gdd900 14.3834 4.05866 42.98515 1.199989
## snowdays.gdd300 66.0953 -1.45151 -17.44302 -5.763203
## snowdays.gdd600 66.0953 -1.45151 -17.44302 -5.763203
## snowdays.gdd900 63.5685 -2.99875 -16.98457 -5.851283
##
## Cumulative sum of column relative contributions (%):
## Axis1 Axis1:2 Axis1:3 Axis1:4 Axis5:25
## alti 28.6203 65.696 68.00 71.16 28.843
## slope 7.0119 21.319 23.81 23.95 76.046
## lf 0.1425 7.829 11.68 12.05 87.951
## northing 13.4019 14.663 22.45 23.22 76.784
## easting 9.2808 15.378 15.48 15.65 84.347
## snowfree_time 7.2309 43.462 76.83 79.56 20.442
## cumgdd0 9.2594 70.304 85.08 86.73 13.271
## cumgdd60d 8.2298 74.220 86.39 87.63 12.368
## albedo.gdd300 90.9769 91.656 93.76 95.86 4.144
## albedo.gdd600 92.6660 93.425 93.63 95.23 4.766
## albedo.gdd900 69.2480 75.862 77.53 78.18 21.821
## frost_severe.gdd300 19.9514 20.108 25.22 98.75 1.249
## frost_severe.gdd600 19.9514 20.108 25.22 98.75 1.249
## frost_severe.gdd900 19.3976 19.463 24.25 97.50 2.497
## frost.gdd300 77.7221 80.320 82.75 83.87 16.135
## frost.gdd600 77.7221 80.320 82.75 83.87 16.135
## frost.gdd900 71.7872 77.360 79.28 80.23 19.772
## gddspeed.gdd300 87.4295 88.890 89.21 90.34 9.663
## gddspeed.gdd600 82.9044 84.455 90.02 90.48 9.516
## gddspeed.gdd900 43.4410 44.255 66.89 66.90 33.104
## radiations.gdd300 67.2292 68.058 75.69 75.71 24.289
## radiations.gdd600 48.4527 51.311 65.40 65.71 34.291
## radiations.gdd900 30.1283 35.658 58.68 60.26 39.743
## rainfall.gdd300 24.6799 57.262 72.23 72.24 27.761
## rainfall.gdd600 10.5000 40.083 73.95 74.72 25.283
## rainfall.gdd900 5.4678 31.146 68.49 68.80 31.196
## snowdays.gdd300 65.4597 74.482 85.70 88.06 11.945
## snowdays.gdd600 65.4597 74.482 85.70 88.06 11.945
## snowdays.gdd900 60.5756 74.283 83.57 85.66 14.335
## alti 23.0990 72.80 73.84 74.02 25.983
## slope 4.7577 12.01 19.96 22.72 77.284
## lf 0.6307 11.34 12.54 12.92 87.078
## northing 14.3146 14.38 28.19 29.84 70.165
## easting 3.6975 10.80 11.12 11.99 88.012
## snowfree_time 2.4625 67.14 73.69 75.89 24.110
## cumgdd0 4.6896 84.38 84.66 85.29 14.715
## cumgdd60d 5.6269 83.54 83.57 84.10 15.897
## albedo.gdd300 91.2247 91.34 93.84 96.58 3.423
## albedo.gdd600 93.3161 93.37 93.92 96.42 3.581
## albedo.gdd900 70.1478 79.39 79.40 81.97 18.026
## frost_severe.gdd300 20.5651 20.59 29.90 97.45 2.548
## frost_severe.gdd600 20.5651 20.59 29.90 97.45 2.548
## frost_severe.gdd900 17.3041 17.38 25.70 92.15 7.855
## frost.gdd300 81.7770 81.79 86.36 86.98 13.024
## frost.gdd600 81.7770 81.79 86.36 86.98 13.024
## frost.gdd900 69.3668 71.21 75.37 76.17 23.831
## gddspeed.gdd300 86.0304 88.51 89.50 90.01 9.986
## gddspeed.gdd600 83.4769 83.94 90.43 90.68 9.322
## gddspeed.gdd900 41.0820 51.60 64.22 64.46 35.536
## radiations.gdd300 65.5144 71.11 79.08 79.09 20.911
## radiations.gdd600 46.2792 59.75 72.57 73.07 26.928
## radiations.gdd900 29.4812 51.72 68.53 69.74 30.260
## rainfall.gdd300 34.3459 50.33 60.81 61.90 38.104
## rainfall.gdd600 22.5380 30.77 68.98 70.93 29.070
## rainfall.gdd900 14.3834 18.44 61.43 62.63 37.373
## snowdays.gdd300 66.0953 67.55 84.99 90.75 9.247
## snowdays.gdd600 66.0953 67.55 84.99 90.75 9.247
## snowdays.gdd900 63.5685 66.57 83.55 89.40 10.597
```
```r
......@@ -426,7 +402,7 @@ dim(dat)
```
```
## [1] 222 30
## [1] 392 30
```
```r
......@@ -479,8 +455,8 @@ mod
## Number of trees: 150
## No. of variables tried at each split: 10
##
## Mean of squared residuals: 13.07629
## % Var explained: 55.78
## Mean of squared residuals: 22.33441
## % Var explained: 70.94
```
```r
......@@ -511,8 +487,8 @@ mod
## Number of trees: 100
## No. of variables tried at each split: 8
##
## Mean of squared residuals: 13.10248
## % Var explained: 55.69
## Mean of squared residuals: 22.47449
## % Var explained: 70.76
```
```r
......@@ -537,9 +513,9 @@ plotmo(mod, ylim = NA)
```
## plotmo grid: gddspeed.gdd300 radiations.gdd300 cumgdd60d rainfall.gdd900
## 39 4890.969 456.8318 2.860266
## slope northing easting lf
## 12.70785 -0.6139406 -0.1065332 5
## 43 4918.933 429.9286 0.003574589
## slope northing easting lf
## 13.24499 -0.3113239 -0.169907 5
```
![](README_files/figure-html/unnamed-chunk-17-1.png)<!-- -->
......
......@@ -46,7 +46,8 @@ import_from_db <- function(){
na.entries = data_biomass_h[which(is.na(data_biomass_h$hauteur)),]
unique(na.entries$ref_releve)
write.table(na.entries, file = "na_entries.txt", sep="\t", row.names=F, quote =F)
data_h = data_biomass_h %>% group_by(releve) %>% summarize(hmean=mean(hauteur), hsd=sd(hauteur), hmad = mad(hauteur), na.rm = TRUE)
data_biomass_h = data_biomass_h[-which(is.na(data_biomass_h$hauteur)),]
data_h = data_biomass_h %>% group_by(releve) %>% summarize(hmean=mean(hauteur), hsd=sd(hauteur), hmad = mad(hauteur))
# str(data_h)
# tail(data_h)
......
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
......@@ -57,10 +57,11 @@ saveRDS(sites_all, file = "sites_all.rds")
#=============================================
#--- Extract meteo data
# voir metadonnées https://en.aeris-data.fr/catalogue-en/ find "safran" S2M
# input : NoP, années, variables
# input : NoP, années, variables, sites_all
# output :
#=============================================
sapply(list.files("R_fct"), function(x)source(paste0("R_fct/",x)))
sites_all = readRDS("sites_all.rds")
data_h = readRDS("data_h.rds")
head(data_h)
......@@ -72,7 +73,7 @@ releves$year= unlist(lapply(releves$date_releve, substr, start = 1,stop=4))
# })))
# summary(releves$day_number)
head(releves)
# path_data_allslopes = "/Volumes/infogeo/Meteo_France/SAFRAN_montagne-Crocus_2020/alp_allslopes"
path_data_allslopes = "/Volumes/infogeo/Meteo_France/SAFRAN_montagne-Crocus_2020/alp_allslopes"
path_data_allslopes = "/Volumes/ISA-RESEARCH/alp_allslopes"
......@@ -87,8 +88,8 @@ library(dplyr)
# dim(res)
# dimnames(res)[[1]] = test$releve
dim(releves)
releves2 = releves[-which(releves$year>2018),]
dim(releves2)
releves2 = releves[-which(releves$year>2017),]
list_outputs <- lapply(unique(releves2$year), function(y){
print(y)
......@@ -153,7 +154,7 @@ head(releves_all[order(releves_all$releve),])
saveRDS("releves_all", file = "releves_all.rds")
########
library(raster)
mnt25m <- raster("/Volumes/ISA-RESEARCH/_DATA/zaa_mnt/mntAlpes_25m.tif")
aspect_alps <- raster("/Volumes/ISA-RESEARCH/_DATA/zaa_CHABLI_DB/_spatialManips/aspect_trigo_alps.tif")
slope_alps <- raster("/Volumes/ISA-RESEARCH/_DATA/zaa_CHABLI_DB/_spatialManips/slopeAlps.tif")
......
......@@ -13,6 +13,17 @@ vars = c("alti", "slope", "lf", "northing", "easting", "snowfree_time", "cumgdd0
"gddspeed.gdd300", "gddspeed.gdd600", "gddspeed.gdd900", "radiations.gdd300",
"radiations.gdd600", "radiations.gdd900", "rainfall.gdd300", "rainfall.gdd600",
"rainfall.gdd900", "snowdays.gdd300", "snowdays.gdd600", "snowdays.gdd900" )
vars = c("alti", "slope", "lf", "northing", "easting", "gddspeed.gdd300", "delta.gddspeed.300-600", ""
## variables 600 plutôt si corrélées
"snowfree_time", "cumgdd0", "cumgdd60d", "albedo.gdd300",
"albedo.gdd600", "albedo.gdd900", "frost_severe.gdd300", "frost_severe.gdd600",
"frost_severe.gdd900", "frost.gdd300", "frost.gdd600", "frost.gdd900",
"gddspeed.gdd300", "gddspeed.gdd600", "gddspeed.gdd900", "radiations.gdd300",
"radiations.gdd600", "radiations.gdd900", "rainfall.gdd300", "rainfall.gdd600",
"rainfall.gdd900", "snowdays.gdd300", "snowdays.gdd600", "snowdays.gdd900" )
dat = na.omit(releves_all[,vars])
dim(dat)
pca = dudi.pca(dat, scan=FALSE, nf = 4)
......@@ -28,24 +39,33 @@ s.corcircle(pca$co, xax=3, yax=4)
### ==== MODELE
dat = na.omit(releves_all[,c(vars, "hmean")])
dat = na.omit(releves_all[,c(vars, "hmean", "ref_typoveg")])
dat$lf = as.factor(dat$lf)
dat$ref_typoveg = as.factor(dat$ref_typoveg)
dim(dat)
library(randomForest)
mod = randomForest(hmean ~ gddspeed.gdd300 + radiations.gdd300 + cumgdd60d + rainfall.gdd300 + rainfall.gdd900 + frost_severe.gdd300 + slope + northing + easting + lf, data = dat, ntree = 150, mtry=16)
# plot(mod$rsq, type = "l", xlab = "nombre d'arbres", ylab = "erreur OOB")
mod = randomForest(hmean ~ gddspeed.gdd300 + radiations.gdd300 + cumgdd60d + rainfall.gdd300 + rainfall.gdd900 + frost_severe.gdd300 + slope + northing + easting + lf , data = dat, ntree = 100, mtry=4)
plot(mod$rsq, type = "l", xlab = "nombre d'arbres", ylab = "erreur OOB")
# library(caret)
# mod = caret::train(hmean ~ gddspeed.gdd300 + radiations.gdd300 + cumgdd0 + rainfall.gdd300 + rainfall.gdd900 + snowfree_time + frost_severe.gdd300 + slope + northing + easting + lf, data = dat, method = "rf", ntree=150)
# print(mod)
# print(mod$finalModel)
mod = randomForest(hmean ~ gddspeed.gdd300 + radiations.gdd300 + cumgdd60d + rainfall.gdd900 + slope + northing + easting + lf, data = dat, ntree = 100, mtry=10)
mod
varImpPlot(mod)
mod = randomForest(hmean ~ gddspeed.gdd300 + radiations.gdd300 + cumgdd60d + rainfall.gdd900 + slope + northing + easting + lf, data = dat, ntree = 100, mtry=16)
library(plotmo)
plotmo(mod, ylim = NA)
#### avec ref typoveg
mod = randomForest(hmean ~ gddspeed.gdd300 + radiations.gdd300 + cumgdd60d + rainfall.gdd300 + rainfall.gdd900 + frost_severe.gdd300 + slope + northing + easting + lf + ref_typoveg, data = dat, ntree = 100, mtry=4)
# plot(mod$rsq, type = "l", xlab = "nombre d'arbres", ylab = "erreur OOB")
mod
library(caret)
mod = caret::train(hmean ~ gddspeed.gdd300 + radiations.gdd300 + cumgdd0 + rainfall.gdd300 + rainfall.gdd900 + snowfree_time + frost_severe.gdd300 + slope + northing + easting + lf + ref_typoveg, data = dat, method = "rf", ntree=100)
print(mod)
print(mod$finalModel)
mod = randomForest(hmean ~ gddspeed.gdd300 + radiations.gdd300 + cumgdd60d + rainfall.gdd300 + rainfall.gdd900 + frost_severe.gdd300 + slope + northing + easting + lf + ref_typoveg, data = dat, ntree = 100, mtry=14)
varImpPlot(mod)
library(plotmo)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment