File size: 968 Bytes
2c781f8
 
03176c2
 
 
 
2c781f8
 
03176c2
9e506b7
 
 
 
03176c2
 
 
 
 
 
 
 
 
 
 
 
 
2c781f8
 
 
14841f9
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import requests

with open("mushrooms.csv", "rb") as csv:
    data = csv.read()

# class,cap-shape,cap-surface,cap-color,bruises,odor,gill-attachment,gill-spacing,gill-size,gill-color,stalk-shape,stalk-root,stalk-surface-above-ring,stalk-surface-below-ring,stalk-color-above-ring,stalk-color-below-ring,veil-type,veil-color,ring-number,ring-type,spore-print-color,population,habitat

ARGS = {
    "epochs": 1_000,
    "hidden_size": 8,
    "learning_rate": 0.0001,
    "test_size": 0.1,
    "activation": "relu",
    "features": [
        "cap-shape",
        "cap-surface",
        "cap-color",
        "bruises",
        "odor",
        "gill-attachment",
        "gill-spacing",
        "gill-size",
        "gill-color",
    ],
    "target": "class",
    "data": data.decode("utf-8"),
}

if __name__ == "__main__":
    r = requests.post(
        "http://127.0.0.1:5000/neural-network",
        json=ARGS,  # Send the data as a JSON object
    )

    print(r.text)