예제 #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));
 }