Spaces:
Sleeping
Sleeping
new
Browse files- __pycache__/resultview.cpython-311.pyc +0 -0
- __pycache__/similarity.cpython-311.pyc +0 -0
- resultview.py +1 -1
- similarity.py +1 -1
- try.py +5 -5
__pycache__/resultview.cpython-311.pyc
CHANGED
|
Binary files a/__pycache__/resultview.cpython-311.pyc and b/__pycache__/resultview.cpython-311.pyc differ
|
|
|
__pycache__/similarity.cpython-311.pyc
CHANGED
|
Binary files a/__pycache__/similarity.cpython-311.pyc and b/__pycache__/similarity.cpython-311.pyc differ
|
|
|
resultview.py
CHANGED
|
@@ -39,7 +39,7 @@ def tenant_inference(similarity_matrix, requested_tenants,dataframe):
|
|
| 39 |
similarity_tenant = similarity_matrix[requested_tenants].head(4).sort_values(ascending = False)
|
| 40 |
|
| 41 |
final_tenants = similarity_tenant.index
|
| 42 |
-
tenant_features = dataframe.loc[final_tenants, ["
|
| 43 |
tenants_dict = {
|
| 44 |
key : list(tenant_features[key]) for key in tenant_features.columns
|
| 45 |
}
|
|
|
|
| 39 |
similarity_tenant = similarity_matrix[requested_tenants].head(4).sort_values(ascending = False)
|
| 40 |
|
| 41 |
final_tenants = similarity_tenant.index
|
| 42 |
+
tenant_features = dataframe.loc[final_tenants, ["names", "age", "smoking", "email"]]
|
| 43 |
tenants_dict = {
|
| 44 |
key : list(tenant_features[key]) for key in tenant_features.columns
|
| 45 |
}
|
similarity.py
CHANGED
|
@@ -14,7 +14,7 @@ def data_preparing():
|
|
| 14 |
)
|
| 15 |
engine = create_engine(connection_string)
|
| 16 |
original_dataframe = pd.read_sql("SELECT * FROM tenants", con=engine)
|
| 17 |
-
columns = ['
|
| 18 |
dataframe = original_dataframe[columns]
|
| 19 |
return dataframe, original_dataframe
|
| 20 |
|
|
|
|
| 14 |
)
|
| 15 |
engine = create_engine(connection_string)
|
| 16 |
original_dataframe = pd.read_sql("SELECT * FROM tenants", con=engine)
|
| 17 |
+
columns = ['age', 'worktimes', 'schedules', 'studieslevel', 'pets', 'cooking', 'sport', 'smoking', 'organized']
|
| 18 |
dataframe = original_dataframe[columns]
|
| 19 |
return dataframe, original_dataframe
|
| 20 |
|
try.py
CHANGED
|
@@ -9,7 +9,7 @@ print(file.loc(0))
|
|
| 9 |
|
| 10 |
|
| 11 |
from sqlalchemy import URL, create_engine
|
| 12 |
-
|
| 13 |
connection_string = URL.create(
|
| 14 |
'postgresql',
|
| 15 |
username='koyeb-adm',
|
|
@@ -17,9 +17,9 @@ connection_string = URL.create(
|
|
| 17 |
host='ep-rough-fire-a27dp2i1.eu-central-1.pg.koyeb.app',
|
| 18 |
database='koyebdb',
|
| 19 |
)
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
print(
|
| 23 |
-
|
| 24 |
|
| 25 |
|
|
|
|
| 9 |
|
| 10 |
|
| 11 |
from sqlalchemy import URL, create_engine
|
| 12 |
+
import resultview as rv
|
| 13 |
connection_string = URL.create(
|
| 14 |
'postgresql',
|
| 15 |
username='koyeb-adm',
|
|
|
|
| 17 |
host='ep-rough-fire-a27dp2i1.eu-central-1.pg.koyeb.app',
|
| 18 |
database='koyebdb',
|
| 19 |
)
|
| 20 |
+
|
| 21 |
+
tenant_list = rv.algo_start(5)
|
| 22 |
+
print(tenant_list)
|
| 23 |
+
|
| 24 |
|
| 25 |
|