示例#1
0
        public PropertyModel Statistics(PropertyModel property, Double[] original, Double[] predicted)
        {


            int length = (predicted.Length <= original.Length) ? predicted.Length : original.Length;

            double[] dist = new double[length];

            if (length == 0)
                return null;
            else
            {
                int count = 0;
                for (int i = 0; i < length; i++)
                {
                    dist[i] = Math.Abs(original[i] - predicted[i]);
                    if (dist[i] <= property.Threshold)
                        count++;
                    i++;
                }
                property.Minimum = dist.Min();
                property.Maximum = dist.Max();
                property.Average = dist.Sum() / length;
                property.Accuracy = (double)count * 100 / length;

                return property;

            }

        }
示例#2
0
 public PropertyModel(PropertyModel p) {
     
     KNN = p.KNN;
     Exponent = p.Exponent;
     Threshold = p.Threshold;
     Accuracy = p.Accuracy;
     Average = p.Average;
     Maximum = p.Maximum;
     Minimum = p.Minimum;
 }
示例#3
0
 public DeviceModel(DeviceModel d)
 {
     Id = d.Id;
     Mac = d.Mac;
     Name = d.Name;
     XLocation = d.XLocation;
     YLocation = d.YLocation;
     RSSValue = d.RSSValue;
     Property = new PropertyModel(d.Property);
 }
示例#4
0
 public DeviceModel()
 {
     RSSValue = new double[] { };
     Property = new PropertyModel();
 }
示例#5
0
 public void GetStatistics(Double[] a, Double[] b)
 {
     Property = new PropertyModel(WifiLocalization.Manager.Instance.GetStatistics(this.Property, a, b));
 }
示例#6
0
 /// <summary>
 /// Uses PropertyModel.Thershold
 /// Takes List<LocationModel(){original,predicted}>
 /// </summary>
 /// <returns>PropertyModel Statistics : Acc%,Avg,Max,Min</returns>
 public PropertyModel GetStatistics(PropertyModel property, Double[] original, Double[] predicted)
 {
     return WifiLocalization.Implement.Instance.Statistics(property, original, predicted);
 }
示例#7
0
 public DeviceModel()
 {
     RSSValue = new double[] { };
     Property = new PropertyModel();
 }
示例#8
0
 public void GetStatistics(Double[] a, Double[] b)
 {
     Property = new PropertyModel(WifiLocalization.Manager.Instance.GetStatistics(this.Property, a, b));
 }