Julian Hautzmayer
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # Unsupervised machine learning Here we collect material(videos, articles, pdfs) regarding the unsupervised machine learning course. We follow the outline of the slides. ## Sources and Material Slides: 1. https://ml.jku.at/teaching/ss2018/ss_vl_mlut/MLun_part1.pdf 2. https://ml.jku.at/teaching/ss2018/ss_vl_mlut/MLun_part2.pdf 3. http://www.bioinf.at/teaching/ss2018/ss_vl_mlut/MLun_part3.pdf Lecture Notes: https://moodle.jku.at/jku/pluginfile.php/5435221/mod_resource/content/0/ML_unsupervised.pdf Generally there are two very good playlists for the unsupervised course, both intersect also supervised learning but it's probably not bad to repeat some stuff there. Standford course for machine learning https://www.youtube.com/watch?v=jGwO_UgTS7I&list=PLoROMvodv4rMiGQp3WXShtMGgzqpfVfbU Bloomberg foundation for machine learning https://bloomberg.github.io/foml/#lectures I find these two courses to be very packed with good examples and material. ## Content of the lecture 1. Introduction 2. Basic Terms and Concepts 3. Principal Component Analysis (PCA) 4. Independent Component Analysis (ICA) 6. Factor Analysis 7. Scaling and Projection Methods 8. Clustering 9. Biclustering 10. Hidden Markov Models 11. Boltzmann Machines ## Introduction --- ## Basic Terms and Concepts --- ### Unsupervised Learning in Bioinformatics e.g. clustering of microarray data: use unsupervised methods to visualize dependencies and clusters with PCA for example ### Unsupervised Learning Categories Categories: * generative framework: density estimation, hidden Markov models; main objectives: maximum likelihood or maximum a posteriori * recoding or descriptive framework: projection methods, PCA, ICA; main objectives: maximal variance, orthogonality, independence, maximum entropy * Projection Methods: project the data into a space with desired properties * PCA = Principal Component Analysis: projection to a low dimensional space under maximal information conservation * ICA = Independent Component Analysis: projection into a space with statistically independent components (factorial code) * often characteristics of a factorial distribution are optimized: maximal entropy (given variance) or cummulants * or prototype distributions should be matched: product of special super-Gaussians * Projection Pursuit: components are maximally non-Gaussian Generative Models: simulate the world and produce the same data * data generation process is probabilistic: underlying distribution * generative model tries to approximate this distribution * loss function: distance between the model output distribution and the distribution of the data generation process * examples: factor analysis, latent variable models, Boltzmann machines, hidden Markov models ### Quality of Parameter Estimation Generative Models estimate the true parameter given a parameterized model class; the data is generated from a model of this class --> task is to find this model * model class known * task: estimate actual/true parameters * training data: {x} = {x^1^, x^2^, ...., x^l^} --> X (matrix of training data) * true parameter vector: w * estimate of w: w^(w-hat) ![](https://i.imgur.com/i2X3Jss.png) ![](https://i.imgur.com/o07vVW8.png) * loss: difference between true and estimated parameter * evaluate estimator: expected loss ### Maximum Likelihood Estimator * ML is one of the major objectives in unsupervised learning * ML is asymptotically efficient and unbiased * ML does everything right and this efficiently (if enough data is available) ![](https://i.imgur.com/XhyYuFT.png) * MLE is invariant under parameter change * MLE is asymptotically unbiased and efficient --> asymptotically optimal * MLE is asymptotically consistent (for large training sets the estimator w-hat approaches the true value) ### Expectation Maximization * likelihood can be optimized by gradient descent methods * likelihood cannot be computed analytically: * hidden states, many-to-one output mapping, non-linearities * **u** = hidden variables, latent variables, unobserved variables * likelihood is determined by all **u** mapped to x ![](https://i.imgur.com/A5U06I6.png) * Expectation Maximization (EM) algorithm: joint probability p(x, u; w) is easier to compute than likelihood --> estimate p(u|x;w) by Q(u|x) ![](https://i.imgur.com/SiH0vpM.png) **General Idea of EM Algorithm/K-means Clustering:** **Start**: we have given datapoints and we want to partition the data set into k clusters **Goal**: find assignment of data points to clusters as well as a set of vectors {μk} such that the sum of the squares of the distances of each data point to its closest vector μk is a minimum **Example**: k = 2 1. We choose 2 random initial values for our μk. 2. assign each datapoint to its nearest μk --> 2 clusters are formed 3. calculate the new means of the clusters = new μk 4. reassign each datapoint to the nearest μk 5. calculate new means of the clusters = new μk 6. .... **E step** = re-assign data points to clusters **M step** = re-compute the cluster mean repeat both steps until nothing changes --> convergence ![](https://i.imgur.com/G59QIGi.png) * EM increases the lower bound in both steps: ![](https://i.imgur.com/APQtsMK.png) * EM algorithm is used in hidden Markov models, mixture of Gaussians, factor analysis and independent component analysis **Videos:** https://www.youtube.com/embed/lMShR1vjbUo https://www.youtube.com/embed/rVfZHWTwXSA https://www.youtube.com/embed/JNlEIEwe-Cg <--- extrem gutes video https://brilliant.org/wiki/gaussian-mixture-model/ <--- guter artikel https://www.youtube.com/embed/REypj2sy_5U ### Maximum Entropy * maximal entropy given a class of distributions * minimal prior assumptions * physical systems converge to maximal entropy configurations * most likely observed solution * connection: statistical mechanics and information theory * principle of maximum entropy: first expounded by E.T. Jaynes in 1957 ![](https://i.imgur.com/uwHdYRc.png) * examples: normal distribution (given mean and std), uniform distribution (supported in the interval [a, b]), exponential distribution (given mean in [0, inf]) * not all classes of distributions contain a maximum entropy distribution: arbitrarily large entropy (distributions with mean), entropies of a class are bounded from above but not attained (distributions with mean zero, second moment one, third moment one) * Maximum Entropy Solution ![](https://i.imgur.com/Bs7kbt1.png) ## Principal Component Analysis (PCA) --- ### The Method There are two commonly used definitons of PCA that lead to the same algorithm. **For Variance Maximization:** Starting point we have centered data usually high dimensional. Sometimes the data is correlated, so we have to find the direction of the largest variance (i.e. 1st principal component), then orthogonal to that the direction of the 2nd largest variance and so on. ![](https://i.imgur.com/MPnAVZu.png) **Minimum error formulation:** Can be defined as the linear projection that minimizes the average projection cost, defined as the mean squared distance between the data points. ![](https://i.imgur.com/2t4JZKr.png) ### Variance Maximization 1. Shift the data such that it is centered (mean=0 for every dim) $\frac{1}{N}\sum_{i=1}^{N}x_i$ and write it in the matrix $X$ 2. Compute the symmetric and positive definite covariance matrix $C=\frac{1}{N}X^TX$ 3. Then the variance of the projected data is given by $u^TCu$ such that $u$ is a unit vector$(u^Tu=1)$ 4. Now we maximize the projected variance with respect to $u$. This has to be a constrained maximization to prevent $\lVert u \rVert \to \infty$. The appropriate constraint comes from $\lVert u \rVert = 1$ and to enforce this constraint we use a Lagrange multiplier. <br/> ![](https://i.imgur.com/L4MVBo9.png) <br/>This says that $u$ must be an eigenvector of $C$.Then we left multiply by $u^T$ to make use of $u^Tu=1$ and see that the variance is given by $u^TCu=\lambda$ and so we see that the eigenvalue $\lambda$ is the variance along the direction of $u$ which is our first principal component. 5. We can define additional principal components in an incremental fashion by choosing each new direction which maximizes the projected variance amongst all possible directions orthogonal to those already considered(adding new constraints to our Lagrangian) 6. To summarize PCA involves evaluating $X$ and the covariance matrix $C$ of the data set and then finding $M$ eigenvectors of $C$ corresponding to to the $M$ eigenvalues. 7. PCA defines a new space for the data, where each dimension explains less of the original variance than the last.The amount of variance explained can be seen from the eigenvectors.The amount of "explained variance" by principal component j is $v_j=\frac{\lambda_j}{\sum_{k=1}^{d}\lambda_k}$ ### Uniqueness In short PCA is unique. The longer answer is, PCA is unique up to signs, if the eigenvalues of the covariance matrix are different from each other. ### Properties of PCA PCA is often used to visualize data. (i.e. to downproject data to a small number of dimensions and plot it) In machine learning PCA is often used to reduce dimensionality * often drastically reduces amount of data -> faster algorithms, less memory needed * often performs better, since less overfitting * destroys sparseness * no guarantees, you may throw away important information * The projections onto PCs have zero mean * The projection of the data on the first principal component (PC) has maximal variance of all possible one-dimensional projections. That means $u$ maximizes * The projections onto PCs are mutually uncorrelated, that is, they are orthogonal to each other. * The sample variance of the $k$-th projection is equal to the $k$-th eigenvalue of the sample covariance matrix $C$ * PCs are ranked decreasingly according to their eigenvalues which are the variances in the PC direction * The first $l$ PCs minimize the mean-squared error ### Examples E.g. can be found in Hochreiter's skript page 47-60 contains various examples. ![](https://i.imgur.com/gU4AWUA.png) *Example: Showing how much "explained variance" the first few PC's contain, or rather retain* ### Kernel Principal Component Analysis PCA is a linear method but data is often not linearly separable. So the idea is to map data into a higher dimensional space where it becomes linearly separable and apply PCA there. ![](https://i.imgur.com/hXr2OD2.png) *Showing the mapping onto a higher dimensional plane* Before looking at the formulas for KPCA below i recommend to watch these two short videos on Kernel PCA, because they explain the fundamentals. [Kernel PCA by Reema Harnekar(volume is quite low)](https://www.youtube.com/watch?v=0zjfA1PO6DI) [Caltech (8.6 David Thompson (Part 6): Nonlinear Dimensionality Reduction: KPCA)](https://www.youtube.com/watch?v=HbDHohXPLnU) ![](https://i.imgur.com/4MXQyLt.png) ![](https://i.imgur.com/CSNCKne.png) ![](https://i.imgur.com/qKZAmWF.png) ![](https://i.imgur.com/6Wqp98Z.png) ![](https://i.imgur.com/pS3VtVE.png) ![](https://i.imgur.com/Pg42jNh.png) ## Independent Component Analysis (ICA) --- **videos** quick video introduction to the problem: https://www.youtube.com/watch?v=2WY7wCghSVI https://www.youtube.com/watch?v=wIlrddNbXDo https://www.youtube.com/watch?v=e4woe8GRjEI https://www.youtube.com/watch?v=SjM2Qm7N9CU longer and more detailed video: https://www.youtube.com/watch?v=YQA9lLdLig8 good slides for basic understanding: https://wwwf.imperial.ac.uk/~nsjones/TalkSlides/HyvarinenSlides.pdf good article for better understanding: http://arnauddelorme.com/ica_for_dummies/ concrete practical example with brain scans (long tutorial series): https://www.youtube.com/playlist?list=PLXc9qfVbMMN2uDadxZ_OEsHjzcRtlLNxc ### Basics and Intution Independent component analysis (ICA) goes beyond PCA, which decorrelated the components, by requiring statistically independent components. ICA decomposes a multivariate observation into additive components, where the components are non-Gaussian and statistically independent from each other. ICA differs from PCA in four major issues: * ICA does not maximize the variance, * ICA does not enforce orthogonal projection or demixing matrices, * ICA aims at statistically independent components, * ICA components are not ranked. Independent component analysis attempts to decompose a multivariate signal into independent non-Gaussian signals. As an example, sound is usually a signal that is composed of the numerical addition, at each time t, of signals from several sources. The question then is whether it is possible to separate these contributing sources from the observed total signal. When the statistical independence assumption is correct, blind ICA separation of a mixed signal gives very good results. ICA assumes that the observations x are generated by mixing the sources y, where both x and y are m-dimensional vectors: $x = U y$ U is seen as the mixing matrix The goal is to find a matrix W which de-mixes x with $y = W x$ with W being the de-mixing matrix $W = U^{-1}$ ### Identifiability and Uniqueness ICA is not unique. It is only unique up to scaling and ### Measuring Independence ICA finds the independent components (also called factors, latent variables or sources) by maximizing the statistical independence of the estimated components. We may choose one of many ways to define a proxy for independence, and this choice governs the form of the ICA algorithm. The two broadest definitions of independence for ICA are * Minimization of mutual information * Maximization of non-Gaussianity **Mutual Information** The basic idea is based on entropy. Entropy of a factorial code is larger than the entropy of the joint distribution. The difference I is called mutual information: $I(y_1,...,y_l) = \sum_{j=1}^l H(y_j) - H(y)$ H denotes the entropy. **Non-Gaussianity** Is based on the Central Limit Theorem: The distribution of a sum of a large number of independent random variables tends toward a Gaussian distribution. * Signal is more Gaussian than sources since it is a linear combination of them. * Signal becomes least Gaussian when equal to one of the sources Gaussianity is measured using “Cumulants” ## Factor Analysis --- **videos** https://www.youtube.com/watch?v=WV_jcaDBZ2I https://www.youtube.com/watch?v=TeIx7dRedkg https://www.youtube.com/watch?v=yWUKzEIeVWU https://www.youtube.com/watch?v=mIx-qlI4mJo https://www.youtube.com/watch?v=Vl7mtAmveYQ https://www.youtube.com/watch?v=PgqiBezoAUA https://www.youtube.com/watch?v=9j-c9fOIHmM https://www.youtube.com/watch?v=yj7Q0EM5VMA https://www.youtube.com/watch?v=G16c2ZODcg8 from the Standford video series https://www.youtube.com/watch?v=tw6cmL5STuY ## Scaling and Projection Methods --- ## Clustering --- ## Biclustering --- ---

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully