# tensorflow-ml
![Keras](https://img.shields.io/badge/Keras-FF0000?style=for-the-badge&logo=keras&logoColor=white) ![Tensorflow](https://img.shields.io/badge/TensorFlow-FF6F00?style=for-the-badge&logo=tensorflow&logoColor=white) ![PyPI](https://img.shields.io/badge/pypi-3775A9?style=for-the-badge&logo=pypi&logoColor=white) ![Python](https://img.shields.io/badge/Python-FFD43B?style=for-the-badge&logo=python&logoColor=blue) ![Dependabot](https://img.shields.io/badge/dependabot-025E8C?style=for-the-badge&logo=dependabot&logoColor=white)
[![Upload Python Package](https://github.com/siddhantpathakk/tensorflow-ml/actions/workflows/python-publish.yml/badge.svg?branch=main)](https://github.com/siddhantpathakk/tensorflow-ml/actions/workflows/python-publish.yml)
## Introduction
TensorFlow ML is a project that aims to provide an abstract implementation of commonly used machine learning algorithms using TensorFlow, without relying on external libraries like scikit-learn. This project is designed to offer a comprehensive and flexible set of machine learning models that can be used for various tasks, such as classification, regression, clustering, and more.
The TensorFlow ML project is useful for several reasons and can overcome the needs of scikit-learn in various scenarios:
1. **TensorFlow Backend:** By leveraging TensorFlow as its backend, TensorFlow ML can take advantage of its efficient computation and optimization capabilities. TensorFlow is well-known for its ability to work with large-scale datasets and efficiently utilize hardware accelerators like GPUs and TPUs, making it suitable for handling complex machine learning models and tasks.
2. **Flexibility and Customizability:** With TensorFlow ML, users have the flexibility to customize and fine-tune machine learning models according to their specific needs. TensorFlow's symbolic representation and automatic differentiation capabilities enable easy modification of models, loss functions, and optimization algorithms. This level of customization may not always be readily available in pre-implemented models of scikit-learn.
3. **Continuous Development and Updates:** As TensorFlow ML is an open-source project, it can benefit from a large community of contributors and developers. This means that the project is continually evolving, and new algorithms and improvements can be added regularly. This is especially advantageous for staying up-to-date with the latest advancements in machine learning.
4. **Unified Framework:** By using TensorFlow ML, developers and researchers can work within a single framework for both traditional machine learning and deep learning tasks. This avoids the need to switch between different libraries and provides a more cohesive environment for developing and deploying machine learning models.
5. **Community and Support:** TensorFlow has a large and active community of users and contributors. This means that users of TensorFlow ML can benefit from the collective knowledge and support of this community, which can be invaluable for troubleshooting, sharing best practices, and fostering collaborative development.
## Status
This project is currently under development. The following table shows the status of the implemented machine learning models:
| Model | Type | Code | Test |
| ---------------------- | -------------- | ---- | ---- |
| Linear Regression | Regression | Done | Pass |
| Logistic Regression | Classification | Done | Pass |
| NB - GNB/BNB | Classification | Done | Pass |
| Random Forest/GBT/CART | Classification | Done | Pass |
| Lasso Regression | Regression | Done | Pass |
| Polynomial Reg | Regression | Done | Pass |
| Ridge Regression | Regression | Done | Pass |
The following table shows the status of working status on different operating systems:
| Operating System | Status |
| ---------------- | ----------- |
| Linux | Pass |
| MacOS | In Progress |
| Windows | TBC |
## Installing
You can install TensorFlow ML from PyPI using `pip`. Follow these steps:
```bash
pip install tensorflow-ml
```
Alternatively, to use TensorFlow ML from GitHub directly, follow these steps:
1. Clone the GitHub repository: `git clone https://github.com/siddhantpathakk/tensorflow-ml.git`
2. Install the required dependencies by running: `pip install -r requirements.txt`
After the installation is complete, you can import the implemented machine learning models in your Python scripts and start using TensorFlow ML for your machine learning tasks.
## Examples
Here are some examples of how to use TensorFlow ML to create machine learning models:
**REGRESSION:**
* Linear Regression (Regular, Polynomial, Ridge, Lasso)
```python
from tensorflow_ml.regression.linear import LinearRegression
# Try other regression models if you feel like!
# from tensorflow_ml.regression.polynomial import PolynomialRegression
# from tensorflow_ml.regression.ridge import RidgeRegression
# from tensorflow_ml.regression.lasso import LassoRegression
lr = LinearRegression()
# Set the hyper-parameters such as learning-rate, number of epochs etc
lr.set_params(_params)
# Train the model
lr.fit(x, y)
# Get the MSE
lr.evaluate(x, y)
# Get the predictions
lr.predict(x)
# Get the R-squared value
lr.score(x, y)
# Get the coefficients of the trained model
lr.get_coeff()
```
**CLASSIFICATION:**
* Logistic Regression
```python
from tensorflow_ml.classification.logistic_regression import LogisticRegression
logistic_regression = LogisticRegression()
# Set the hyper-parameters such as learning-rate, number of epochs etc
logistic_regression.set_params(params)
# Train the model
logistic_regression.fit(X_train, y_train, random_seed=42, X_val=X_val, y_val=y_val)
# Evaluate the model on the test set
accuracy, cross_entropy_loss = logistic_regression.score(X_test, y_test)
```
* Naive Bayes Classifier (Bernoulli NB, Gaussian NB)
```python
from tensorflow_ml.classification.naive_bayes.bernoulli import BernoulliNaiveBayes
# Set some additional hyper-parameters
bnb = BernoulliNaiveBayes(smoothing=1.0) # Set the desired smoothing parameter
# Train the model
bnb.fit(training_features, training_labels)
# Get the accuracy of the model on test set
accuracy = bnb.evaluate(testing_features, testing_labels)
```
* Random Forests, Gradient Boosted Trees
```python
from tensorflow_ml.classification.decision_tree import DecisionTree
model = DecisionTree(model = "gbt", verbose = True) # Also can use 'rf' for Random Forests, 'cart' for Classification and Regression Tree
# If regression:
model = DecisionTree(model = "gbt", verbose = True, _task = 'regression')
# Get the parameters pre-defined by the model
model.get_params()
# Load the dataset and convert it to TFDS
model.load_dataset(data, label)
# Train the model
model.fit(_metrics = ['mse', 'accuracy'])
# Evaluate the model and view metrics and loss
model.evaluate()
# Make predictions on test/train split of data
model.predict(length=5, split="test")
```
## Participate in Contributing to this Repo
We welcome contributions from the open-source community to enhance the TensorFlow ML library. If you are interested in contributing, follow these steps:
1. Fork the project on GitHub: [https://github.com/siddhantpathakk/tensorflow-ml](https://github.com/your_username/tensorflow-ml)
2. Create a new branch for your feature/bugfix: `git checkout -b feature-name`
3. Implement your changes and improvements.
4. Write tests to ensure the functionality of the added models.
5. Commit your changes and push them to your forked repository.
6. Create a pull request to the main repository, describing your changes in detail.
Your contributions will be reviewed, and once approved, they will be merged into the main project. Let's work together to make TensorFlow ML a powerful and versatile machine learning library!
In summary, TensorFlow ML is a powerful and v
没有合适的资源?快使用搜索试试~ 我知道了~
tensorflow-ml-1.1.2.tar.gz
0 下载量 71 浏览量
2024-03-21
12:48:38
上传
评论
收藏 7KB GZ 举报
温馨提示
Python库是一组预先编写的代码模块,旨在帮助开发者实现特定的编程任务,无需从零开始编写代码。这些库可以包括各种功能,如数学运算、文件操作、数据分析和网络编程等。Python社区提供了大量的第三方库,如NumPy、Pandas和Requests,极大地丰富了Python的应用领域,从数据科学到Web开发。Python库的丰富性是Python成为最受欢迎的编程语言之一的关键原因之一。这些库不仅为初学者提供了快速入门的途径,而且为经验丰富的开发者提供了强大的工具,以高效率、高质量地完成复杂任务。例如,Matplotlib和Seaborn库在数据可视化领域内非常受欢迎,它们提供了广泛的工具和技术,可以创建高度定制化的图表和图形,帮助数据科学家和分析师在数据探索和结果展示中更有效地传达信息。
资源推荐
资源详情
资源评论
收起资源包目录
tensorflow-ml-1.1.2.tar.gz (11个子文件)
tensorflow-ml-1.1.2
setup.py 1KB
LICENSE 1KB
PKG-INFO 9KB
tensorflow_ml.egg-info
SOURCES.txt 236B
top_level.txt 14B
PKG-INFO 9KB
requires.txt 3KB
dependency_links.txt 1B
tensorflow_ml
__init__.py 33B
setup.cfg 38B
README.md 8KB
共 11 条
- 1
资源评论
程序员Chino的日记
- 粉丝: 3693
- 资源: 5万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 技术资料分享STM32模拟EEPROM的使用和优化很好的技术资料.zip
- Servlet 客户端 HTTP 请求详解.pdf
- 技术资料分享Stm32寄存器与库函数概览(摘自固件库使用手册)很好的技术资料.zip
- 一款可在线播放多个免费听书站的Android应用程序.zip
- AssertionFailedError如何解决.md
- java.HttpClient与网络请求(解决方案).md
- 技术资料分享STM32固件库使用手册的中文翻译版很好的技术资料.zip
- 非常好的oracle性能优化技术内幕详解100%好用.7z
- 已停产 适用于 Android 平台的 Rrich 文本编辑器 Android富文本编辑器,暂停维护.zip
- 非常好的MySQL技术内幕详解100%好用.7z
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功