Quadratic discriminant analysis, qda, has all the same parameters as lda with the exception ofrrlda since there is no opportunity to reduce the dimensions.
- julia> qda_mod = qda(fm, iris[train,:], gamma=0.1, tol=0.0001)
- Formula: Species ~ :(+(Sepal_Length,Sepal_Width,Petal_Length,Petal_Width))
- Response:
- 3x3 DataFrame:
- Group Prior Count
- [1,] "setosa" 0.333333 37
- [2,] "versicolor" 0.333333 37
- [3,] "virginica" 0.333333 38
- Gamma: 0.1
- Class means:
- 3x5 DataFrame:
- Group Sepal_Length Sepal_Width Petal_Length Petal_Width
- [1,] "setosa" 5.01622 3.48649 1.46757 0.243243
- [2,] "versicolor" 5.87297 2.77568 4.23514 1.32973
- [3,] "virginica" 6.68158 2.98158 5.59474 2.03421
- julia> qda_pred = predict(qda_mod,iris[test,:])
- 38x1 PooledDataArray{UTF8String,Uint32,2}:
- "setosa"
- ⋮
- "virginica"
- julia> 100*sum(qda_pred .== y[test])/length(y[test])
- 100.0
- julia> scaling(qda_mod)
- 4x4x3 Array{Float64,3}:
- [:, :, 1] =
- -0.718864 0.225921 -2.21662 1.08868
- -1.87503 -0.911666 1.57226 -0.984448
- -0.10516 1.58782 -0.841958 -2.53646
- -0.554306 4.69676 2.47484 2.86637
- [:, :, 2] =
- -0.540377 0.689292 -1.69643 -0.712444
- -0.648636 -2.67637 -0.628192 0.760625
- -0.741854 0.837311 0.729449 1.83986
- -1.25651 -0.245052 2.69873 -3.94103
- [:, :, 3] =
- 0.633468 -0.535131 0.304746 1.55392
- 0.438729 0.726428 2.40918 -0.750259
- 0.716968 -0.576765 -0.461987 -1.65265
- 1.13231 2.37764 -1.89922 0.656749


雷达卡



京公网安备 11010802022788号







