/// <summary>
        /// create a normalized data "table" from the DataSet using numerizer. At
        /// this stage, the data isnot split into input pattern and targets TODO
        /// remove redundancy of recreating the target columns. the numerizer has
        /// already isolated the targets
        /// </summary>
        /// <param name="ds"></param>
        /// <param name="numerizer"></param>
        public void CreateNormalizedDataFromDataSet(DataSet ds, INumerizer numerizer)
        {
            ICollection <ICollection <double> > rds = rawExamplesFromDataSet(ds, numerizer);

            // normalize raw dataset
            nds = normalize(rds);
        }
Esempio n. 2
0
        /// <summary>
        /// create a normalized data "table" from the DataSet using numerizer. At
        /// this stage, the data isnot split into input pattern and targets TODO
        /// remove redundancy of recreating the target columns. the numerizer has
        /// already isolated the targets
        /// </summary>
        /// <param name="ds"></param>
        /// <param name="numerizer"></param>
        public void CreateNormalizedDataFromDataSet(DataSet ds, INumerizer numerizer)
        {
            IList <IList <double> > rds = this.RawExamplesFromDataSet(ds, numerizer);

            // normalize raw dataset
            Nds = this.Normalize(rds);
        }
Esempio n. 3
0
        private IList <IList <double> > RawExamplesFromDataSet(DataSet ds, INumerizer numerizer)
        {
            // assumes all values for inout and target are doubles
            IList <IList <double> > rds = new List <IList <double> >();

            for (int i = 0; i < ds.Count; i++)
            {
                IList <double> rexample = new List <double>();
                Example        e        = ds.GetExample(i);
                Pair <IList <double>, IList <double> > p = numerizer.Numerize(e);
                IList <double> attributes = p.GetFirst();
                foreach (double d in attributes)
                {
                    rexample.Add(d);
                }
                IList <double> targets = p.GetSecond();
                foreach (double d in targets)
                {
                    rexample.Add(d);
                }
                rds.Add(rexample);
            }
            return(rds);
        }
        private ICollection <ICollection <double> > rawExamplesFromDataSet(DataSet ds, INumerizer numerizer)
        {
            // assumes all values for inout and target are doubles
            ICollection <ICollection <double> > rds = CollectionFactory.CreateQueue <ICollection <double> >();

            for (int i = 0; i < ds.size(); ++i)
            {
                ICollection <double> rexample = CollectionFactory.CreateQueue <double>();
                Example e = ds.getExample(i);
                Pair <ICollection <double>, ICollection <double> > p = numerizer.Numerize(e);
                ICollection <double> attributes = p.GetFirst();
                foreach (double d in attributes)
                {
                    rexample.Add(d);
                }
                ICollection <double> targets = p.getSecond();
                foreach (double d in targets)
                {
                    rexample.Add(d);
                }
                rds.Add(rexample);
            }
            return(rds);
        }
 /// <summary>
 /// method called by clients to set up data set and make it ready for processing
 /// </summary>
 /// <param name="ds"></param>
 /// <param name="numerizer"></param>
 public void CreateExamplesFromDataSet(DataSet ds, INumerizer numerizer)
 {
     CreateNormalizedDataFromDataSet(ds, numerizer);
     SetTargetColumns();
     createExamples();
 }