4  Decomposition

using Rtemis
iris = ddb_data("~/icloud/Data/iris.csv")

4.1 PCA

iris_pca = d_PCA(iris[:, 1:4], 2)
dplot3_xy(
    iris_pca.projections_train,
    xlab="PCA 1", ylab="PCA 2",
    group=iris.Species
)

4.2 ICA

iris_ica = d_ICA(iris[:, 1:4], 2, tol = .1)
dplot3_xy(
    iris_ica.projections_train,
    xlab="ICA 1", ylab="ICA 2",
    group=iris.Species
)

4.3 KPCA

iris_kpca = d_KPCA(iris[:, 1:4], 2)
dplot3_xy(
    iris_kpca.projections_train,
    xlab="KPCA 1", ylab="KPCA 2",
    group=iris.Species
)

4.4 NMF

iris_nmf = d_NMF(iris[:, 1:4], 2)
dplot3_xy(
    iris_nmf.projections_train,
    xlab="NMF 1", ylab="NMF 2",
    group=iris.Species
)

4.5 ISOMAP

(Note: Using a high number of neighbors for the nearest-neighbor step to avoid disconnected components)

iris_isomap = d_ISOMAP(iris[:, 1:4], 2, n_neighbors=25)
dplot3_xy(
    iris_isomap.projections_train,
    xlab="ISOMAP 1", ylab="ISOMAP 2",
    group=iris.Species
)

4.6 LLE

(Note: as above, using high n neighbors)

iris_lle = d_LLE(iris[:, 1:4], 2, n_neighbors=50)
dplot3_xy(
    iris_lle.projections_train,
    xlab="LLE 1", ylab="LLE 2",
    group=iris.Species
)

4.7 UMAP

iris_umap = d_UMAP(iris[:, 1:4], 2)
dplot3_xy(
    iris_umap.projections_train,
    xlab="UMAP 1", ylab="UMAP 2",
    group=iris.Species
)

4.8 t-SNE

iris_tsne = d_tSNE(iris[:, 1:4], 2)
dplot3_xy(
    iris_tsne.projections_train,
    xlab="t-SNE 1", ylab="t-SNE 2",
    group=iris.Species
)