<jupyter_start><jupyter_text>Part 1: Launch a Duet Server and upload data<jupyter_code>import syft as sy
duet = sy.duet(loopback=True)
import pandas as pd
import numpy as np

path = './Terra-D2-multi-labeled-interpolated.csv'
copy = pd.read_csv(path)
#Cleaning up meaningless data
copy = copy[np.all((copy.label.apply(float.is_integer), copy.label != 0), axis=0)]
copy.label = pd.to_numeric(copy.label.apply(lambda x: x-1), downcast='integer')

for column in copy.columns[1:-1]:
            c_max = copy[column].abs().max()
            if c_max != 0:
                copy[column] = copy[column].apply(lambda x: x/c_max)
                
copy = copy.sample(frac=1)

copy = copy.head(100)
print(copy)
import torch as th
data = th.FloatTensor(copy.iloc[:, :-1].values).tag("dump_data2")
data = data.tag("DO2 data")
data = data.describe("Dataset2 of 1664159 samples, 8 feature")

target = th.LongTensor(copy.iloc[:, -1:].values.squeeze()).tag("target_data2")
target = target.tag("DO2 target")
target = target.describe("Target2 of 1664159 samples, 1 output")

print(data)
print(target)
print(len(data))
data_ptr = data.send(duet, pointable=True)
target_ptr = target.send(duet, pointable=True)
duet.requests.add_handler(
    action="accept",
    print_local=True,  # print the result in your notebook
)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1493212669683258, 'fraction_numerical': 0.027149321266968326, 'mean_word_length': 4.438524590163935, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '138523', 'license': 'Apache-2.0', 'n_tokens_mistral': 491, 'n_tokens_neox': 467, 'n_words': 107, 'path': 'PySyft/Duet_FL_2_Data_Owner.ipynb', 'repo_name': 'Virnkord/PySyft-federated-learning', 'size': '1326'}