Exemplo n.º 1
0
        /// <summary>
        /// Возвращает новое значение для объекта строкового типа
        /// </summary>
        /// <param name="value">Старое значение</param>
        /// <returns></returns>
        private double GetString(string value)
        {
            string key = String.IsNullOrEmpty(value) ? "None" : value;

            double[] result = netWorker.Process(map[key]);
            return(result[0]);
        }
Exemplo n.º 2
0
        public List<Viewer> Analyze(XLSReader Reader, List<int> sample)
        {
            P = 0;
            N = 0;
            TP = 0;
            FP = 0;
            TN = 0;
            FN = 0;
            List<Viewer> resList = new List<Viewer>();
            StringBuilder inputString = new StringBuilder();
            StringBuilder storesString = new StringBuilder();
            double[] input = new double[objPreparator.Count];
            double[] result;
            int index;
            foreach (int i in Reader.ReadRow(sample: sample))
            {
                inputString.Clear();
                storesString.Clear();
                foreach (var obj in Reader.ReadColumn(i, 4))
                {
                    inputString.Append(obj.Item2 + ", ");
                    input[obj.Item1 - 4] = objPreparator.GetValue(obj.Item1, obj.Item2);
                    storesString.Append(input[obj.Item1 - 4] + ", ");
                }
                result = NetWorker.Process(input);
                index = result[0] >= 0.5 ? 0 : 1;
                CalculateStat(Reader, i, index);
                inputString.Remove(inputString.Length - 2, 2);
                storesString.Remove(storesString.Length - 2, 2);
                resList.Add(new Viewer { Input = inputString.ToString(), Prep = storesString.ToString(), Res = index.ToString() });
            }

            return resList;
        }