public ActionResult IndexP(ValidTest model) { if (ModelState.IsValid) { return(PartialView("_DateToDate")); } return(PartialView("_DateToDate")); }
public ActionResult Index(ValidTest model) { if (ModelState.IsValid) { return(View("Success")); } return(View()); }
// GET: Validation public ActionResult Index(ValidTest valid) { if (String.IsNullOrEmpty(Request.Form.Get("SignIn"))) { //List<ValidTest> validTests = new List<ValidTest>(); //validTests.Add(new ValidTest { StudentName = "小王", StudentID = "1" }); return(View()); } else { return(View(valid)); } }
private protected override bool ShouldStop(IChannel ch, ref EarlyStoppingRuleBase earlyStoppingRule, ref int bestIteration) { if (FastTreeTrainerOptions.EarlyStoppingRuleFactory == null) { return(false); } ch.AssertValue(ValidTest); ch.AssertValue(TrainTest); var validationResult = ValidTest.ComputeTests().First(); ch.Assert(validationResult.FinalValue >= 0); bool lowerIsBetter = validationResult.LowerIsBetter; var trainingResult = TrainTest.ComputeTests().First(); ch.Assert(trainingResult.FinalValue >= 0); // Create early stopping rule if it's null. if (earlyStoppingRule == null) { if (FastTreeTrainerOptions.EarlyStoppingRuleFactory != null) { earlyStoppingRule = FastTreeTrainerOptions.EarlyStoppingRuleFactory.CreateComponent(Host, lowerIsBetter); } } // Early stopping rule cannot be null! ch.Assert(earlyStoppingRule != null); bool isBestCandidate; bool shouldStop = earlyStoppingRule.CheckScore((float)validationResult.FinalValue, (float)trainingResult.FinalValue, out isBestCandidate); if (isBestCandidate) { bestIteration = Ensemble.NumTrees; } return(shouldStop); }
static async Task Main(string[] args) { var validator = TestValidator.GetInstance(); var validTest = new ValidTest(_validRequest1); var invalidTest = new InvalidTest(_invalidRequest1); await validator.TestRegister(); await validator.TestCurrencyExchanger(validTest); await validator.TestCurrencyExchanger(validTest.NewRequest(_validRequest2)); await validator.TestCurrencyExchanger(validTest.NewRequest(_validRequest3)); await validator.TestCurrencyExchanger(invalidTest); await validator.TestCurrencyExchanger(invalidTest.NewRequest(_invalidRequest2)); await validator.TestCurrencyExchanger(invalidTest.NewRequest(_invalidRequest3)); }
protected override bool ShouldStop(IChannel ch, ref IEarlyStoppingCriterion earlyStoppingRule, ref int bestIteration) { if (Args.EarlyStoppingRule == null) { return(false); } ch.AssertValue(ValidTest); ch.AssertValue(TrainTest); var validationResult = ValidTest.ComputeTests().First(); ch.Assert(validationResult.FinalValue >= 0); bool lowerIsBetter = validationResult.LowerIsBetter; var trainingResult = TrainTest.ComputeTests().First(); ch.Assert(trainingResult.FinalValue >= 0); // Create early stopping rule. if (earlyStoppingRule == null) { earlyStoppingRule = Args.EarlyStoppingRule.CreateComponent(Host, lowerIsBetter); ch.Assert(earlyStoppingRule != null); } bool isBestCandidate; bool shouldStop = earlyStoppingRule.CheckScore((Float)validationResult.FinalValue, (Float)trainingResult.FinalValue, out isBestCandidate); if (isBestCandidate) { bestIteration = Ensemble.NumTrees; } return(shouldStop); }