{"id":19974321,"url":"https://github.com/gbroques/perceptron","last_synced_at":"2025-08-20T18:36:35.419Z","repository":{"id":50205340,"uuid":"130708588","full_name":"gbroques/perceptron","owner":"gbroques","description":"Perceptron learning algorithm implemented in Python.","archived":false,"fork":false,"pushed_at":"2022-12-08T02:14:40.000Z","size":133,"stargazers_count":0,"open_issues_count":4,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-12T09:42:37.322Z","etag":null,"topics":["machine-learning","perceptron","perceptron-learning-algorithm","python3"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gbroques.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-04-23T14:22:45.000Z","updated_at":"2018-04-26T01:12:07.000Z","dependencies_parsed_at":"2023-01-25T03:15:35.128Z","dependency_job_id":null,"html_url":"https://github.com/gbroques/perceptron","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gbroques%2Fperceptron","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gbroques%2Fperceptron/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gbroques%2Fperceptron/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gbroques%2Fperceptron/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gbroques","download_url":"https://codeload.github.com/gbroques/perceptron/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241411427,"owners_count":19958746,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["machine-learning","perceptron","perceptron-learning-algorithm","python3"],"created_at":"2024-11-13T03:14:36.661Z","updated_at":"2025-03-01T18:40:39.941Z","avatar_url":"https://github.com/gbroques.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Perceptron\n\n[![Build Status](https://travis-ci.org/gbroques/perceptron.svg?branch=master)](https://travis-ci.org/gbroques/perceptron)\n[![Coverage Status](https://coveralls.io/repos/github/gbroques/perceptron/badge.svg?branch=master)](https://coveralls.io/github/gbroques/perceptron?branch=master)\n\nPerceptron learning algorithm implemented in Python.\n\n![perceptron](perceptron.png)\n\n## Getting Started\nThis project depends upon the popular numerical processing library [NumPy](http://www.numpy.org/) for lightning-fast vector arithmetic, and other packages for unit testing.\n\n### Prerequisites\n\nTo install NumPy, it's recommended you use Python's offical package manager **pip**.\n\nTo ensure pip is installed on your machine, run the command:\n\n```\n$ pip --version\n```\n\npip should come installed with Python depending upon your version.\n\nFor more details, see [installation](https://pip.pypa.io/en/stable/installing/)\non pip's documentation.\n\n### Installing\nIt's recommended you use `virtualenv` to create isolated Python environments.\n\nYou can find details on [virtualenv's documentation](https://virtualenv.pypa.io/en/stable/).\n\nOnce pip is installed, run:\n\n```\n$ pip install -r requirements.txt\n```\n\nThis will install this project's dependencies on your machine.\n\n## How to Run\n\n```\n$ python main.py\n```\n\n## Usage\nAPI inspired by the popular machine learning library\n[scikit-learn](http://scikit-learn.org/stable/modules/generated/sklearn.linear_model.Perceptron.html).\n\n```python\nimport numpy as np\nfrom perceptron import Perceptron\n\n# Training data for logical OR function\ntraining_data = np.array([\n    [0, 0, 0],\n    [0, 1, 1],\n    [1, 0, 1],\n    [1, 1, 1]\n])\ndesign_matrix = training_data[:, :2]\ntarget_values = training_data[:, -1]\n\nperceptron = Perceptron(max_iter=100, learning_rate=0.2)\nperceptron.fit(design_matrix, target_values)\npredictions = perceptron.predict(design_matrix)\nprint(predictions)  # [0, 1, 1, 1]\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgbroques%2Fperceptron","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgbroques%2Fperceptron","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgbroques%2Fperceptron/lists"}