class_docstr: Test class for ablation tests.
class_docstr_tok: ["Test","class","for","ablation","tests","."]
docstr: Ensure that all ablated faetures and featureset values are correct.
  
  Parameters
  ----------
  reader : object
      Reader object that iterates over the output summary file.
  
  Returns
  -------
  int
      The total number of rows in the summary file.
docstr_tok: ["Ensure","that","all","ablated","faetures","and","featureset","values","are","correct",".","Parameters","--","--","--","--","--","reader",":","object","Reader","object","that","iterates","over","the","output","summary","file",".","Returns","--","--","--","-","int","The","total","number","of","rows","in","the","summary","file","."]
code: def check_ablation_rows(self, reader):
      """
      Ensure that all ablated faetures and featureset values are correct.
  
      Parameters
      ----------
      reader : object
          Reader object that iterates over the output summary file.
  
      Returns
      -------
      int
          The total number of rows in the summary file.
      """
      row_num = 0
      for row_num, row in enumerate(reader, 1):
          if row["ablated_features"]:
              fs_str, ablated_str = row["featureset_name"].split(
                  "_minus_"
              )
              actual_ablated = json.loads(row["ablated_features"])
          else:
              fs_str, ablated_str = row["featureset_name"].split("_all")
              actual_ablated = []
          expected_fs = set(fs_str.split("+"))
          expected_ablated = (
              ablated_str.split("+") if ablated_str else []
          )
          expected_fs = sorted(expected_fs - set(expected_ablated))
          actual_fs = json.loads(row["featureset"])
          self.assertEqual(expected_ablated, actual_ablated)
          self.assertEqual(expected_fs, actual_fs)
      return row_num
  
file_path: skll/tests/test_ablation.py
imports: import csv
  import json
  import unittest
  from skll.experiments import run_configuration
  from skll.utils.testing import config_dir, create_jsonlines_feature_files, fill_in_config_paths, output_dir, remove_jsonlines_feature_files, test_dir, train_dir, unlink
label_desc: Use image node_id 3 for calling the TestAblation obj's underlying member method code with example usage: obj.check_ablation_rows(reader) and returns: row_num