Skip to main content

Perceptron implementation for linear, binary, and multi-class tasks

Project description

README: |

🚀 IntelliNeuro PerceptronX

🤖 Custom Perceptron Machine Learning Library

Author: Ajay Soni


📚 Introduction

IntelliNeuro’s PerceptronX is a fully custom-built Perceptron machine learning library created from scratch, utilizing only NumPy and pandas for efficient numerical computations and data handling.

This library provides:

  • 🔹 Linear regression
  • 🔹 Binary classification with sigmoid activation
  • 🔹 Foundational multi-class classification using softmax activation

It is designed with educational clarity and modularity in mind, perfect for learners and practitioners eager to grasp the inner workings of perceptrons through clean, step-by-step gradient descent optimization.


✨ Key Features

  • 🎯 Versatile Learning Tasks

    • Linear regression for continuous value prediction
    • Binary classification with sigmoid activation
    • Multi-class classification via softmax (demo-level support)
  • ⚙️ Robust Preprocessing Support

    • Built-in scaling options: none, minmax, and standard
    • Validation to ensure correct scaling usage
  • ⚡ Efficient Training Pipeline

    • Gradient descent optimization with up to 2,500,000 iterations
    • Early stopping based on tolerance threshold
    • Customizable learning rate and validation split
    • Detailed verbose training logs for monitoring
  • 📊 Comprehensive Prediction & Evaluation

    • Seamless predictions for all supported tasks
    • Wide range of evaluation metrics:
      • Regression: MSE, RMSE, RMSLE
      • Binary classification: Accuracy, Precision, Recall, F1
      • Multi-class classification: Accuracy, Weighted Precision, Recall, F1
  • 👌 User-Friendly & Informative

    • Clear, color-coded terminal outputs (via colorama)
    • Helpful warnings and error messages to guide usage

🚀 Quickstart Guide

  1. Install and Import the library:

    pip install IntelliNeuro==0.1.0
    from PerceptronX import Perceptron
    
  2. Initialize the model:

    model = Perceptron(
        learning_rate=0.001,
        validation_split=0.2,
        scaling='none',  # Options: 'none', 'minmax', 'standard'
        is_scaled=False,
        tolerance=1e-6
    )
    
  3. Train your model:

    model.fit(X_train, y_train)
    
  4. Make predictions:

    predictions = model.predict(X_test)
    
  5. Evaluate model performance:

    score = model.score(X_test, y_test, metrics='accuracy')
    print(f"Model Accuracy: {score}")
    

🔍 How It Works

  • ⚙️ Gradient Descent:

    • Iteratively updates weights and bias to minimize loss
    • Different loss functions per task:
      • Linear regression: Mean Squared Error (MSE)
      • Binary classification: Log loss with sigmoid activation
      • Multi-class classification: Cross-entropy with softmax
  • 🔄 Scaling Techniques:

    • Manual min-max and standard scaling implementations
    • Auto-validation to prevent misuse
  • 🧪 Validation:

    • Splits data based on validation_split parameter
    • Prints validation metrics post-training for model monitoring
  • 🔔 Activation Functions:

    • Sigmoid for binary classification tasks
    • Softmax for multi-class classification

⚠️ Important Notes

  • Multi-class classification is experimental and intended for learning purposes only.
  • Ensure your data is scaled appropriately or specify scaling parameters.
  • Predictions or scoring before training will raise errors.
  • Color-coded outputs help distinguish warnings, info, and errors clearly.

🛠️ Installation

Requires Python 3.7+ and the following packages:

  • numpy
  • pandas
  • scikit-learn (for evaluation metrics)
  • colorama (for colored terminal output)

Install dependencies with:

pip install numpy pandas scikit-learn colorama


💡 Best Practices

  • Always preprocess your features correctly or enable built-in scaling.
  • Use validation_split to track model performance during training.
  • Treat multi-class functionality as a conceptual demonstration.
  • Tune learning_rate and tolerance to balance accuracy and training speed.
  • Watch console warnings carefully to avoid common pitfalls.

🤝 Support & Contributions

Author: Ajay Soni
Repository: https://github.com/ml-beginner-learner/IntelliNeuro
Email: programmingwithcode@gmail.com

Contributions, issues, and feedback are welcome!
Please open an issue or pull request to help improve this library.


📄 License

This project is licensed under the MIT License.
Feel free to use, modify, and distribute with proper attribution.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

intellineuro-0.1.0.tar.gz (7.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

intellineuro-0.1.0-py3-none-any.whl (7.4 kB view details)

Uploaded Python 3

File details

Details for the file intellineuro-0.1.0.tar.gz.

File metadata

  • Download URL: intellineuro-0.1.0.tar.gz
  • Upload date:
  • Size: 7.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for intellineuro-0.1.0.tar.gz
Algorithm Hash digest
SHA256 dd5e010718326d06edf337e45f80eaf972253008bb3d6502b524da5cb79e7fb7
MD5 2dca6cd95750ec3514b804fa1d94b1d7
BLAKE2b-256 d9e9ee42e47e9df7cbd5b048958605e12b911feced694c5b1c0096a88e25d95f

See more details on using hashes here.

File details

Details for the file intellineuro-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: intellineuro-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 7.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for intellineuro-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 882735c7b55503b995312a634770802331711730f8982ed01c2df7dd5ff119c0
MD5 204b3e31ad8dae87439fa6d628a603c2
BLAKE2b-256 b407d20f6b4c5c4588966461ce2fc244eb56f65c824520687c20a7d5ef118b71

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page