Howdy,
I am doing a project for data mining, below I have modified some code to create item frequency and support data calculations, but I wanted to see if I could draw in all the original string information for the RawTransactions from a txt file.
Say I had all of this in a file on desktop in a new folder and a .txt file in the folder named "info", would there be a way to draw all of it from that file?
Thanks for any help!
I am doing a project for data mining, below I have modified some code to create item frequency and support data calculations, but I wanted to see if I could draw in all the original string information for the RawTransactions from a txt file.
Say I had all of this in a file on desktop in a new folder and a .txt file in the folder named "info", would there be a way to draw all of it from that file?
Thanks for any help!
namespace SeniorProject { class SeniorProject { static void Main(string[] args) { try { Console.WriteLine("\nSenior Project\n"); string[] rawItems = new string[] { "Rifle", "RifleAmmo ", "Pistol", "PistolAmmo", "GunCleaningKit ", "PracticeTargets ", "FishingRod", "FishingReel ", "FishingLine ", "Hooks ", "Worms ", "LIfeJacket", "CamoJackets", "CamoPants", "HikingBoots", "Tent", "SleepingBags", "CampStove", "Chips", "Soda" }; int N = rawItems.Length; // total number of items string[][] rawTransactions = new string[20][]; rawTransactions[0] = new string[] { "Rifle", "RifleAmmo ", "Pistol", "PracticeTargets " }; // 0 1 2 5 rawTransactions[1] = new string[] { "RifleAmmo ", "GunCleaningKit ", "PracticeTargets " }; // 1 4 5 rawTransactions[2] = new string[] { "Rifle", "RifleAmmo ", "PistolAmmo", "GunCleaningKit " }; // 0 1 3 4 rawTransactions[3] = new string[] { "Pistol", "PistolAmmo", "PracticeTargets ", "FishingRod" }; // 2 3 5 6 rawTransactions[4] = new string[] { "PistolAmmo", "GunCleaningKit " }; // 3 4 rawTransactions[5] = new string[] { "PistolAmmo", "GunCleaningKit ", "Hooks " }; // 3 4 9 rawTransactions[6] = new string[] { "Rifle", "RifleAmmo ", "PistolAmmo", "FishingLine " }; // 0 1 3 8 rawTransactions[7] = new string[] { "RifleAmmo ", "FishingRod", "FishingReel " }; // 1 6 7 rawTransactions[8] = new string[] { "Rifle", "RifleAmmo ", "Pistol", "PracticeTargets ", "Worms " }; // 0 1 2 5 10 rawTransactions[9] = new string[] { "Rifle", "RifleAmmo ", "Pistol", "PracticeTargets " }; // 0 1 2 5 rawTransactions[10] = new string[] { "Pistol", "PistolAmmo", "PracticeTargets ", "FishingRod" }; // 2 3 5 6 rawTransactions[11] = new string[] { "RifleAmmo ", "FishingRod", "FishingReel " }; // 1 6 7 rawTransactions[12] = new string[] { "RifleAmmo ", "GunCleaningKit ", "PracticeTargets " }; // 1 4 5 rawTransactions[13] = new string[] { "PistolAmmo", "GunCleaningKit ", "Hooks " }; // 3 4 9 rawTransactions[14] = new string[] { "Rifle", "RifleAmmo ", "Pistol", "PracticeTargets " }; // 0 1 2 5 rawTransactions[15] = new string[] { "Rifle", "RifleAmmo ", "PistolAmmo", "GunCleaningKit " }; // 0 1 3 4 rawTransactions[16] = new string[] { "Rifle", "RifleAmmo ", "Pistol", "PracticeTargets ", "Worms " }; // 0 1 2 5 10 rawTransactions[17] = new string[] { "Rifle", "RifleAmmo ", "PistolAmmo", "FishingLine " }; // 0 1 3 8 rawTransactions[18] = new string[] { "Rifle", "RifleAmmo ", "Pistol", "PracticeTargets " }; // 0 1 2 5 rawTransactions[19] = new string[] { "PistolAmmo", "GunCleaningKit " }; // 3 4 Console.WriteLine("Item List:"); Console.WriteLine("-----------------------------------------------"); for (int i = 0; i < rawTransactions.Length; ++i) { Console.Write("[" + i + "] : "); for (int j = 0; j < rawTransactions[i].Length; ++j) Console.Write(rawTransactions[i][j] + " "); Console.WriteLine(""); } List<int[]> transactions = new List<int[]>(); transactions.Add(new int[] { 0, 1, 2, 5 }); transactions.Add(new int[] { 1, 4, 5 }); transactions.Add(new int[] { 0, 1, 3, 4 }); transactions.Add(new int[] { 2, 3, 5, 6 }); transactions.Add(new int[] { 3, 4 }); transactions.Add(new int[] { 3, 4, 9 }); transactions.Add(new int[] { 0, 1, 3, 8 }); transactions.Add(new int[] { 1, 6, 7 }); transactions.Add(new int[] { 0, 1, 2, 5, 10 }); transactions.Add(new int[] { 0, 1, 2, 5 }); transactions.Add(new int[] { 2, 3, 5, 6 }); transactions.Add(new int[] { 1, 6, 7 }); transactions.Add(new int[] { 1, 4, 5 }); transactions.Add(new int[] { 3, 4, 9 }); transactions.Add(new int[] { 0, 1, 2, 5 }); transactions.Add(new int[] { 0, 1, 3, 4 }); transactions.Add(new int[] { 0, 1, 2, 5, 10 }); transactions.Add(new int[] { 0, 1, 3, 8 }); transactions.Add(new int[] { 0, 1, 2, 5 }); transactions.Add(new int[] { 3, 4 }); }
Last edited: