public void SuicideProbability() { //this test is correct with default suicide_result if he still has only 2 posts Client cl = new User("durov"); string id = cl.Link; // calling script to process data and make prediction PythonRunner.RunScript(AppSettings.PythonScriptPath, AppSettings.PythonPath); Thread.Sleep(10000); //get prediction double res = cl.SuicideProbability(DateTime.MinValue, DateTime.MaxValue, id); //disabling script IPEndPoint ipe = new IPEndPoint(AppSettings.LocalIP, AppSettings.ClientPort); Socket socket = new Socket(ipe.AddressFamily, SocketType.Stream, ProtocolType.Tcp); socket.Connect(ipe); Byte[] bytesSent = Encoding.UTF32.GetBytes("~exit~::"); socket.Send(bytesSent, bytesSent.Length, 0); //+ Check correctness with your eyes Console.WriteLine(res); Assert.IsTrue(res < 0.999 && res >= 0.00); }
protected void Application_Start() { AreaRegistration.RegisterAllAreas(); FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); RouteConfig.RegisterRoutes(RouteTable.Routes); BundleConfig.RegisterBundles(BundleTable.Bundles); PythonRunner.RunScript(AppSettings.PythonScriptPath, AppSettings.PythonPath); }
public void RunTest() { PythonRunner.RunScript(AppSettings.PythonScriptPath, AppSettings.PythonPath); }