Skip to content

Commit

Permalink
Minor change so only needed files are copied. Training dataset is not…
Browse files Browse the repository at this point in the history
… needed for scoring in the sample
  • Loading branch information
CESARDELATORRE committed Aug 2, 2019
1 parent 7cb26f3 commit aeffcce
Show file tree
Hide file tree
Showing 3 changed files with 57,295 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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)));
}
}

Expand Down
Binary file not shown.
Loading

0 comments on commit aeffcce

Please sign in to comment.