pryvx 2.4.6__py3-none-any.whl → 2.4.8__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pryvx/fl_client.py +2 -0
- pryvx/fl_server.py +12 -2
- {pryvx-2.4.6.dist-info → pryvx-2.4.8.dist-info}/METADATA +1 -1
- {pryvx-2.4.6.dist-info → pryvx-2.4.8.dist-info}/RECORD +7 -7
- {pryvx-2.4.6.dist-info → pryvx-2.4.8.dist-info}/LICENSE +0 -0
- {pryvx-2.4.6.dist-info → pryvx-2.4.8.dist-info}/WHEEL +0 -0
- {pryvx-2.4.6.dist-info → pryvx-2.4.8.dist-info}/top_level.txt +0 -0
pryvx/fl_client.py
CHANGED
@@ -14,9 +14,11 @@ def train_logistic_classifier(features, labels):
|
|
14
14
|
|
15
15
|
|
16
16
|
def train_random_forest_classifier(features, labels):
|
17
|
+
print("Model training started...")
|
17
18
|
model = RandomForestClassifier(n_estimators=100, random_state=42)
|
18
19
|
model.fit(features, labels)
|
19
20
|
serialized_model = pickle.dumps(model)
|
21
|
+
print("Model training finished.")
|
20
22
|
return serialized_model, model
|
21
23
|
|
22
24
|
|
pryvx/fl_server.py
CHANGED
@@ -4,11 +4,18 @@ from pryvx import pryvx_pb2_grpc
|
|
4
4
|
import pickle
|
5
5
|
from concurrent import futures
|
6
6
|
import os
|
7
|
-
import
|
7
|
+
import shutil
|
8
8
|
|
9
9
|
# Directory to store received models
|
10
10
|
MODEL_SAVE_PATH = "received_models/"
|
11
|
-
|
11
|
+
|
12
|
+
def prepare_model_folder():
|
13
|
+
# Delete the folder if it exists
|
14
|
+
if os.path.exists(MODEL_SAVE_PATH):
|
15
|
+
shutil.rmtree(MODEL_SAVE_PATH)
|
16
|
+
# Create a new folder
|
17
|
+
os.makedirs(MODEL_SAVE_PATH, exist_ok=True)
|
18
|
+
|
12
19
|
|
13
20
|
class ModelServicer(pryvx_pb2_grpc.ModelServiceServicer):
|
14
21
|
def __init__(self):
|
@@ -41,8 +48,11 @@ class ModelServicer(pryvx_pb2_grpc.ModelServiceServicer):
|
|
41
48
|
|
42
49
|
|
43
50
|
def start_server():
|
51
|
+
prepare_model_folder()
|
52
|
+
|
44
53
|
server = grpc.server(futures.ThreadPoolExecutor(max_workers=10))
|
45
54
|
pryvx_pb2_grpc.add_ModelServiceServicer_to_server(ModelServicer(), server)
|
55
|
+
|
46
56
|
server.add_insecure_port('[::]:50051')
|
47
57
|
server.start()
|
48
58
|
print("Server started. Listening on localhost:50051")
|
@@ -1,7 +1,7 @@
|
|
1
1
|
pryvx/__init__.py,sha256=QvpYISJ8MH7XnbxC5iTMTycq7Svsld0NIbMozcndYjo,111
|
2
|
-
pryvx/fl_client.py,sha256=
|
2
|
+
pryvx/fl_client.py,sha256=ksJM2R5adi8P7No1t4mhpMiwr-ypmsgvNL14LmfqOyg,1231
|
3
3
|
pryvx/fl_ensemble.py,sha256=lvgvd-zJDSBh-RyMAjTyJZwu0eFiUNXfCU7J2Vk7g0g,715
|
4
|
-
pryvx/fl_server.py,sha256=
|
4
|
+
pryvx/fl_server.py,sha256=LJdJkj2BJdXrMczy1qZBHN_fY-ZveH-vHvljwwgDv8k,2039
|
5
5
|
pryvx/gdp.py,sha256=ToLtWNvBKtSs-3Na1pGe_J6dWvBxXhV2raUJkNtKMg4,925
|
6
6
|
pryvx/ldp.py,sha256=WxBQLnZ_b2wNV1rlN7rtKXaQ5waUPPvnRus-4tUnCB8,810
|
7
7
|
pryvx/phe.py,sha256=HN70aUNTq0w9vRPMaNGfTnNi00gMQ1B7R7Cm6r6rheE,2974
|
@@ -9,8 +9,8 @@ pryvx/pryvx_pb2.py,sha256=HlwY1zRVFReIaK8WZ8opJ1kd3_PQWSJEx-PZImWYlCM,1621
|
|
9
9
|
pryvx/pryvx_pb2_grpc.py,sha256=yn4mThL3XY8glPvZ9b1Fmj_c8JtAs1pTNp3m0JV9d3s,3425
|
10
10
|
pryvx/psi.py,sha256=V0BUJwYfiFWhKtEL27q45yxY7U-I7B4olKQhaGbgN50,1346
|
11
11
|
pryvx/smpc.py,sha256=FZcE3gZo8WUVPmcBHSgP8iOkWt3AKcBLSLCtKczy8hs,2247
|
12
|
-
pryvx-2.4.
|
13
|
-
pryvx-2.4.
|
14
|
-
pryvx-2.4.
|
15
|
-
pryvx-2.4.
|
16
|
-
pryvx-2.4.
|
12
|
+
pryvx-2.4.8.dist-info/LICENSE,sha256=pbIMXbaorAIVW-fDch2tvtZRkVA3mz-UnXQqeCf4LDg,1086
|
13
|
+
pryvx-2.4.8.dist-info/METADATA,sha256=JNelEJzGkMg8HxZREkwli6wd_lVmJhP58SHmW5Wa0LE,1066
|
14
|
+
pryvx-2.4.8.dist-info/WHEEL,sha256=eOLhNAGa2EW3wWl_TU484h7q1UNgy0JXjjoqKoxAAQc,92
|
15
|
+
pryvx-2.4.8.dist-info/top_level.txt,sha256=1iHoeevu_FoFjdPg8HyMlgvHNUm1--9QEpFMaJEa4hw,6
|
16
|
+
pryvx-2.4.8.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|