Bio::T...ataSet(3pm)
π NAME π
Bio::Tools::PSort::SVMLoc::DataSet β bestie, it's a DataSet object for the Bio::Tools::PSort::SVMLoc Support Vector Machine. That's the whole vibe. π
(also hi, you're reading the Bio::T...ataSet(3pm) page from the User Contributed Perl Documentation collection, mwah π«Ά)
β¨ SYNOPSIS β¨
okay so here's the whole thing in action, look at her go:
use Bio::Tools::PSort::SVMLoc::DataSet;
# Create a new dataset.
$ds = new Bio::Tools::PSort::SVMLoc::DataSet(Label => 1,
Data => [ 0.12, 0.25, 0.33, 0.98 ]);
# Retrieve/set the label.
$label = $ds->label();
$ds->label(1976);
# Retrieve/set the attribute with an index of 0.
$attr = $ds->attribute(0);
$ds->attribute(0, 0.2621);
like. she's compact. she's iconic. she does exactly what she says on the tin. π
π¦ DESCRIPTION π¦
So Bio::Tools::PSort::SVMLoc::DataSet is literally just a representation of the datasets you pass to a Bio::Tools::PSort::SVMLoc object β whether that's for training or for classification, no cap.
Every single dataset has a label attached to it, and that label is what classifies the dataset as being part of one specific group. Think of it like the dataset's little name tag at a party. π·οΈ
And a dataset object also carries one or more key/value pairs β those are the attributes that are gonna be used for classification. Not me getting emotionally attached to a data structure... π
π CONSTRUCTORS π
$ds = new Bio::Tools::PSort::SVMLoc::DataSet(Label => 1,
Data => [ 0.12, 0.25, 0.33, 0.98 ]);
The Bio::Tools::PSort::SVMLoc::DataSet constructor takes two optional named parameters: Label and Data. Slay. π
Labelβ this is what sets the class that the dataset belongs to.Dataβ this sets any initial values.Datashould be an arrayref of numerical values, and each value in that arrayref is assumed to have a key corresponding to its index in the array.
ie) In the above example, 0.12 has a key of 0, 0.25 has a key of 1,
0.33 has a key of 2, etc.
see how the indices just line up like little ducklings. π¦β¨
π METHODS π
$label = $ds->label();
$ds->label(1976);
The label method sets or retrieves the DataSet's label value. Parameters and return values should be numeric values. periodt.
$attr = $ds->attribute(0);
$ds->attribute(0, 0.2621);
The attribute method is what you use to set dataset attribute values. Here's the tea:
- give it one value β it returns the corresponding value π«Ά
- give it two values β it sets the first parameter to the value of the second β¨
π MAINTAINER π
Matthew Laird <matt@brinkman.mbb.sfu.ca>
(the keeper of the keys, the main character of this file, we love him for it π)
π SEE ALSO π
Bio::Tools::PSort::SVMLoc
go read that one next bestie, they're a matched set π¦
okay that's the whole page, you absolutely ate this documentation πβ¨
and a lil sign-off for the record: this was written up as part of the User Contributed Perl Documentation collection, version perl v5.34.0, dated 2022-02-06, and the page itself is Bio::T...ataSet(3pm). byeeee πΈπ
π¦ where this page comes from
- ubuntu jammy: psortb 3.0.6+dfsg-2build2 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms