<commit_before>package durbin.paradigm;

import weka.attributeSelection.*


/**
* Class to hold a single experiment specification. 
*/ 
class ExperimentSpec{
   def classifier
   def attributeEval
   def attributeSearch
   def numAttributes
   def classAttribute
   
   // Just to have something handy to print
   def classifierStr
   def attrEvalStr
   def attrSearchStr
   
    //time estimate:   {so batching can divide it up reasonably}
    
   def ExperimentSpec(line){
    def fields = line.split(",")
    classifierStr = fields[0]
    classifier = ParadigmPipeline.classifierFromSpec(classifierStr)
    
    attrEvalStr = fields[1] 
    attributeEval = ParadigmPipeline.evalFromSpec(attrEvalStr)  
    
    
    // KJD Temporary until I look up how to do this with Class.forName()
    attrSearchStr = fields[2]
    attributeSearch = new Ranker()

    //attributeSearch = 
    // Need to convert this to a class...
    
    numAttributes = (fields[3] as double) as int
    classAttribute = fields[4]     
   }    
}

//classifier, attributeEval,attributeSearch,numAttributes,classAttribute"<commit_msg>Catch exceptions and print out failed classifier spec.<commit_after>package durbin.paradigm;

import weka.attributeSelection.*


/**
* Class to hold a single experiment specification. 
*/ 
class ExperimentSpec{
   def classifier
   def attributeEval
   def attributeSearch
   def numAttributes
   def classAttribute
   
   // Just to have something handy to print
   def classifierStr
   def attrEvalStr
   def attrSearchStr
   
    //time estimate:   {so batching can divide it up reasonably}
    
   def ExperimentSpec(line){
    def fields = line.split(",")
    classifierStr = fields[0]

    try{
      classifier = ParadigmPipeline.classifierFromSpec(classifierStr)
    }catch(Exception e){
      System.err.println "ParadigmPipeline.classifierFromSpec failed on:"
      System.err.println classifierStr
      throw(e)
    }
    
    attrEvalStr = fields[1] 
    attributeEval = ParadigmPipeline.evalFromSpec(attrEvalStr)  
    
    
    // KJD Temporary until I look up how to do this with Class.forName()
    attrSearchStr = fields[2]
    attributeSearch = new Ranker()

    //attributeSearch = 
    // Need to convert this to a class...
    
    numAttributes = (fields[3] as double) as int
    classAttribute = fields[4]     
   }    
}

//classifier, attributeEval,attributeSearch,numAttributes,classAttribute"
{'fraction_non_alphanumeric': 0.07537067545304778, 'fraction_numerical': 0.004118616144975288, 'mean_word_length': 2.995065789473684, 'pattern_counts': {'":': 0, '<': 3, '<?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': '2127602', 'n_tokens_mistral': 709, 'n_tokens_neox': 680, 'n_words': 202}