pub enum FeaturesVersion {
Version2 = 2,
Version1 = 1,
}Expand description
The versions of the features used for analysis. Used for backwards-compatibility reasons in case people want to keep using older features version.
Songs analyzed with different FeaturesVersion are not compatible with one another, as they might have a different set of features, etc.
Variants§
Version2 = 2
The latest iteration, increasing chroma features accuracy and making feature normalization more coherent.
Version1 = 1
The first iteration of the features. The 4 last chroma features (song mode detection) might underperform / be underused while computing distances.
Implementations§
Source§impl FeaturesVersion
impl FeaturesVersion
Sourcepub const LATEST: FeaturesVersion = FeaturesVersion::Version2
pub const LATEST: FeaturesVersion = FeaturesVersion::Version2
Always points to the latest features’ version. In case of doubt, use this one.
Sourcepub fn feature_weights(self) -> Array2<f32>
pub fn feature_weights(self) -> Array2<f32>
Feature weights for the distance function that yields the best results.
Sourcepub fn distance_metric(self) -> impl Fn(&Array1<f32>, &Array1<f32>) -> f32
pub fn distance_metric(self) -> impl Fn(&Array1<f32>, &Array1<f32>) -> f32
Distance metric that yields the best result with this features’ version.
Sourcepub const fn feature_count(self) -> usize
pub const fn feature_count(self) -> usize
Number of features for this version.
Trait Implementations§
Source§impl Clone for FeaturesVersion
impl Clone for FeaturesVersion
Source§fn clone(&self) -> FeaturesVersion
fn clone(&self) -> FeaturesVersion
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for FeaturesVersion
Source§impl Debug for FeaturesVersion
impl Debug for FeaturesVersion
Source§impl Default for FeaturesVersion
impl Default for FeaturesVersion
Source§fn default() -> FeaturesVersion
fn default() -> FeaturesVersion
Source§impl<'de> Deserialize<'de> for FeaturesVersion
impl<'de> Deserialize<'de> for FeaturesVersion
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for FeaturesVersion
Source§impl From<FeaturesVersion> for u16
impl From<FeaturesVersion> for u16
Source§fn from(v: FeaturesVersion) -> Self
fn from(v: FeaturesVersion) -> Self
Source§impl FromSql for FeaturesVersion
impl FromSql for FeaturesVersion
Source§fn column_result(value: ValueRef<'_>) -> FromSqlResult<Self>
fn column_result(value: ValueRef<'_>) -> FromSqlResult<Self>
Source§impl Ord for FeaturesVersion
impl Ord for FeaturesVersion
Source§fn cmp(&self, other: &FeaturesVersion) -> Ordering
fn cmp(&self, other: &FeaturesVersion) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for FeaturesVersion
impl PartialEq for FeaturesVersion
Source§impl PartialOrd for FeaturesVersion
impl PartialOrd for FeaturesVersion
Source§impl Serialize for FeaturesVersion
impl Serialize for FeaturesVersion
impl StructuralPartialEq for FeaturesVersion
Source§impl ToSql for FeaturesVersion
impl ToSql for FeaturesVersion
Source§fn to_sql(&self) -> Result<ToSqlOutput<'_>>
fn to_sql(&self) -> Result<ToSqlOutput<'_>>
Auto Trait Implementations§
impl Freeze for FeaturesVersion
impl RefUnwindSafe for FeaturesVersion
impl Send for FeaturesVersion
impl Sync for FeaturesVersion
impl Unpin for FeaturesVersion
impl UnsafeUnpin for FeaturesVersion
impl UnwindSafe for FeaturesVersion
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more