public Form1() { InitializeComponent(); makeArrays(); dataPictureBoxHeight = pictureBoxFF.Size.Height; dataPictureBoxLocationY = pictureBoxFF.Location.Y; dataTrackBarRange = trackBarFF.Maximum - trackBarFF.Minimum; infer = new Inference(nRanks); userInput = new UserData(); initializeUserData(); intializeDependentComponents(); createClicks(); showResults(infer.performInference(userInput)); }
public DocumentStatistics[] performInference(UserData user) { ie.NumberOfIterations = user.nIters; Console.WriteLine("No. of Iterations = {0}", user.nIters); DocumentStatistics[] docStats = new DocumentStatistics[nRanks]; for (int i = 0; i < nRanks; i++) { docStats[i] = new DocumentStatistics(); } nUsers.ObservedValue = user.nUsers; probNextIfNotClick.ObservedValue = user.probExamine[0]; probNextIfClickNotRel.ObservedValue = user.probExamine[1]; probNextIfClickRel.ObservedValue = user.probExamine[2]; for (int d = 0; d < nRanks; d++) click[d].ObservedValue = user.clicks[d]; try { for (int d = 0; d < nRanks; d++) { docStats[d].inferredRelevance = ie.Infer<Beta>(relevance[d]); docStats[d].inferredAppeal = ie.Infer<Beta>(appeal[d]); } return docStats; } catch (Exception e) { Console.WriteLine(e); return null; } }