<commit_before>source('topics.r')

df = data.frame( k = integer(), ll =integer() )

path <- commandArgs(trailingOnly=TRUE)[0]

for( f in list.files(path) ){
	load(f)
	k <- model@k
	ll <- check_fitness_model( model )
	row = c(k, ll)
	df[ nrow(df)+1,] <- row
}

print("Best fit log likelihood", which.max( df$ll ) )
print("Best fit k", df$k[ which.max( df$ll ) ] )
<commit_msg>Make script work with several folders<commit_after>source('topics.r')

df = data.frame( k = integer(), ll =integer() )

for( path in commandArgs(trailingOnly=TRUE) ) {

  for( f in list.files(path) ){
  	load( paste(path, f, sep = '') )
  	k <- model@k
  	ll <- check_fitness_model( model )
  	row = c(k, ll)
  	df[ nrow(df)+1,] <- row
  }

  print("Examinging", path )
  print("Best fit log likelihood", which.max( df$ll ) )
  print("Best fit k", df$k[ which.max( df$ll ) ] )
  print("") ## Empty line

}

{'fraction_non_alphanumeric': 0.19069239500567536, 'fraction_numerical': 0.00340522133938706, 'mean_word_length': 3.716577540106952, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '717773', 'n_tokens_mistral': 359, 'n_tokens_neox': 347, 'n_words': 89}