03 Apr 2021 09:28:33 UTC
- Distribution: Algorithm-AM
- Module version: 3.12
- Source (raw)
- Browse (raw)
- How to Contribute
- Issues (26)
- Testers (178 / 4 / 0)
- KwaliteeBus factor: 1
- 92.68% Coverage
- License: perl_5
- Perl: v5.10.0
- Download (188.96KB)
- MetaCPAN Explorer
- Subscribe to distribution
- This version
- Latest version
- Theron Stanford, Nathan Glenn <firstname.lastname@example.org>
- Nathan Glenn
- Nick Logan
- COPYRIGHT AND LICENSE
Algorithm::AM::DataSet::Item - A single item for classification training and testing
use Algorithm::AM::DataSet::Item 'new_item'; my $item = new_item( features => ['a', 'b', 'c'], class => 'x', comment => 'a sample, meaningless item' );
This class represents a single item contained in a data set. Each item has a feature vector and possibly a class label and comment string. Once created, the item is immutable.
Creates a new Item object. The only required argument is 'features', which should be an array ref containing the feature vector. Each element of this array should be a string indicating the value of the feature at the given index. 'class' and 'comment' arguments are also accepted, where 'class' is the classification label and 'comment' can be any string to be associated with the item. A missing or undefined 'class' value is assumed to mean that the item classification is unknown. For the feature vector, empty strings are taken to indicate null values.
This is an exportable shortcut for the new method. If exported, then instead of calling
<Algorithm::AM::DataSet::Item-new>>, you may simply call
Returns the classification label for this item, or undef if the class is unknown.
Returns the feature vector for this item. This is an arrayref containing the string value for each feature. An empty string indicates that the feature value is null (meaning that it has no value).
Returns the comment for this item. By default, the comment is just a comma-separated list of the feature values.
Returns the length of the feature vector for this item.
Returns a unique string id for this item, for use as a hash key or similar situations.
Theron Stanford <email@example.com>, Nathan Glenn <firstname.lastname@example.org>
This software is copyright (c) 2021 by Royal Skousen.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
Module Install Instructions
To install Algorithm::AM, copy and paste the appropriate command in to your terminal.
perl -MCPAN -e shell install Algorithm::AM
For more information on module installation, please visit the detailed CPAN module installation guide.
|s||Focus search bar|
|?||Bring up this help dialog|
|g p||Go to pull requests|
|g i||go to github issues (only if github is preferred repository)|
|g a||Go to author|
|g c||Go to changes|
|g i||Go to issues|
|g d||Go to dist|
|g r||Go to repository/SCM|
|g s||Go to source|
|g b||Go to file browse|