kMeans_t Derived Type

type, public :: kMeans_t


Components

Type Visibility Attributes Name Initial
logical, public :: initialized = .false.
integer, public :: ndims
integer, public :: nclusters
integer, public :: maxiters
logical, public :: centroids_set
integer, public, allocatable :: prevClusters(:)
integer, public, allocatable :: clusters(:)
real(kind=RP), public, allocatable :: centroids(:,:)

Finalization Procedures

final :: kMeans_final

  • private subroutine kMeans_final(self)

    Arguments

    Type IntentOptional Attributes Name
    type(kMeans_t), intent(inout) :: self

Type-Bound Procedures

procedure, public :: init => kMeans_init

  • private subroutine kMeans_init(self, ndims, nclusters, maxiters)

    Arguments

    Type IntentOptional Attributes Name
    class(kMeans_t), intent(inout) :: self
    integer, intent(in) :: ndims
    integer, intent(in) :: nclusters
    integer, intent(in), optional :: maxiters

procedure, public :: fit => kMeans_fit

  • private subroutine kMeans_fit(self, x, info, centroids, reset)

    Arguments

    Type IntentOptional Attributes Name
    class(kMeans_t), intent(inout) :: self
    real(kind=RP), intent(in) :: x(:,:)
    integer, intent(out), optional :: info
    real(kind=RP), intent(in), optional :: centroids(self%ndims,self%nclusters)
    logical, intent(in), optional :: reset

procedure, public :: predict => kMeans_predict

  • private subroutine kMeans_predict(self, x, info)

    Arguments

    Type IntentOptional Attributes Name
    class(kMeans_t), intent(inout) :: self
    real(kind=RP), intent(in) :: x(:,:)
    integer, intent(out), optional :: info