def __init__(self, writeM_readS_lock): self.writeM_readS_lock = writeM_readS_lock data = Data() data.data["output"] = Output() self.output = data.data["output"] print("[OK] Sender started") self.write()
def __init__(self, writeR_readM_lock): self.writeR_readM_lock = writeR_readM_lock data = Data() data.data["input"] = Input() self.input = data.data["input"] print("[OK] Receiver started") self.read()
def __init__(self, writeR_readM_lock,writeM_readS_lock): self.writeR_readM_lock = writeR_readM_lock self.writeM_readS_lock = writeM_readS_lock data = Data() data.data["input"] = Input() self.input = data.data["input"] data.data["output"] = Output() self.output = data.data["output"] print("[OK] Main started") self.main()
def gerenation_df_severity(self, start_col, dataUpload): d = Data() list_title = list(d.file_variables_title()) full_set_df = d.data() # dataUpload new_df = pd.DataFrame() new_df[list_title[ 0]] = full_set_df.iloc[:, start_col] * full_set_df.iloc[:, ( start_col - 1) + 2] for col in range(len(list_title) - 1): start_col = start_col + 1 new_df[list_title[ col + 1]] = full_set_df.iloc[:, start_col + 1] * full_set_df.iloc[:, start_col + 2] return new_df
def generateData(amount, myList): for i in range(amount): id = i name = "User" + str(i) person = Data(id, name) myList.append(person) return myList
def generateData(amount, myList): for i in range(amount): id = i name = names.get_first_name() person = Data(id, name) myList.append(person.id) myList.append(person.name) myList.append(person.key) myList.append(person.status) return myList
def parse_contents(contents, filename, date): content_type, content_string = contents.split(',') decoded = base64.b64decode(content_string) severity_df = StatisticsController() try: if 'csv' in filename: # Assume that the user uploaded a CSV file df_X = pd.read_csv(io.StringIO(decoded.decode('utf-8'))) # data.set_df_X(severity_df.get_allData(df_X)) # print(data.get_df_X()) elif 'xls' in filename: # Assume that the user uploaded an excel file df_X = pd.read_excel(io.BytesIO(decoded)) data.set_df_X(df_X) except Exception as e: print(e) return html.Div(['There was an error processing this file.']) return html.Div([ html.H5(filename), html.H6(datetime.datetime.fromtimestamp(date)), html.Hr(), # horizontal line ])
import colorlover as cl import plotly.graph_objs as go import numpy as np from sklearn import metrics import colorlover as cl import plotly.graph_objs as go import numpy as np from collections import OrderedDict from sklearn import metrics from Model.Data import Data from Service.StatisticsService import StatisticsController data = Data() df_frec = StatisticsController().generate_statistics(data.df_X) def serve_prediction_plot(model, X_train, X_test, y_train, y_test, Z, xx, yy, mesh_step, threshold): # Get train and test score from model y_pred_train = (model.decision_function(X_train) > threshold).astype(int) y_pred_test = (model.decision_function(X_test) > threshold).astype(int)
def generation_df_impact_frecuency(self, directory): d = Data().data() new_df = pd.DataFrame(d) return new_df
def title(self): df = pd.DataFrame(Data().file_variables_title()) return df