<jupyter_start><jupyter_text>Tabular Data - RNA Seq<jupyter_code>X = np.load('data\\tabular\\rna_seq\\X.npy', allow_pickle=True).astype('float32')
y = np.load('data\\tabular\\rna_seq\\y.npy', allow_pickle=True).astype('float32')
X = mms().fit_transform(X)
reduction = np.load('results\\umap_reductions\\rna_seq.npy')
vanilla = VanillaAutoEncoder(
    X_shape=X.shape
)

stopper = EarlyStopping(
    monitor='loss',
    min_delta=0.0001,
    patience=10,
    restore_best_weights=True
)
history = vanilla.fit(
    X.astype('float32'), 
    epochs=1000, 
    batch_size=32, 
    callbacks=[stopper],
    verbose=0
)
clusterer_idec = IDEC(
    X=X,
    autoencoder=vanilla,
    n_clusters=5,
    gamma=0.1
)
clusterer_idec.fit(
    X=X,
    epochs=100,
    btch_size=32,
    verbose=False,
    update_interval=10
)
clusterer_kmeans = MiniBatchKMeans(
    n_clusters=5,
    n_init=100,
    max_iter=300
)
clusterer_kmeans.fit(
    X
)
compare_clusterers(
    clusterer_1={'IDEC': clusterer_idec.predict(X).argmax(1).flatten()}, 
    clusterer_2={'Mini Batch KMeans': clusterer_kmeans.labels_}, 
    ground_truth=y, 
    reduction=reduction,
    figsize=(15, 5),
    s=0.5
)<jupyter_output><empty_output><jupyter_text>Time Series Data - NATOPS dataset<jupyter_code>X = np.load('data\\time_series\\natops\\X.npy', allow_pickle=True).astype('float32')
y = np.load('data\\time_series\\natops\\y.npy', allow_pickle=True).astype('float32')
X = tmms().fit_transform(X)
reduction = np.load('results\\umap_reductions\\natops.npy')
recurrent = RecurrentAutoEncoder(X_shape=X.shape)

stopper = EarlyStopping(
    monitor='val_loss',
    min_delta=0.0001,
    patience=10,
    restore_best_weights=True
)
history = recurrent.fit(
    X, 
    epochs=1000, 
    batch_size=32,
    verbose=0, 
    callbacks=[stopper],
    validation_split=0.2
)
clusterer_idec = IDEC(
    X=X,
    autoencoder=recurrent,
    n_clusters=5,
    gamma=0.05
)
clusterer_idec.fit(
    X=X,
    epochs=300,
    btch_size=32,
    verbose=True,
    update_interval=X.shape[0] // 32,
    epochs_tol=(X.shape[0] // 32) * 5
)
clusterer_dtw_kmeans = TimeSeriesKMeans(
    n_clusters=5, 
    metric='dtw', 
    max_iter=100,
    n_init=5,
    max_iter_barycenter=5
)
clusterer_dtw_kmeans.fit(
    X
)
compare_clusterers(
    clusterer_1={'IDEC': clusterer_idec.predict(X).argmax(1).flatten()}, 
    clusterer_2={'DTW KMeans': clusterer_dtw_kmeans.labels_}, 
    ground_truth=y.flatten(), 
    reduction=reduction,
    figsize=(15, 5),
    s=1
)<jupyter_output><empty_output><jupyter_text>Images Data - Olivetti<jupyter_code>X = np.load('data\\images\\olivetti\\X.npy').reshape((-1, 64, 64, 1))
y = np.load('data\\images\\olivetti\\y.npy', allow_pickle=True).astype('float32')
reduction = np.load('results\\umap_reductions\\olivetti.npy')
convol = ConvAutoEncoder(X_shape=X.shape)

stopper = EarlyStopping(
    monitor='loss',
    min_delta=0.00001,
    patience=20,
    restore_best_weights=True
)
history = convol.fit(
    X,
    noise=0.01,
    epochs=1000, 
    batch_size=64,
    callbacks=[stopper],
    verbose=0
)
clusterer_idec = IDEC(
    X=X,
    autoencoder=convol,
    n_clusters=40,
    gamma=0.5,
    labels=y
)
clusterer_idec.fit(
    X=X,
    epochs=1000,
    btch_size=64,
    update_interval=X.shape[0] // 64,
    epochs_tol=(X.shape[0] // 64) * 5,
    verbose=True
)
clusterer_kmeans = MiniBatchKMeans(
    n_clusters=40,
    n_init=100,
    max_iter=300
)
clusterer_kmeans.fit(
    X.reshape(X.shape[0], -1)
)
compare_clusterers(
    clusterer_1={'IDEC': clusterer_idec.predict(X).argmax(1).flatten()}, 
    clusterer_2={'Mini Batch KMeans': clusterer_kmeans.labels_}, 
    ground_truth=y, 
    reduction=reduction,
    figsize=(15, 5),
    s=1
)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.15021344717182497, 'fraction_numerical': 0.04108858057630736, 'mean_word_length': 3.9134993446920054, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '479531', 'license': 'MIT', 'n_tokens_mistral': 1647, 'n_tokens_neox': 1585, 'n_words': 192, 'path': 'benchmarking_DEC.ipynb', 'repo_name': 'vb690/IDEC_extended', 'size': '3748'}