private List <List <Double> > rawExamplesFromDataSet(DataSet ds, Numerizer numerizer) { // assumes all values for inout and target are doubles List <List <Double> > rds = new List <List <Double> >(); for (int i = 0; i < ds.size(); i++) { List <Double> rexample = new List <Double>(); Example e = ds.getExample(i); Pair <List <Double>, List <Double> > p = numerizer.numerize(e); List <Double> attributes = p.getFirst(); foreach (Double d in attributes) { rexample.Add(d); } List <Double> targets = p.getSecond(); foreach (Double d in targets) { rexample.Add(d); } rds.Add(rexample); } return(rds); }
/* * 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 */ public void createNormalizedDataFromDataSet(DataSet ds, Numerizer numerizer) { List <List <Double> > rds = rawExamplesFromDataSet(ds, numerizer); // normalize raw dataset nds = normalize(rds); }
/* * 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 */ public void createNormalizedDataFromDataSet(DataSet ds, Numerizer numerizer) { List<List<Double>> rds = rawExamplesFromDataSet(ds, numerizer); // normalize raw dataset nds = normalize(rds); }
static string NumerizeLongScale(long r, string s) { string numerizedInput = null; try { numerizedInput = Numerizer.Numerize(s, true); } catch (Exception ex) { throw new Exception( String.Format( "Test case: {0} => {1} :: {2}", s, r, ex.Message), ex); } return(numerizedInput); }
static string Numerize(int r, string s, string culture = "en") { Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo(culture); string numerizedInput = null; try { numerizedInput = Numerizer.Numerize(s); } catch (Exception ex) { throw new Exception( String.Format( "Test case: {0} => {1} :: {2}", s, r, ex.Message), ex); } return(numerizedInput); }
private static string Numerize(int r, string s) { string numerizedInput = null; try { numerizedInput = Numerizer.Numerize(s); } catch (Exception ex) { throw new Exception( string.Format( "Test case: {0} => {1} :: {2}", s, r, ex.Message), ex); } return(numerizedInput); }
public void test_edges_in_french() { Assert.Equal( "27 Oct 2006 7h30", Numerizer.Numerize("27 Oct 2006 7h30")); }
public void test_edges() { Assert.Equal( "27 Oct 2006 7:30am", Numerizer.Numerize("27 Oct 2006 7:30am")); }
/* * method called by clients to set up data set and make it ready for * processing */ public void createExamplesFromDataSet(DataSet ds, Numerizer numerizer) { createNormalizedDataFromDataSet(ds, numerizer); setTargetColumns(); createExamples(); }
public static string Numerize(this string @this, bool intendingTime) { return(Numerizer.Numerize(@this, intendingTime)); }
public static string Numerize(this string @this) { return(Numerizer.Numerize(@this)); }
private List<List<Double>> rawExamplesFromDataSet(DataSet ds, Numerizer numerizer) { // assumes all values for inout and target are doubles List<List<Double>> rds = new List<List<Double>>(); for (int i = 0; i < ds.size(); i++) { List<Double> rexample = new List<Double>(); Example e = ds.getExample(i); Pair<List<Double>, List<Double>> p = numerizer.numerize(e); List<Double> attributes = p.getFirst(); foreach (Double d in attributes) { rexample.Add(d); } List<Double> targets = p.getSecond(); foreach (Double d in targets) { rexample.Add(d); } rds.Add(rexample); } return rds; }