This is the codebase for GRAB.

To compile the code, run 'make' in this directory.
This will generate a binary called 'Asrumi', that runs the GRAB algorithm.



It expects two arguments:

	1) The database file which should be mined in .db fimi format (see below).
	2) The output file where to write the result.




It is possible to set minimum confidence and support values for this tool through the expressions in const.h,
however, we strongly discourage to do so.


INPUT format:
The db format is a database representation which sorts database columns by support and assigns them new indices based on the sorting.
The header of the .db file should contain the following rows containing meta information, an example from the dna amplification data:

===
fic-1.5
mi: nR=4590 nT=4590 nI=26530 aS=391 sS=212624.77319 mL=149 b?=0 c?=0
ab: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390
ac: 468 444 439 422 373 288 275 273 263 257 251 246 236 229 226 226 223 220 217 217 216 216 215 208 208 207 197 192 189 189 184 179 178 178 170 168 166 163 163 158 158 157 156 155 154 153 152 148 147 146 145 144 144 142 142 139 138 138 136 133 133 130 125 123 122 117 117 115 111 110 109 109 108 107 106 102 100 99 98 96 96 95 95 93 93 88 87 87 86 85 83 81 81 79 79 78 77 77 77 76 75 75 74 73 73 73 71 71 71 71 71 69 69 68 68 67 67 67 67 67 67 66 66 66 66 65 64 63 63 63 63 62 62 61 61 61 60 60 60 60 60 59 59 59 59 59 58 58 57 57 57 57 56 56 56 55 55 54 54 54 53 53 53 53 52 52 52 51 51 51 50 50 50 49 49 49 49 48 48 48 48 48 48 48 48 48 47 47 47 47 46 46 46 46 45 45 45 44 44 43 43 43 43 42 42 42 42 42 42 41 41 41 40 40 40 39 39 39 39 38 38 38 37 37 37 37 37 37 37 36 36 35 35 34 34 34 34 34 32 32 31 31 31 31 31 30 30 30 30 30 29 27 27 27 27 27 27 26 26 26 26 26 26 26 26 26 25 25 25 25 25 25 24 24 24 23 23 23 23 23 22 22 22 22 22 22 22 22 22 22 22 21 21 21 21 21 21 21 21 21 21 21 20 20 20 20 20 20 20 20 20 20 20 19 19 19 19 19 19 19 19 19 19 19 19 19 19 18 18 18 18 18 18 18 18 18 18 17 17 17 17 17 17 17 17 16 16 16 16 15 15 15 15 15 14 14 14 14 14 14 14 13 13 13 13 12 12 12 11 11 11 11 11 11 10 10 10 9 8 8 8 8 7 7 7 7 7 7 7 7 5
it: 188 189 187 190 186 185 184 183 17 18 19 182 81 350 349 181 82 20 243 180 348 79 80 351 229 244 237 83 179 29 21 84 321 320 22 23 160 114 111 238 113 242 319 112 347 236 115 16 317 318 161 78 30 25 24 26 159 27 165 338 116 245 346 166 28 167 77 156 239 157 158 15 339 316 117 136 138 155 139 264 263 262 137 340 135 162 343 261 164 341 337 344 230 168 76 260 342 328 312 134 172 171 170 371 169 140 385 384 311 133 75 386 293 372 176 374 332 294 192 177 74 336 315 228 132 331 373 345 323 241 191 329 313 259 193 94 383 333 322 206 9 292 258 232 174 8 370 194 334 330 173 35 381 327 248 310 34 382 335 36 380 175 141 73 249 72 31 326 233 5 369 314 7 324 231 95 71 379 378 368 298 257 178 70 6 4 375 365 163 3 377 359 297 10 367 358 246 366 195 296 295 250 33 256 247 209 196 149 0 273 69 2 357 278 205 299 272 227 1 300 271 151 291 277 234 68 52 51 32 356 255 210 204 364 235 208 197 150 290 11 376 325 207 53 12 276 274 202 96 50 203 275 201 101 99 37 13 355 354 353 352 240 225 211 103 54 152 148 130 129 100 85 224 200 98 104 102 86 62 60 308 270 199 131 128 106 105 87 61 59 49 302 153 127 124 122 108 107 97 89 88 38 307 221 219 212 144 143 125 119 110 109 48 309 284 269 223 198 154 126 123 121 120 47 46 44 42 289 286 285 226 215 145 91 90 58 45 306 220 147 118 93 63 55 43 222 146 56 14 288 287 216 92 39 363 362 361 360 303 57 41 305 304 283 218 217 214 66 301 254 253 252 251 142 213 65 40 64 268 267 266 265 389 388 387 282 281 280 279 67 391
===

The first line indicates the fic version.
The second line, starting with "mi:" is meta information about the data, namely the number of rows (nR), number of unique transactions (nT), number of Ones in the data (nI), number of features (nS), some information as a float not relevant for GRAB (sS) and the maximum transaction length (mL). The remainder of the line can be left out for GRAB.
The third line, starting with "ab:" is the new item id assigned for an item in the new format, the corresponding entry in the fifth column ("it:") is the item id in the original .dat file.
The fourth line ("ac:") lists support counts for each item.

This meta information head is followed by nR lines containing the transactions of the database,
each line starts with a number followed by a colon that indicates the number of items in this transaction,
followed by a white space separated list of items with indices according to the "ab:" meta information.
E.g.:

===
1: 0
4: 5 7 8 101
===

Example database files in .db format can be found in the Data/ folder in the top-level directory.




OUTPUT format:

Each line lists a mined rule in the format
: [tailItem] (support)
[headItem ]*: [tailItem ]* (supportHead, supportTailGivenHead, ruleHolds)

with tailItem and HeadItem being item ids,
* indicates that any number of those, possibly zero, could appear,
and the numbers in braces are support, support of the rule head, support of the tail where rule head is present, and number of transaction where rule holds, respectively.




EXAMPLE call:

./Asrumi ../Data/Real/icdm.db icdm_GRAB_output.txt >/dev/null

This runs the GRAB algorithm on the icdm abstracts database and generates the result file 'icdm_GRAB_output.txt' containing the rules in the code directory.
