Fuzzy cognitive maps python library
Project description
py-fcm
Fuzzy cognitive maps python library
###Example usage
from py_fcm import from_json
fcm_json = """{
"max_iter": 500,
"decision_function": "LAST",
"activation_function": "sigmoid",
"memory_influence": False,
"stability_diff": 0.001,
"stop_at_stabilize": True,
"extra_steps": 5,
"weight": 1,
"concepts":
[
{
"id": "concept_1",
"is_active": True,
"type": "SIMPLE",
"activation": 0.5
},
{
"id": "concept_2", "is_active": True,
"type": "DECISION", "activation": 0.0,
"custom_function": "sum_w",
"custom_function_args": {"weight": 0.3}
},
{
"id": "concept_3",
"is_active": True,
"type": "SIMPLE",
"activation": 0.0,
"use_memory": True
},
{
"id": "concept_4",
"is_active": True,
"type": "SIMPLE",
"activation": 0.3,
"custom_function": "saturation"
}
],
"relations":
[
{"origin": "concept_4", "destiny": "concept_2", "weight": -0.1},
{"origin": "concept_1", "destiny": "concept_3", "weight": 0.59},
{"origin": "concept_3", "destiny": "concept_2", "weight": 0.8911}
],
'activation_function_args': {'lambda_val': 1},
"""
my_fcm = from_json(fcm_json)
my_fcm.run_inference()
result = my_fcm.get_result_by_type(node_type='any')
print(result)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
py_fcm-0.2.5.tar.gz
(30.5 kB
view details)
Built Distribution
py_fcm-0.2.5-py3-none-any.whl
(33.4 kB
view details)
File details
Details for the file py_fcm-0.2.5.tar.gz
.
File metadata
- Download URL: py_fcm-0.2.5.tar.gz
- Upload date:
- Size: 30.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 12244693862ccb736977adfbf00553f45e1d806ff553e38c4ff79c3ff6f79f36 |
|
MD5 | bebb98cc8a12e85419c28a2a8f612072 |
|
BLAKE2b-256 | cafdfe4cbf755400f395d978917ad49db93d247faf14608f693654691a449cf2 |
File details
Details for the file py_fcm-0.2.5-py3-none-any.whl
.
File metadata
- Download URL: py_fcm-0.2.5-py3-none-any.whl
- Upload date:
- Size: 33.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5a33998a41125daeb93fc1dcbc996e25e10df208a9ee3b3ef8b449fbc7691f81 |
|
MD5 | d3e3c40e9874c1052df2882a2382e50a |
|
BLAKE2b-256 | 6e8e54a0f7b0846c5586f0c092f9cb3ce00f777bc5533bf14b59c0b429ec829f |