<jupyter_start><jupyter_text>Unsupervised machine learningPreviously, we have taken MR images and attempt assign to them values of normal/diseased, at a whole image level (classification) or a pixel level (segmentation). But what if we don't have labels?We are going to spent this tutorial exploring how to find patterns in data using unsupervised machine learning. We'll introduce three new tools that require no labels (though we'll keep track of them to evaluate our performance):- Autoencoders: deep neural network designed minimize the "reconstruction error" between the input and output (which are the same)- K-means clustering: a way of automatically find groups of unlabelled data points in space based on distances between them- K-nearest neighbours: assigning a new data point a label based on its proximity to other labelled data points<jupyter_code>train_path = 'C:/Users/jxb29/Dropbox (Partners HealthCare)/Teaching/BRATS_10_Updated/*/*.nii.gz'
sequences = ['t1', 't2']
from glob import glob
import nibabel as nib

image_list = glob(train_path)

for nifti_file in image_list:
    
    if 'seg' in nifti_file:
        continue
        
    # Load our file
    vol = nib.load(nifti_file)
    break<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.06058158319870759, 'fraction_numerical': 0.004846526655896607, 'mean_word_length': 4.657534246575342, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '367474', 'license': 'MIT', 'n_tokens_mistral': 355, 'n_tokens_neox': 330, 'n_words': 156, 'path': 'tutorial_7/.ipynb_checkpoints/Untitled-checkpoint.ipynb', 'repo_name': 'BjornGudmund/qtim_Tutorials', 'size': '1238'}