LightML.jl
Minimal and clean examples of machine learning algorithms implemented in Julia
Install / Use
/learn @memoiry/LightML.jlREADME
LightML.jl
About
LightML.jl is a collection of reimplementation of general machine learning algorithm in Julia.
The purpose of this project is purely self-educational.
Why?
This project is targeting people who want to learn internals of ml algorithms or implement them from scratch.
The code is much easier to follow than the optimized libraries and easier to play with.
All algorithms are implemented in Julia.
You should access test function of every implementation for its usage in detail. Every model is actually constructed in a similar manner.
Installation
First make sure you have correct python dependency. You can use the Conda Julia package to install more Python packages, and import Conda to print the Conda.PYTHONDIR directory where python was installed. On GNU/Linux systems, PyCall will default to using the python program (if any) in your PATH.
The advantage of a Conda-based configuration is particularly compelling if you are installing PyCall in order to use packages like PyPlot.jl or SymPy.jl, as these can then automatically install their Python dependencies.
ENV["PYTHON"]=""
Pkg.add("Conda")
using Conda
Conda.add("python==2.7.13")
Conda.add("matplotlib")
Conda.add("scikit-learn")
Pkg.add("PyCall")
Pkg.build("PyCall")
or you can simply
Pkg.build("LightML")
It's actually same with the procedure above.
Then every dependency should be configured, you can simply run command below to install the package.
Pkg.clone("https://github.com/memoiry/LightML.jl")
Running Implementations
Let's first try the overall functionality test.
using LightML
test_LSC()
<p align="center">
<img src="https://ooo.0o0.ooo/2017/03/25/58d640c2c7a1a.png" width="640">
</p>
<p align="center" style="color:rgb(220,220,220);">
Figure 1: Smiley, spirals, shapes and cassini Datasets using LSC(large scale spectral clustering)
</p>
Running Demo
using LightML
demo()
<p align="center">
<img src="https://ooo.0o0.ooo//2017//03//15//58c8cb6e1a1d3.png" width="640"></img>
</p>
<p align="center" style="color:rgb(220,220,220);">
Figure 2: The Digit Dataset using Demo algorithms
</p>
Current Implementations
Supervised Learning:
- Adaboost
- Decision Tree
- Gradient Boosting
- Gaussian Discriminant Analysis
- K Nearest Neighbors
- Linear Discriminant Analysis
- Linear Regression
- Logistic Regression
- Multilayer Perceptron
- Naive Bayes
- Ridge Regression
- Lasso Regression
- Support Vector Machine
- Hidden Markov Model
- Label propagation
- Random Forests
- XGBoost
Unsupervised Learning:
- Gaussian Mixture Model
- K-Means
- Principal Component Analysis
- Spectral Clustering
- Large Scale Spectral Clustering
Test Example available
- test_ClassificationTree()
- test_RegressionTree()
- test_label_propagation()
- test_LDA()
- test_naive()
- test_NeuralNetwork()
- test_svm()
- test_kmeans_random()
- test_PCA()
- test_Adaboost()
- test_BoostingTree()
- test_spec_cluster()
- test_LogisticRegression()
- test_LinearRegression()
- test_kneast_regression()
- test_kneast_classification()
- test_LSC()
- test_GaussianMixture() (Fixing)
- test_GDA() (Fixing)
- test_HMM() (Fixing)
- test_xgboost (Fixing)
Contribution
Please examine the todo list for contribution detials.
Any Pull request is welcome.
Selected Examples
LinearRegression
using LightML
test_LinearRegression()
<p align="center">
<img src="https://ooo.0o0.ooo//2017//03//11//58c2cf6a8726e.png" width="480">
</p>
<p align="center" style="color:rgb(220,220,220);">
Figure 3: The regression Dataset using LinearRegression
</p>
Adaboost
test_Adaboost()
<p align="center">
<img src="https://ooo.0o0.ooo//2017//03//11//58c36970c58a8.png" width="480">
</p>
<p align="center" style="color:rgb(220,220,220);">
Figure 4: The classification Dataset using Adaboost
</p>
SVM
test_svm()
<p align="center">
<img src="https://ooo.0o0.ooo//2017//03//11//58c367760e76a.png" width="480">
</p>
<p align="center" style="color:rgb(220,220,220);">
Figure 5: The classification Dataset using LinearRegression
</p>
Classification Tree
test_ClassificationTree()
<p align="center">
<img src="https://ooo.0o0.ooo//2017//03//11//58c36775113e6.png" width="480">
</p>
<p align="center" style="color:rgb(220,220,220);">
Figure 6: The digit Dataset using Classification Tree
</p>
kmeans
test_kmeans_random()
<p align="center">
<img src="https://ooo.0o0.ooo//2017//02//18//58a8445e2114b.png" width="480">
</p>
<p align="center" style="color:rgb(220,220,220);">
Figure 7: The blobs Dataset using k-means
</p>
LDA
test_LDA()
<p align="center">
<img src="https://ooo.0o0.ooo//2017//03//02//58b82861bade3.png" width="480">
</p>
<p align="center" style="color:rgb(220,220,220);">
Figure 8: The classification Dataset using LDA
</p>
PCA
test_PCA()
<p align="center">
<img src="https://ooo.0o0.ooo//2017//03//11//58c36773da5da.png" width="480">
</p>
<p align="center" style="color:rgb(220,220,220);">
Figure 9: The Digit Dataset using PCA
</p>Related Skills
YC-Killer
2.7kA library of enterprise-grade AI agents designed to democratize artificial intelligence and provide free, open-source alternatives to overvalued Y Combinator startups. If you are excited about democratizing AI access & AI agents, please star ⭐️ this repository and use the link in the readme to join our open source AI research team.
groundhog
398Groundhog's primary purpose is to teach people how Cursor and all these other coding agents work under the hood. If you understand how these coding assistants work from first principles, then you can drive these tools harder (or perhaps make your own!).
last30days-skill
18.3kAI agent skill that researches any topic across Reddit, X, YouTube, HN, Polymarket, and the web - then synthesizes a grounded summary
sec-edgar-agentkit
10AI agent toolkit for accessing and analyzing SEC EDGAR filing data. Build intelligent agents with LangChain, MCP-use, Gradio, Dify, and smolagents to analyze financial statements, insider trading, and company filings.
