Function writeRulesFile(const std::string&, const std::vector<Rule>&, const std::vector<std::string>&, const std::vector<std::string>&, float, int)

Function Documentation

std::tuple<double, double> writeRulesFile(const std::string &filename, const std::vector<Rule> &rules, const std::vector<std::string> &attributeNames, const std::vector<std::string> &classNames, float threshold, int positiveIndex)

Writes a list of rules into a given file. Returns a tuple of two doubles representing the mean covering size and the mean number of antecedents.

Parameters:
  • filename – Name of the file to be written/overwritten.

  • rules – List of Rule objects to be written in “filename”.

  • attributeNames – List of attribute names, used to write Rule’s antecedents with attribute names instead of a “X” variable.

  • classNames – List of class names, used to write Rule’s class with class names instead of numerical representation.

  • threshold – Decision threshold.

  • positiveIndex – Index defining the positive class in the dataset.

Returns:

A tuple containing the mean covering size and the mean number of antecedents.