/// <summary> /// /// </summary> private void Bind() { Formula f = FormulaFactory.Create(this.FormulaID); this.txtStationName.Text = f.Device.StationName; this.txtBegin.Text = f.BeginString; this.txtEnd.Text = f.EndString; this.txtFormula.Text = f.FormulaString; }
/// <summary> /// /// </summary> /// <returns></returns> private Formula GetFormula() { Formula f = null; if (IsEdit()) { f = FormulaFactory.Create(this.FormulaID); } else { f = new Formula(); f.Device = GetDevice(); } return(f); }
static void ItemItemStart() { FileReader fReader = new FileReader(); Dictionary<int, UserPref> userList = fReader.GetData(); Dictionary<string, float> fileMetaData = fReader.GetMetaData(); FormulaFactory forFactory = new FormulaFactory(); ItemComparer itemComparer = new ItemComparer(fReader.allProducts, userList); int targetUserID = 186; int targetProductID = 172; DateTime startTime = DateTime.Now; itemComparer.PredictRating(userList[targetUserID], targetProductID); // var x = itemComparer.PredictTopRatings(userList[targetUserID], 5); DateTime endTime = DateTime.Now; Console.WriteLine("Calculating the predicted rating took {0} ms",(endTime-startTime).Milliseconds); //itemComparer.AddNewRating(userList[3],105,4); //var y = itemComparer.PredictTopRatings(userList[targetUserID], 5); Console.Read(); }
static void UserItemStart() { FileReader fReader = new FileReader(); Dictionary<int, UserPref> userList = fReader.GetData(); Dictionary<string, float> fileMetaData = fReader.GetMetaData(); FormulaFactory forFactory = new FormulaFactory(); NeighbourFinder nFinder = new NeighbourFinder(forFactory.GetFormula(fileMetaData)); int targetUserID = 186; Dictionary<int, double> neighbourList = nFinder.FindNeighbours(targetUserID, userList); foreach (var neighbour in neighbourList) { Console.WriteLine("Neighbour {0} has a similarity of {1}", neighbour.Key, neighbour.Value); } RatingPredictor rPredictor = new RatingPredictor(); rPredictor.PredictRatings(userList, targetUserID, neighbourList); rPredictor.GetTopPredictedRatings(8); Console.Read(); }
void Awake() { Instance = this; }