Bio::T...ataSet(3pm)

πŸ“¦
version 3.0.6 Β· 4 versions
, in ubuntu jammy

πŸ’– 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. Data should 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