Skip to content
JimliboPublic

About

Python library implementing basic data science function and machine learning algorithms from scratch

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

30 Commits

Folders and files

Repository files navigation

📚 ds-lib

Python library that contains simple implementations of the most common machine learning algorithms from scratch.

📂 Modules

Module Description
🔍 clustering.py Implements the K-Means clustering algorithm for unsupervised partitioning of data points into k clusters.
🌳 decision_trees.py Implements entropy calculations and partition-based metrics used for building decision tree classifiers.
🧠 deep_learning.py Provides tensor operations and utilities for building deep learning models with multi-dimensional array support.
📈 gradient.py Implements gradient estimation and gradient descent optimization for minimizing cost functions.
🔬 inference.py Implements statistical inference utilities using normal approximation to binomial distributions and probability calculations.
👥 knn.py Implements the K-Nearest Neighbors classification algorithm that predicts labels based on the majority vote of k closest neighbors.
➕ linear_algebra.py Provides fundamental vector and matrix operations including addition, subtraction, dot product, and vector mean calculations.
📊 linear_regression.py Implements linear regression using the least squares method to fit a line to data and compute R-squared goodness-of-fit metrics.
📈 logistic_regression.py Implements logistic regression using the sigmoid function and negative log-likelihood for binary classification.
🛠️ ml_utils.py Provides machine learning utility functions including train/test data splitting and performance metrics like accuracy, precision, and recall.
📧 naive_bayes.py Implements a Naive Bayes text classifier for spam detection using token-based probability calculations and optional stemming.
🌐 network_analysis.py Implements graph algorithms for network analysis including shortest path calculations and centrality metrics.
🧠 neural_networks.py Implements basic neural network components including perceptrons, sigmoid activation functions, and feed-forward propagation.
🎲 probabilities.py Implements probability distributions including uniform and normal distributions with their PDF, CDF, and inverse CDF functions.
👍 recommendations.py Implements collaborative filtering using user-based similarity metrics and cosine similarity for recommendation systems.
📈 regression.py Implements multiple regression using stochastic gradient descent optimization with configurable learning rates and batch sizes.
📊 stats.py Implements descriptive statistics functions including mean, median, mode, quantiles, and measures of dispersion.

🔧 Installation

To install the library, clone the repository and run:

pip install .

Or directly install the repo as a python library with the command:

pip install git+https://github.com/Jimlibo/ds-lib

⚠️ Disclaimer

The code is mainly based on Joel Grus's book "Data Science from Scratch". You can find the book here.

About

Python library implementing basic data science function and machine learning algorithms from scratch

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages