/// <summary> /// soma as distancias minimas encontradas e aplica a /// formula de estatistica de hopkins /// </summary> /// <returns>Hopkins</returns> private double CalculoFinal() { double u = Convert.ToDouble(RegAleatorios.AsEnumerable().Sum(x => x.Field <double>("DistanciaMin"))); double w = Convert.ToDouble(RegAmostraBanco.AsEnumerable().Sum(x => x.Field <double>("DistanciaMin"))); return(u / (u + w)); }
private void PreencherAmostraBanco() { /*Preenche com registro aleatorios do banco 25%*/ var rdn = new Random(); var aux = new List <int>(); for (int j = 0; j < Convert.ToInt32(Dados.Rows.Count / 4.0); j++) { var i = rdn.Next(Dados.Rows.Count); while (aux.IndexOf(i) >= 0) { i = rdn.Next(Dados.Rows.Count); } aux.Add(i); RegAmostraBanco.ImportRow(Dados.Rows[i]); RegAmostraBanco.Rows[RegAmostraBanco.Rows.Count - 1]["indexOriginal"] = i; } }