✅ Перевірена відповідь на це питання доступна нижче. Наші рішення, перевірені спільнотою, допомагають краще зрозуміти матеріал.
This summarises a linear support vector machine fit to the last 25 years of Australian tourism data modeling the difference in patterns between Cairns and Melbourne. Only holiday travel is examined, and the four variables used are Q1, Q2, Q3, Q4 which are quarters in the year. Each series was standardised on itself, so values represent proportion of travel for holidays relative to other types of travel to the city in each quarter of each year. We are curious to determine whether holiday travel tends to be in different seasons in the two locations.
> melb_cairns_svm_h$fit@b
[1] -2.4
> melb_cairns_svm_h$fit@SVindex
[1] 3 5 9 10 11 12 14 17 19 20 21 23 24 30 35 36 37 38 39 40
[21] 41 42 44 46 47 50
> melb_cairns_svm_h$fit@coef
[[1]]
[1] -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -1.8
[11] -10.0 -10.0 -10.0 1.8 10.0 10.0 10.0 10.0 10.0 10.0
[21] 10.0 10.0 10.0 10.0 10.0 10.0
The top few rows of the data are:
> melb_cairns[,c(1,3,5,7,9)] |> slice_head(n=5)
# A tibble: 5 × 5
Region Q1 Q2 Q3 Q4
1 Cairns 0.259 0.220 0.629 0.300
2 Cairns 0.205 0.345 0.586 0.348
3 Cairns 0.272 0.475 0.500 0.275
4 Cairns 0.173 0.533 0.523 0.380
5 Cairns 0.360 0.498 0.565 0.374
The coefficients for the separating hyperplane plane are calculated to be:
> melb_cairns_betas_h
Q1 Q2 Q3 Q4
4.76 0.80 -8.95 -0.57