Spaces:
Sleeping
Sleeping
new
Browse files- resultview.py +2 -0
- similarity.py +3 -3
resultview.py
CHANGED
|
@@ -33,6 +33,7 @@ def tenant_visualization(similarity_matrix, requested_tenants):
|
|
| 33 |
|
| 34 |
|
| 35 |
def tenant_inference(similarity_matrix, requested_tenants,dataframe):
|
|
|
|
| 36 |
#TODO THIS FUNCTION IS THE ONE USED DURING INFERENCE TIME THE MODEL WILL CALCULATE THE 4 TENANTS WITH THE HIGHER COMPATIBILITY
|
| 37 |
try:
|
| 38 |
similarity_matrix = similarity_matrix.astype(int)
|
|
@@ -55,6 +56,7 @@ def algo_start(id):
|
|
| 55 |
#sm.data_checking(dataframe)
|
| 56 |
similarity_matrix = sm.encoder_matrix(dataframe, min_range = 0, max_range=100)
|
| 57 |
tenant_list = tenant_inference(similarity_matrix, id,original_dataframe)
|
|
|
|
| 58 |
return tenant_list
|
| 59 |
#json_convert(tenant_list)
|
| 60 |
#tenant_visualization(similarity_matrix, [20,40,50,18,15])
|
|
|
|
| 33 |
|
| 34 |
|
| 35 |
def tenant_inference(similarity_matrix, requested_tenants,dataframe):
|
| 36 |
+
print("Tenant inference check")
|
| 37 |
#TODO THIS FUNCTION IS THE ONE USED DURING INFERENCE TIME THE MODEL WILL CALCULATE THE 4 TENANTS WITH THE HIGHER COMPATIBILITY
|
| 38 |
try:
|
| 39 |
similarity_matrix = similarity_matrix.astype(int)
|
|
|
|
| 56 |
#sm.data_checking(dataframe)
|
| 57 |
similarity_matrix = sm.encoder_matrix(dataframe, min_range = 0, max_range=100)
|
| 58 |
tenant_list = tenant_inference(similarity_matrix, id,original_dataframe)
|
| 59 |
+
print("Fin algo start check")
|
| 60 |
return tenant_list
|
| 61 |
#json_convert(tenant_list)
|
| 62 |
#tenant_visualization(similarity_matrix, [20,40,50,18,15])
|
similarity.py
CHANGED
|
@@ -1,10 +1,9 @@
|
|
| 1 |
import numpy as np
|
| 2 |
from sklearn.preprocessing import OneHotEncoder
|
| 3 |
import pandas as pd
|
| 4 |
-
|
| 5 |
def data_preparing():
|
| 6 |
-
|
| 7 |
-
|
| 8 |
connection_string = URL.create(
|
| 9 |
'postgresql',
|
| 10 |
username='koyeb-adm',
|
|
@@ -26,6 +25,7 @@ def data_checking(dataframe):
|
|
| 26 |
print(f"No missing values in column {col}")
|
| 27 |
|
| 28 |
def encoder_matrix(dataframe, min_range, max_range):
|
|
|
|
| 29 |
encoder = OneHotEncoder(sparse_output = False)
|
| 30 |
data_encoded = encoder.fit_transform(dataframe)
|
| 31 |
encoded_feature_names = encoder.get_feature_names_out()
|
|
|
|
| 1 |
import numpy as np
|
| 2 |
from sklearn.preprocessing import OneHotEncoder
|
| 3 |
import pandas as pd
|
| 4 |
+
from sqlalchemy import URL, create_engine
|
| 5 |
def data_preparing():
|
| 6 |
+
print("Data preparing check")
|
|
|
|
| 7 |
connection_string = URL.create(
|
| 8 |
'postgresql',
|
| 9 |
username='koyeb-adm',
|
|
|
|
| 25 |
print(f"No missing values in column {col}")
|
| 26 |
|
| 27 |
def encoder_matrix(dataframe, min_range, max_range):
|
| 28 |
+
print("Encoder matrix check")
|
| 29 |
encoder = OneHotEncoder(sparse_output = False)
|
| 30 |
data_encoded = encoder.fit_transform(dataframe)
|
| 31 |
encoded_feature_names = encoder.get_feature_names_out()
|