Hi Team,

I am trying to run kmeans in R, and I need to save the different clusters
into different folders. How can I achieve this?

# this is how my data looks.
$ *cat 1.tsv | head*
userid   bookid   rating   bookTotalRatings   bookAvgRating
userTotalRatings   userAvgRating
1    100    0    24    2.7916666666666665    291    2.6735395189003435
2    200    7    24    2.9583333333333335    6    7.0
3    300    0    24    1.7916666666666667    874    0.7963386727688787
4    400    8    24    4.291666666666667    1    8.0
5    500    5    24    2.4166666666666665    291    2.6735395189003435

$R
> *input_tail <- read.table("1.tsv", header=FALSE, sep="\t")
*
> *clustering_tail <- kmeans(input_tail, 5) *

> *print(clustering_tail)*
...
[99973] 4 4 4 4 4 4 4 2 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4

Within cluster sum of squares by cluster:
[1] 2.731015e+26 8.785281e+22 4.726557e+26 3.513411e+22 5.092071e+25
 (between_SS / total_SS =  98.9 %)

Available components:
[1] "cluster"      "centers"      "totss"        "withinss"
"tot.withinss"
[6] "betweenss"    "size"


*Now how to I save these 5 clusters into 5 separate folders? *

Please advise,
Thanks.

	[[alternative HTML version deleted]]

