Learn R Programming

mldr (version 0.2.25)

mldr: Creates an object representing a multilabel dataset

Description

Reads a multilabel dataset from a file and returns an mldr object containing the data and additional measures. The file has to be in ARFF format. The label information could be in a separate XML file (MULAN style) or in the the arff header (MEKA style)

Usage

mldr(filename, use_xml = TRUE, auto_extension = TRUE, xml_file,
  label_indices, label_names, label_amount)

Arguments

filename
Name of the dataset
use_xml
Specifies whether to use an associated XML file to identify the labels. Defaults to TRUE
auto_extension
Specifies whether to add the '.arff' and '.xml' extensions to the filename where appropriate. Defaults to TRUE
xml_file
Path to the XML file. If not provided, the filename ending in ".xml" will be assumed
label_indices
Optional vector containing the indices of the attributes that should be read as labels
label_names
Optional vector containing the names of the attributes that should be read as labels
label_amount
Optional parameter indicating the number of labels in the dataset, which will be taken from the last attributes of the dataset

Value

  • An mldr object containing the multilabel dataset

See Also

mldr_from_dataframe, summary.mldr

Examples

Run this code
library(mldr)
# Read "yeast.arff" and labels from "yeast.xml"
mymld <- mldr("yeast")

# Read "yeast-tra.arff" and labels from "yeast.xml"
mymld <- mldr("yeast-tra", xml_file = "yeast.xml")

# Read "yeast.arff" specifying the amount of attributes to be used as labels
mymld <- mldr("yeast", label_amount = 14)

# Read MEKA style dataset, without XML file and giving extension
mymld <- mldr("IMDB.arff", use_xml = FALSE, auto_extension = FALSE)

Run the code above in your browser using DataLab