tensorflow-ml


Nametensorflow-ml JSON
Version 1.1.3.2 PyPI version JSON
download
home_page
SummaryTensorflow ML
upload_time2023-08-07 16:51:22
maintainer
docs_urlNone
authorSiddhant Pathak
requires_python
license
keywords python tensorflow ml keras
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 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) [![docs](https://github.com/siddhantpathakk/tensorflow-ml/actions/workflows/pages/pages-build-deployment/badge.svg)](https://github.com/siddhantpathakk/tensorflow-ml/actions/workflows/pages/pages-build-deployment)


## 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 versatile alternative to scikit-learn, providing users with a wide range of machine learning algorithms, seamless deep learning integration, customizability, and access to the rich TensorFlow ecosystem. Whether it's traditional machine learning or cutting-edge deep learning, TensorFlow ML has the potential to meet the diverse needs of machine learning practitioners and researchers.

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "tensorflow-ml",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "python,tensorflow,ml,keras",
    "author": "Siddhant Pathak",
    "author_email": "siddhantpathak2@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/af/13/47e1d892396fe7f48f346945c71242606d148f9ddc833d29cdc0ea1ebbbf/tensorflow-ml-1.1.3.2.tar.gz",
    "platform": null,
    "description": "# tensorflow-ml\n\n![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)\n\n[![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) [![docs](https://github.com/siddhantpathakk/tensorflow-ml/actions/workflows/pages/pages-build-deployment/badge.svg)](https://github.com/siddhantpathakk/tensorflow-ml/actions/workflows/pages/pages-build-deployment)\n\n\n## Introduction\n\nTensorFlow 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.\n\nThe TensorFlow ML project is useful for several reasons and can overcome the needs of scikit-learn in various scenarios:\n\n1. **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.\n2. **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.\n3. **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.\n4. **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.\n5. **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.\n\n## Status\n\nThis project is currently under development. The following table shows the status of the implemented machine learning models:\n\n| Model                  | Type           | Code | Test |\n| ---------------------- | -------------- | ---- | ---- |\n| Linear Regression      | Regression     | Done | Pass |\n| Logistic Regression    | Classification | Done | Pass |\n| NB - GNB/BNB           | Classification | Done | Pass |\n| Random Forest/GBT/CART | Classification | Done | Pass |\n| Lasso Regression       | Regression     | Done | Pass |\n| Polynomial Reg         | Regression     | Done | Pass |\n| Ridge\u00a0Regression      | Regression     | Done | Pass |\n\nThe following table shows the status of working status on different operating systems:\n\n| Operating System | Status      |\n| ---------------- | ----------- |\n| Linux            | Pass        |\n| MacOS            | In Progress |\n| Windows          | TBC         |\n\n## Installing\n\nYou can install TensorFlow ML from PyPI using `pip`. Follow these steps:\n\n```bash\npip install tensorflow-ml\n```\n\nAlternatively, to use TensorFlow ML from GitHub directly, follow these steps:\n\n1. Clone the GitHub repository: `git clone https://github.com/siddhantpathakk/tensorflow-ml.git`\n2. Install the required dependencies by running: `pip install -r requirements.txt`\n\nAfter 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.\n\n## Examples\n\nHere are some examples of how to use TensorFlow ML to create machine learning models:\n\n**REGRESSION:**\n\n* Linear Regression (Regular, Polynomial, Ridge, Lasso)\n\n```python\nfrom tensorflow_ml.regression.linear import LinearRegression\n\n# Try other regression models if you feel like!\n# from tensorflow_ml.regression.polynomial import PolynomialRegression\n# from tensorflow_ml.regression.ridge import RidgeRegression\n# from tensorflow_ml.regression.lasso import LassoRegression\n\nlr = LinearRegression()\n\n# Set the hyper-parameters such as learning-rate, number of epochs etc\nlr.set_params(_params)\n\n# Train the model\nlr.fit(x, y)\n\n# Get the MSE\nlr.evaluate(x, y)\n\n# Get the predictions\nlr.predict(x)\n\n# Get the R-squared value \nlr.score(x, y)\n\n# Get the coefficients of the trained model\nlr.get_coeff()\n```\n\n**CLASSIFICATION:**\n\n* Logistic Regression\n\n```python\nfrom tensorflow_ml.classification.logistic_regression import LogisticRegression\nlogistic_regression = LogisticRegression()\n\n# Set the hyper-parameters such as learning-rate, number of epochs etc\nlogistic_regression.set_params(params)\n\n# Train the model\nlogistic_regression.fit(X_train, y_train, random_seed=42, X_val=X_val, y_val=y_val)\n\n# Evaluate the model on the test set\naccuracy, cross_entropy_loss = logistic_regression.score(X_test, y_test)\n```\n\n* Naive Bayes Classifier (Bernoulli NB, Gaussian NB)\n\n```python\nfrom tensorflow_ml.classification.naive_bayes.bernoulli import BernoulliNaiveBayes\n\n# Set some additional hyper-parameters\nbnb = BernoulliNaiveBayes(smoothing=1.0)  # Set the desired smoothing parameter\n\n# Train the model\nbnb.fit(training_features, training_labels)\n\n# Get the accuracy of the model on test set\naccuracy = bnb.evaluate(testing_features, testing_labels)\n```\n\n* Random Forests, Gradient Boosted Trees\n\n```python\nfrom tensorflow_ml.classification.decision_tree import DecisionTree\n\nmodel = DecisionTree(model = \"gbt\", verbose = True) # Also can use 'rf' for Random Forests, 'cart' for Classification and Regression Tree\n\n# If regression:\nmodel = DecisionTree(model = \"gbt\", verbose = True, _task = 'regression') \n\n# Get the parameters pre-defined by the model\nmodel.get_params()\n\n# Load the dataset and convert it to TFDS\nmodel.load_dataset(data, label)\n\n# Train the model\nmodel.fit(_metrics = ['mse', 'accuracy'])\n\n# Evaluate the model and view metrics and loss\nmodel.evaluate()\n\n# Make predictions on test/train split of data\nmodel.predict(length=5, split=\"test\")\n```\n\n## Participate in Contributing to this Repo\n\nWe welcome contributions from the open-source community to enhance the TensorFlow ML library. If you are interested in contributing, follow these steps:\n\n1. Fork the project on GitHub: [https://github.com/siddhantpathakk/tensorflow-ml](https://github.com/your_username/tensorflow-ml)\n2. Create a new branch for your feature/bugfix: `git checkout -b feature-name`\n3. Implement your changes and improvements.\n4. Write tests to ensure the functionality of the added models.\n5. Commit your changes and push them to your forked repository.\n6. Create a pull request to the main repository, describing your changes in detail.\n\nYour 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!\n\nIn summary, TensorFlow ML is a powerful and versatile alternative to scikit-learn, providing users with a wide range of machine learning algorithms, seamless deep learning integration, customizability, and access to the rich TensorFlow ecosystem. Whether it's traditional machine learning or cutting-edge deep learning, TensorFlow ML has the potential to meet the diverse needs of machine learning practitioners and researchers.\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "Tensorflow ML",
    "version": "1.1.3.2",
    "project_urls": null,
    "split_keywords": [
        "python",
        "tensorflow",
        "ml",
        "keras"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "960af325ea5010d08a2c5b9a9c5ea27577cd0a8647b273af00e128793caf7270",
                "md5": "a619c3bff92b9d96dd1b77f1a9e89c46",
                "sha256": "6c49e13a82a7643c865eb7bf923231d83590edcd8cea6c47c36de00cdc3e2efd"
            },
            "downloads": -1,
            "filename": "tensorflow_ml-1.1.3.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "a619c3bff92b9d96dd1b77f1a9e89c46",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 29427,
            "upload_time": "2023-08-07T16:51:20",
            "upload_time_iso_8601": "2023-08-07T16:51:20.448596Z",
            "url": "https://files.pythonhosted.org/packages/96/0a/f325ea5010d08a2c5b9a9c5ea27577cd0a8647b273af00e128793caf7270/tensorflow_ml-1.1.3.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "af1347e1d892396fe7f48f346945c71242606d148f9ddc833d29cdc0ea1ebbbf",
                "md5": "b362cb0168c7c51895b67274445ad34e",
                "sha256": "e251288348a18f4ea1506cde97abc40b51acf973662b815787c82860cd3df1ea"
            },
            "downloads": -1,
            "filename": "tensorflow-ml-1.1.3.2.tar.gz",
            "has_sig": false,
            "md5_digest": "b362cb0168c7c51895b67274445ad34e",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 25000,
            "upload_time": "2023-08-07T16:51:22",
            "upload_time_iso_8601": "2023-08-07T16:51:22.615580Z",
            "url": "https://files.pythonhosted.org/packages/af/13/47e1d892396fe7f48f346945c71242606d148f9ddc833d29cdc0ea1ebbbf/tensorflow-ml-1.1.3.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-08-07 16:51:22",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "tensorflow-ml"
}
        
Elapsed time: 0.11350s