Introduction - If you have any usage issues, please Google them yourself
The classic Apriori algorithm generates many candidate itemsets because it needs to scan the database many times, which greatly affects the time and space efficiency of the algorithm. In order to reduce the number of database scanning, we can use matrix to record the required data and put it into memory. Every row number of matrix record corresponds to a commodity code, that is, one item, and each column number corresponds to a customer number (i.e. a transaction). If a j customer buys a I commodity, then record[i][j]=1, otherwise record[i][j]=0. scan the database once and initialize the matrix record. The next work can be done by scanning the matrix in memory without scanning the database again.