Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

162
Visualizações
different results using R in windows and linux

I have a problem using kmeans in a ubuntu system. I seem to be getting different results! My data is say:

x<- c(0.1295..,-0.58928,-0.244252,-0.41614,-0.58804,-0.74628,-0.9045188,-1.050903,-1.197288,-1.3353877,-1.47348656,-1.607894)

when I perform kmeans function and want to get only the max value of kmeans$centers in a windows system,

means <- max(kmeans(x, 3)$centers)
means
[1] -0.05892

When I run the exact code in ubuntu 12.04 system, I get a completely different answer

means <- max(kmeans(x,3)$centers)
means
[1] -0.1482334

So, I performed the kmeans again without the max function

means <- kmeans(x, 3)
means$centers
NULL

But, means itself has all the entries

means


Available components:
[1] "cluster" "centers" "tots" "withinss" "tot.withinss"
[6] "betweenss" "size" "iter" "ifault"

There seems to be something changing between the functionality in windows and linux. Can anyone help me figuring this out?!

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

A k-means algorithm generally is not deterministic, i.e., it usually does not lead to perfectly reproducible results. The main reason is that in common algorithms the initialization is random.

As discussed in ?kmeans

trying several random starts (nstart> 1) is often recommended

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda