RNAE
Rede Neural Artificial Evolucionária
Instalation
$ pip install rnea
ou
$ python setup.py install
Utilização
from numpy.random import shuffle
from numpy import array
from pygenec import binarray2int
from rnae import RNAE
from rnae import IRIS as dados
from rnae import IRIS_NAME
#Normalização dos dados de entrada
entrada = dados[1:,0:-1].astype(float)
for k in range(entrada.shape[1]):
entrada[:, k] = ((entrada[:, k] - entrada[:, k].min()) /
(entrada[:, k].max() - entrada[:, k].min())
)
#Resultado esperado, em inteiro.
saidas = dados[1:,-1]
saidas = array([list(map(int, list("{0:2b}".format(int(s)).replace(" ", "0")))) for s in saidas])
itrain = array(list(range(saidas.shape[0])))
shuffle(itrain)
etrain = entrada[itrain,:]
esaid = saidas[itrain, :]
n = int(esaid.shape[0] * 0.90)
neurons = [4, 4, 2]
rna = RNAE(neurons)
rna.treinamento(etrain[0:n, :], esaid[0:n, :],
tpop=500, gens=1000, bits=16, pmut=0.1, pcruz=0.6, epidemia=150)
rna.salvar_modelo("./modelos/rnae_iris.txt")
rna = RNAE.carregar_modelo("./modelos/rnae_iris.txt")
pred = rna.propagacao(etrain[n:,:])
expct = esaid[n:]
expct = binarray2int(expct).reshape((expct.shape[0], 1))
pred = binarray2int(pred).reshape((expct.shape[0], 1))
print("\n")
print([IRIS_NAME[i] for i in pred.flatten().astype(int)])
print("\n")
print([IRIS_NAME[i] for i in expct.flatten().astype(int)])
print("\n")
accu = 100 * sum(pred == expct) / expct.size
print("Acuracia {} %".format(accu))
Metadata
Release files for rnae 1.0.1
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 | |
|---|---|---|---|---|
| rnae-1.0.1.tar.gz | 4.0 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| rnae-1.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 9.8 kB
Release files / rnae-1.0.1.tar.gz
| Download URL | rnae-1.0.1.tar.gz |
|---|---|
| Size | 4.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
263bfca958c3fdb8d14205a102a8ec5f150c4d49931eceb18cd89df1093575c8
|
|
BLAKE2b-256 checksum How to use checksums |
47d94a638dfb0170424162f4f868875f753ee8aab7aa93c2c7d1b402a10e85f2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.38.0 CPython/3.6.9
|
Release files / rnae-1.0.1-py3-none-any.whl
| Download URL | rnae-1.0.1-py3-none-any.whl |
|---|---|
| Size | 5.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b97b15ce8ece339962d052363963a60497f1637cf2d61bc77e5d757f8bbcad7d
|
|
BLAKE2b-256 checksum How to use checksums |
cb9378aa8503b606c3cf01f8411a67b9d665e2e36c7213e32d5e3dcf5047cb55
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.38.0 CPython/3.6.9
|
Security for rnae 1.0.1
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.