ArffTools 1.1.3

dotnet add package ArffTools --version 1.1.3
NuGet\Install-Package ArffTools -Version 1.1.3
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="ArffTools" Version="1.1.3" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add ArffTools --version 1.1.3
#r "nuget: ArffTools, 1.1.3"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install ArffTools as a Cake Addin
#addin nuget:?package=ArffTools&version=1.1.3

// Install ArffTools as a Cake Tool
#tool nuget:?package=ArffTools&version=1.1.3

ArffTools

.NET library for reading and writing Weka attribute-relation file format (ARFF) files

NuGet license

Features

  • Read and write ARFF files
  • Supports relational attributes
  • Supports sparse instances
  • Supports instance weights
  • Proper quoting and escaping of special characters

Usage

Reading ARFF files:

using (ArffReader arffReader = new ArffReader("glass.arff"))
{
    ArffHeader header = arffReader.ReadHeader();    
    object[] instance;    
    while ((instance = arffReader.ReadInstance()) != null)
    {
        // process instance
    }    
}

Reading all instances at a time:

object[][] instances = arffReader.ReadAllInstances();

Writing ARFF files:

using (ArffWriter arffWriter = new ArffWriter("iris.arff"))
{
    arffWriter.WriteRelationName("iris");
    arffWriter.WriteAttribute(new ArffAttribute("sepallength", ArffAttributeType.Numeric));
    arffWriter.WriteAttribute(new ArffAttribute("sepalwidth", ArffAttributeType.Numeric));
    arffWriter.WriteAttribute(new ArffAttribute("petallength", ArffAttributeType.Numeric));
    arffWriter.WriteAttribute(new ArffAttribute("petalwidth", ArffAttributeType.Numeric));
    arffWriter.WriteAttribute(new ArffAttribute("class", ArffAttributeType.Nominal("Iris-setosa", "Iris-versicolor", "Iris-virginica")));
    arffWriter.WriteInstance(new object[] { 5.1, 3.5, 1.4, 0.2, 0 });
}

Instances are represented as object[] whose elements correspond to the attribute values. ARFF attribute types are mapped to .NET types as follows:

ARFF attribute type .NET type
numeric, integer, real double
nominal int
string string
date DateTime
relational object[][]

Missing values are represented as null. Sparse instances are represented as normal instances in memory.

Product Compatible and additional computed target framework versions.
.NET net5.0 is compatible.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net5.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.1.3 472 8/28/2021
1.1.2 1,871 4/21/2017
1.1.1 969 3/20/2017
1.1.0 990 1/25/2017
1.0.1 1,498 8/4/2016
1.0.0 1,391 8/4/2016

The library has been updated to target .NET 5.0 instead of .NET Framework.