public static void CopyModelAndDatasetFromTrainingProject(string trainOutput, string assetsPath)
        {
            if (!File.Exists(Path.Combine(trainOutput, "testData.csv")) ||
                !File.Exists(Path.Combine(trainOutput, "randomizedPca.zip")))
            {
                Console.WriteLine("***** YOU NEED TO RUN THE TRAINING PROJECT FIRST *****");
                Console.WriteLine("=============== Press any key ===============");
                Console.ReadKey();
                Environment.Exit(0);
            }

            // Copy files from train output
            Directory.CreateDirectory(assetsPath);

            foreach (var file in Directory.GetFiles(trainOutput))
            {
                var fileDestination = Path.Combine(Path.Combine(assetsPath, "input"), Path.GetFileName(file));

                if (File.Exists(fileDestination))
                {
                    LocalConsoleHelper.DeleteAssets(fileDestination);
                }

                //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)));
                }
            }
        }
Example #2
0
        private static void CopyModelAndDatasetFromTrainingProject(string trainOutput, string assetsPath)
        {
            if (!File.Exists(Path.Combine(trainOutput, "testData.csv")) ||
                !File.Exists(Path.Combine(trainOutput, "fastTree.zip")))
            {
                Console.WriteLine("***** YOU NEED TO RUN THE TRAINING PROJECT IN THE FIRST PLACE *****");
                Console.WriteLine("=============== Press any key ===============");
                Console.ReadKey();
                Environment.Exit(0);
            }

            // copy files from train output
            Directory.CreateDirectory(assetsPath);
            foreach (var file in Directory.GetFiles(trainOutput))
            {
                var fileDestination = Path.Combine(Path.Combine(assetsPath, "input"), Path.GetFileName(file));
                if (File.Exists(fileDestination))
                {
                    LocalConsoleHelper.DeleteAssets(fileDestination);
                }

                File.Copy(file, Path.Combine(Path.Combine(assetsPath, "input"), Path.GetFileName(file)));
            }
        }