[R] In SOM package all entities are predicted to the same class

Ranjana Girish ranjanagirish30 at gmail.com
Sat Oct 8 13:23:43 CEST 2016


From: "Ranjana Girish" <ranjanagirish30 at gmail.com>
Date: Oct 7, 2016 3:39 PM
Subject: Re:In SOM package all entities are predicted to the same class

Cc: <r-help at r-project.org>

> Even after trying with different parameters of SOM still all entities are
getting predicted to same class..
>
> Note: for each run, class are different because nrow considers train set
each time randomly.
>
> 1)som.prediction$unit.classif
> som.wines <- som(ScaledNonNAtraining, grid = somgrid(5, 5, "hexagonal"))
> [1]  4  4  4  4 23  4  4  4  4  4  4  4  4  4  4  4 21  4  4  4  4  4  4
 4  4  4  4  4  4  4
> [31]  4  4  4  4  4  4  4  4  4  4  4  4  4  4  4  4  4  4  4  4  4  4  4
 4  4  4  4  4  4  4
> [61]  4  4  4  4  4  4  4  4  4  4  4  4  4  4  4  4  4  4  4  4  4  4  4
 4  4  4  4  4  4  4
> [91]  4  4  4  4  4  4  4  4  4  4  4  4  4  4  4  4  4  4  4  4  4  4  4
 4  4  4  4  4  4  4
> [121]  4  4  4  4  4  4  4  4  4  4  4  4  4  4  4  4  4  4  4  4  4  4
 4  4  4  4  4  4  4  4
> [151]  4  4  4  4  4  4  4  4  4  4  4  4  4  4  4  4  4  4  4  4  4  4
 4  4  4  4  4  4  4  4
> [181]  4  4  4  4  4  4  4  4  4  4  4  4  4  4  4  4  4  4  4  4  4  4
 4  4  4  4  4  4  4  4
> [211]  4  4  4  4  4  4  4  4  4  4  4  4  4  4  4  4  4  4  4  4  4  4
 4  4  4  4  4  4  4  4
> [241]  4  4  4  4  4  4  4  4  4
> Accuracy 2.811245
>
> 2)som.wines <- som(ScaledNonNAtraining, grid = somgrid(5, 5,
"rectangular")) som.prediction$unit.classif [1] 15 15 15 15 15 15 15 15 15
15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15
[35] 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 2 15 15 15 15
15 15 15 15 15 15 15 15 15 15 [69] 15 15 15 15 15 15 15 15 15 15 15 15 15
15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 [103] 15 15
15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15
15 15 15 15 15 15 15 [137] 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15
15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 1 15 [171] 15 15 15 15 15
15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 2 25 25 15 15 15 15 15
15 15 15 15 [205] 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 2 15 15 15
15 15 15 15 15 2 15 15 15 15 15 15 15 15 15 [239] 15 15 15 15 15 15 15 15
15 15 15 accuracy [1] 1.204819
>
> 3)som.wines <- som(ScaledNonNAtraining, grid = somgrid(5, 5,
"rectangular"), rlen = 5000) som.prediction$unit.classif [1] 25 25 25 25 25
25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25
25 25 25 25 [35] 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25
25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 [69] 25 25 25 25 25 25 25 25
25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25
25 [103] 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25
25 25 25 25 25 25 25 25 25 25 25 25 [137] 25 25 25 25 25 25 25 25 25 25 25
25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 [171]
25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 4 25 25
25 25 25 25 25 25 25 25 25 [205] 25 25 25 25 25 25 25 25 25 25 25 25 25 25
25 4 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 [239] 25 25 25
25 25 25 25 25 25 25 25 accuracy [1] 0
>
> 4)om.wines <- som(ScaledNonNAtraining, grid = somgrid(5, 5,
"rectangular"), alpha = 0.15, rlen = 5000) som.prediction$unit.classif [1]
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1 1 1 [52] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 [103] 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 [154] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 [205] 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
>
>

	[[alternative HTML version deleted]]



More information about the R-help mailing list