GithubHelp home page GithubHelp logo

zhangerjun / ml-basic-algorithms Goto Github PK

View Code? Open in Web Editor NEW
2.0 3.0 0.0 8.15 MB

Basic Machine Learning algorithms from scratch (numpy)

License: MIT License

Jupyter Notebook 100.00%
kmeans-algorithm machine-learning-algorithms gradient-descent-algorithm multiprocessing multithreading

ml-basic-algorithms's Introduction

Static Badge

Machine Learning Basic Algorithms From Scratch

An Introduction to Python-based MRI Data Analysis: mini-project VIII/VIII

Introduction

Motivation

  1. k-means: I have some data, I want to explore them and try to look for some potential models behind it.
  2. Gradient Descending Algorithm: With complex loss function, can I find some solutions quickly?
  3. Multi-core computation: With large dataset, machine learning takes long time to run. If I could take advantage of my multi-core computer, that will save a lot of time.

Method

  1. k means algorithm;
  2. Gradient Descending Algorithm
  3. Multi-core computation

Results and Discussion

  • k-means results
1 1

Confusion matrix (left); Centroids pathways while updating (right). {\color{red} $\star$} refers initial points of k means; 'x' refers wrong prediction.

  • Gradient Descending Algorithm and it's performance while discovering iris pedal width and length
1 1

Left: $lr = 0.0001$ and $eps=0.01$; right: $lr = 0.0005$ and $eps=0.01$.

  • Multi-core processing
1

Reproducibility

Dependencies

I test these codes on linux systerm (Ubuntu 22.04). I tried to make these codes only depend on numpy. These are basic python libararies, thus it should work if you computer can use python3.

  • python3;
  • python libraries: numpy.

Usage

Conclusion

Deliverables:

  • k means algorithm: k-means algorithm can help research to discover their data at the beginning, so I wrote k means from scatch;
  • Gradient Descent algorithm: gradient descent method is widely used in aspect of machine learning, it is necessary to build it from scratch at the beginning;
  • EM algorithm: EM algorithm is useful for hidden unknowns optimization, k-means algorithm is an perfect example to excersice EM;
  • Multi core processing: deal with big data, expecially long dataset, multi core processing can save a lot of time.

Acknowledgement

This mini project started from Dec. 2022, and it is still onging currently. If you have any questions or want to share your ideas, do not hesitate to contact me by email. If you find problems in the code, welcome to send a pull request.Thanks.

ml-basic-algorithms's People

Contributors

zhangerjun avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.