From aeffccedf2dcedea79779e63799bb1d4ceea9e43 Mon Sep 17 00:00:00 2001 From: Cesar De la Torre Llorente Date: Fri, 2 Aug 2019 11:19:41 -0700 Subject: [PATCH] Minor change so only needed files are copied. Training dataset is not needed for scoring in the sample --- .../Program.cs | 9 +- .../assets/input/randomizedPca.zip | Bin 0 -> 7215 bytes .../assets/input/testData.csv | 57289 ++++++++++++++++ 3 files changed, 57295 insertions(+), 3 deletions(-) create mode 100644 samples/csharp/getting-started/AnomalyDetection_CreditCardFraudDetection/CreditCardFraudDetection.Predictor/assets/input/randomizedPca.zip create mode 100644 samples/csharp/getting-started/AnomalyDetection_CreditCardFraudDetection/CreditCardFraudDetection.Predictor/assets/input/testData.csv diff --git a/samples/csharp/getting-started/AnomalyDetection_CreditCardFraudDetection/CreditCardFraudDetection.Predictor/Program.cs b/samples/csharp/getting-started/AnomalyDetection_CreditCardFraudDetection/CreditCardFraudDetection.Predictor/Program.cs index 13583a3b5..36eea1596 100644 --- a/samples/csharp/getting-started/AnomalyDetection_CreditCardFraudDetection/CreditCardFraudDetection.Predictor/Program.cs +++ b/samples/csharp/getting-started/AnomalyDetection_CreditCardFraudDetection/CreditCardFraudDetection.Predictor/Program.cs @@ -12,11 +12,12 @@ static void Main(string[] args) string assetsPath = GetAbsolutePath(@"../../../assets"); string trainOutput = GetAbsolutePath(@"../../../../CreditCardFraudDetection.Trainer/assets/output"); - CopyModelAndDatasetFromTrainingProject(trainOutput, assetsPath); - var inputDatasetForPredictions = Path.Combine(assetsPath, "input", "testData.csv"); var modelFilePath = Path.Combine(assetsPath, "input", "randomizedPca.zip"); + //Always copy the trained model from the trainer project just in case there's a new version trained. + CopyModelAndDatasetFromTrainingProject(trainOutput, assetsPath); + // Create model predictor to perform a few predictions var modelPredictor = new Predictor(modelFilePath, inputDatasetForPredictions); @@ -50,7 +51,9 @@ public static void CopyModelAndDatasetFromTrainingProject(string trainOutput, st LocalConsoleHelper.DeleteAssets(fileDestination); } - File.Copy(file, Path.Combine(Path.Combine(assetsPath, "input"), Path.GetFileName(file))); + //Only copy the files we need for the scoring project + if ((Path.GetFileName(file) == "testData.csv") || (Path.GetFileName(file) == "randomizedPca.zip")) + File.Copy(file, Path.Combine(Path.Combine(assetsPath, "input"), Path.GetFileName(file))); } } diff --git a/samples/csharp/getting-started/AnomalyDetection_CreditCardFraudDetection/CreditCardFraudDetection.Predictor/assets/input/randomizedPca.zip b/samples/csharp/getting-started/AnomalyDetection_CreditCardFraudDetection/CreditCardFraudDetection.Predictor/assets/input/randomizedPca.zip new file mode 100644 index 0000000000000000000000000000000000000000..415a6e2cd86b2df74ed98622fddefdec95e8fc61 GIT binary patch literal 7215 zcmb7J1yG!6wuRtMa3=(pV8LA*_aF&wjk{Y&a1HLRL4r1JL4rF85Tqe!W5Hct&(7P) z4!is2P5<>*-M_o)+`8vK_jY~fsw%+2ggIi+=>~%P9(Mh{^GG^zo%c9h0W0?jf9(}a3h%^#!-ac z(SC_I2JuCA8M%mX9${cA=Ra+}wp{oA%HCYD3t78wS^ALj5ADEV*z%)mwJv`+m2yFCaonE zT=&{`P{=*59Uvi}6cK@{Rw$3Jc9L-nr#{isJWH>94A-;22f$GgCc&QA4q>m`m8r%bKF8do(iyUy7x-$5-J3rifIGeGW~ zvPgX~XnGuUEB}^ye8A;6;8ywmng7tk!=xAqjvSr7mFY~}`06vP3bAt4r`~WC;=2>N z<*yq)&IpvdYaNWNjI51pj6g=VM|MYdy*_xid;RkgZp(0{Vf0pygo`$Gp6 zDm75eWBc)?u?w_Z!uEyr@$thZ(58wlKBc0P$iO4IrGDs{%sJL951brrH85NT@1BvM zNI79gz>=l152xP1Hzi}ep!7SW!F$UR|7}HjO-_x_3sTnXePr#)TccX!5+r1?TYkg zjx5Ci$%jymaGv~ajyQjDRIeg#-_4Fq_M@+K6#;)$Cr?7xNuuOQ_xsdbrq%3psR-nT z#2~m#PdqF$vWBN67JHvOfbMO(43tc%qjz*9jw>RK0*yf*4hdKES8}=uziJ*9bhHz& zwdh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