-1NeuronPerceptron_Pypi
1Neuron|Perceptron|_Pypi
""" author: Nazmul email: md.nazmul.islam0087@gmail.com """
How to use this
First install the library using below command by using latest version-
pip install 1NeuronPerceptron-Pypi-mdnazmulislam0087==0.0.4
Run the below code to see the training and plot file for or Gate, similarly you can use AND, NAND and XOR GATE to see the difference-
from oneNeuronPerceptron.perceptron import Perceptron
from oneNeuronPerceptron.all_utils import prepare_data, save_model, save_plot
import pandas as pd
import numpy as np
import logging
import os
logging_str = "[%(asctime)s: %(levelname)s: %(module)s] %(message)s"
logging.basicConfig(level=logging.INFO, format=logging_str)
def main(data, eta, epochs, modelfilename,plotfilename):
df = pd.DataFrame(data)
logging.info(f"The dataframe is : {df}")
X,y = prepare_data(df)
model = Perceptron(eta=eta, epochs=epochs)
model.fit(X, y)
_ = model.total_loss()
save_model(model, filename=modelfilename)
save_plot(df, file_name=plotfilename, model=model)
if __name__=="__main__": # << entry point <<
OR = {
"x1": [0,0,1,1],
"x2": [0,1,0,1],
"y": [0,1,1,1],
}
ETA = 0.3 # 0 and 1
EPOCHS = 10
try:
logging.info(">>>>> starting training >>>>>")
main(data=OR, eta=ETA, epochs=EPOCHS, modelfilename="or.model", plotfilename="or.png")
logging.info("<<<<< training done successfully<<<<<\n")
except Exception as e:
logging.exception(e)
raise e
Packages required-
- matplotlib
- numpy
- pandas
- joblib
- tqdm
Limitation
Using one Neuron Perceptron, We cant make decision boundary for XOR GATe, In summary XOR Gate classification is not possible using one Neuron Perceptron
Reference -
github docs for github actions
more details can be found
Metadata
Release files for 1NeuronPerceptron-Pypi-mdnazmulislam0087 0.0.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| 1NeuronPerceptron_Pypi-mdnazmulislam0087-0.0.4.tar.gz | 16.6 kB | Without provenance | Details for 1NeuronPerceptron_Pypi-mdnazmulislam0087-0.0.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| 1NeuronPerceptron_Pypi_mdnazmulislam0087-0.0.4-py3-none-any.whl | Python 3 | none | any | Details for 1NeuronPerceptron_Pypi_mdnazmulislam0087-0.0.4-py3-none-any.whl |
Total release size: 34.1 kB
Release files / 1NeuronPerceptron_Pypi-mdnazmulislam0087-0.0.4.tar.gz
| Download URL | 1NeuronPerceptron_Pypi-mdnazmulislam0087-0.0.4.tar.gz |
|---|---|
| Size | 16.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
abbeac044c7a117a8eb7dd1c4d63807ff31da8266c20e1caddc2bf988c40eb50
|
|
BLAKE2b-256 checksum How to use checksums |
7089f8243cf67565709463190ead7c539b0ebc81b7da0356136f422e64e027a4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.0 CPython/3.9.12
|
Release files / 1NeuronPerceptron_Pypi_mdnazmulislam0087-0.0.4-py3-none-any.whl
| Download URL | 1NeuronPerceptron_Pypi_mdnazmulislam0087-0.0.4-py3-none-any.whl |
|---|---|
| Size | 17.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4fb0b851c4dfb9b2caad0c296d50bccb2bc6e116f4ec2a61f0ec95ac31573388
|
|
BLAKE2b-256 checksum How to use checksums |
3e15bb76e5177bccda0f6208d8787476054545d41864747141f32cceeef82a44
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.0 CPython/3.9.12
|
Security for 1NeuronPerceptron-Pypi-mdnazmulislam0087 0.0.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.