Spaces:
Sleeping
Sleeping
File size: 29,983 Bytes
70dd0de |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 |
import numpy as np
import pandas as pd
import joblib
from tensorflow.keras.models import load_model
import matplotlib.pyplot as plt
# Load the trained model
model = load_model('NN_model.h5')
# Load category mappings
town_categories = joblib.load('town_categories.pkl')
street_name_categories = joblib.load('street_name_categories.pkl')
# Load the scaler used during training
scaler = joblib.load('NN_scaler.pkl')
# Load the data
town_data = pd.read_csv('Resale Flat Price.csv')
from openai import OpenAI
from dotenv import load_dotenv
load_dotenv()
client = OpenAI()
def get_advice(monthly_avg, year, predicted_price, town, street_name, floor, flat_type, flat_model, floor_area_sqm, lease_commence_date):
"""
Calls OpenAI API to get advice on whether the property is a good buy.
Parameters:
- monthly_avg (float): The average resale price of all house types sold in the area from 2017 to 2024.
- year (int): The current year when the property is being evaluated.
- predicted_price (float): The predicted resale price of the property.
- town (str): The town where the property is located.
- street_name (str): The street name of the property location.
- floor (int): The floor level of the property.
- flat_type (str): The type of flat (e.g., '2 ROOM', '3 ROOM').
- flat_model (str): The model of the flat (e.g., 'Improved', 'Model A').
- floor_area_sqm (float): The floor area of the flat in square meters.
- lease_commence_date (int): The year the lease of the property commenced.
Returns:
- str: Advice on whether the property is a good buy, based on resale trends and investment potential.
"""
# Calculate remaining lease
remaining_years = 99 - (year - lease_commence_date)
# Prepare a prompt with the property details
prompt = f"""I have a property with the following details:
- Predicted resale price: S${predicted_price} at {year}
- Monthly Average of all types of houses sold in the same area from 2017 to 2024: {monthly_avg}
(Note that the difference in predicted price and monthly average might be because of the nature of the flat type/size of house)
- Town: {town}
- Street Name: {street_name}
- Floor: {floor}
- Flat Type: {flat_type}
- Flat Model: {flat_model}
- Floor Area (sqm): {floor_area_sqm}
- Remaining Lease: {remaining_years}
Based on these details, please advise whether this is a good buy in Singapore, considering resale trends and investment potential in point form. Talk about monthly average trends.
Do not ask me to check for anything.
Give a concise response.
"""
# Make the OpenAI API call
response = client.chat.completions.create(
model="gpt-4o-mini",
temperature=0.7,
messages=[
{"role": "system", "content": "You are a helpful real estate advisor"},
{"role": "user", "content": prompt}
]
)
# Extract and return the response text
advice = response.choices[0].message.content
advice = advice.replace("*", "").replace("#", "")
return advice
def NN_predict(year, month, town, street_name, floor, flat_type, flat_model, floor_area_sqm, lease_commence_date):
"""
Predicts the resale price of a property using a neural network model.
Parameters:
- year (int): The current year when the property is being evaluated.
- month (int): The current month when the property is being evaluated.
- town (str): The town where the property is located.
- street_name (str): The street name of the property location.
- floor (int): The floor level of the property.
- flat_type (str): The type of flat (e.g., '2 ROOM', '3 ROOM').
- flat_model (str): The model of the flat (e.g., 'Improved', 'Model A').
- floor_area_sqm (float): The floor area of the flat in square meters.
- lease_commence_date (int): The year the lease of the property commenced.
Returns:
- str: The predicted resale price in Singapore dollars, formatted as a string.
"""
# Calculate remaining lease
remaining_years = 99 - (year - lease_commence_date)
# Encode 'town' and 'street_name'
if town in town_categories and street_name in street_name_categories:
town_code = town_categories.index(town)
street_name_code = street_name_categories.index(street_name)
else:
return "Error: Town or Street Name not found in mappings."
# Prepare inputs
town_embedding_vector = np.array([[town_code]], dtype=np.int32)
street_name_embedding_vector = np.array([[street_name_code]], dtype=np.int32)
# Map flat_type and flat_model to encoded values
flat_type_mapping = {
'1 ROOM': 1,
'2 ROOM': 2,
'3 ROOM': 3,
'4 ROOM': 4,
'5 ROOM': 5,
'EXECUTIVE': 6,
'MULTI-GENERATION': 7
}
flat_model_mapping = {
'2-room': 1,
'Improved': 2,
'Simplified': 3,
'Standard': 4,
'Apartment': 5,
'Type S1': 6,
'Type S2': 7,
'Model A': 8,
'Model A2': 9,
'New Generation': 10,
'Adjoined flat': 11,
'Improved-Maisonette': 12,
'Maisonette': 13,
'Model A-Maisonette': 14,
'Multi Generation': 15,
'Premium Apartment': 16,
'Premium Maisonette': 17,
'DBSS': 18,
'Terrace': 19,
'Premium Apartment Loft': 20,
'3Gen': 21
}
encoded_flat_type = flat_type_mapping[flat_type]
encoded_flat_model = flat_model_mapping[flat_model]
# Convert inputs to correct types
year = int(year)
month = int(month)
floor = int(floor)
floor_area_sqm = float(floor_area_sqm)
remaining_years = int(remaining_years)
# Scale continuous features using the same scaler as during training
numeric_features = np.array([[year, month, floor, floor_area_sqm, remaining_years]], dtype=np.float32)
scaled_numeric_features = scaler.transform(numeric_features)
# Prepare the numeric input by concatenating scaled continuous and categorical features
numeric_input = np.concatenate([scaled_numeric_features, [[encoded_flat_type, encoded_flat_model]]], axis=1).astype(np.float32) # Shape (1, 7)
# Pass the three separate inputs as required by the model
prediction = model.predict([town_embedding_vector, street_name_embedding_vector, numeric_input])
# Format prediction output
predicted_price = prediction[0][0]
output = f"S${predicted_price:,.2f}"
return output
def plot(town_data, street_name, forecast_years=1):
"""
Generates a time series plot for the resale price trend over time for a specified street name.
Parameters:
- town_data (DataFrame): The DataFrame containing the data with columns 'street_name', 'time', and 'resale_price'.
- street_name (str): The street name to filter the data by.
Returns:
- tuple: A tuple containing the formatted prediction as a string and the file path to the saved plot image.
"""
# Filter data for the specified street name
filtered_town_data = town_data[town_data['street_name'] == street_name]
# Check if the filtered dataset is empty
if filtered_town_data.empty:
raise ValueError("No flat type in the area")
# Extract sale year and month from the 'month' column
filtered_town_data['sale_year'] = filtered_town_data['month'].apply(lambda x: int(x.split('-')[0])) # Get year from 'month'
filtered_town_data['sale_month'] = filtered_town_data['month'].apply(lambda x: int(x.split('-')[1])) # Get month from 'month'
# Convert the 'month' column to a numerical representation
filtered_town_data['time'] = filtered_town_data['sale_year'] + (filtered_town_data['sale_month'] - 1) / 12
# Sort data by 'time'
filtered_data = filtered_town_data.sort_values(by='time')
# Group by month and calculate the average resale price
monthly_avg = filtered_data.groupby('time')['resale_price'].mean().reset_index()
monthly_avg = monthly_avg[:-1]
# Plot the average monthly resale price trend
plt.figure(figsize=(10, 6))
plt.plot(monthly_avg['time'], monthly_avg['resale_price'], color='blue', label='Average Monthly Resale Price')
plt.xlabel('Time (Year)')
plt.ylabel('Average Resale Price')
plt.title(f'Average Monthly Resale Price Trend Over Time for {street_name}')
plt.legend()
# Save the plot and close it
plot_path = "resale_price_trend.png"
plt.savefig(plot_path)
plt.close()
# Format prediction and return results
return plot_path, monthly_avg
def predict_price(year, month, town, street_name, floor, flat_type, flat_model, floor_area_sqm, lease_commence_date):
predicted_price = NN_predict(year, month, town, street_name, floor, flat_type, flat_model, floor_area_sqm, lease_commence_date)
plot_path, monthly_avg = plot(town_data, street_name)
recommendation = get_advice(monthly_avg, year, predicted_price, town, street_name, floor, flat_type, flat_model, floor_area_sqm, lease_commence_date)
return predicted_price, plot_path, recommendation
# # Example usage
# predicted = predict_price(
# year=2024,
# month=10,
# town='ANG MO KIO',
# street_name='ANG MO KIO AVE 10',
# floor=10,
# flat_type='2 ROOM',
# flat_model='Improved',
# floor_area_sqm=44,
# lease_commence_date=1979
# )
# print(predicted)
# Gradio
import gradio as gr
interface = gr.Interface(
fn=predict_price,
title="NeuralNest",
inputs=[
gr.components.Number(label="Year", value = 2024),
gr.components.Number(label="Month", value = 11),
gr.components.Dropdown(choices=['ANG MO KIO',
'BEDOK',
'BISHAN',
'BUKIT BATOK',
'BUKIT MERAH',
'BUKIT PANJANG',
'BUKIT TIMAH',
'CENTRAL AREA',
'CHOA CHU KANG',
'CLEMENTI',
'GEYLANG',
'HOUGANG',
'JURONG EAST',
'JURONG WEST',
'KALLANG/WHAMPOA',
'MARINE PARADE',
'PASIR RIS',
'PUNGGOL',
'QUEENSTOWN',
'SEMBAWANG',
'SENGKANG',
'SERANGOON',
'TAMPINES',
'TOA PAYOH',
'WOODLANDS',
'YISHUN'], value = 'ANG MO KIO', label="Town"),
gr.components.Dropdown(choices=['ANG MO KIO AVE 10',
'ANG MO KIO AVE 4',
'ANG MO KIO AVE 5',
'ANG MO KIO AVE 1',
'ANG MO KIO AVE 3',
'ANG MO KIO AVE 9',
'ANG MO KIO AVE 8',
'ANG MO KIO AVE 6',
'ANG MO KIO ST 52',
'BEDOK NTH AVE 4',
'BEDOK NTH AVE 1',
'BEDOK NTH RD',
'BEDOK STH AVE 1',
'BEDOK RESERVOIR RD',
'CHAI CHEE ST',
'BEDOK NTH ST 3',
'BEDOK STH RD',
'CHAI CHEE AVE',
'NEW UPP CHANGI RD',
'CHAI CHEE DR',
'BEDOK STH AVE 2',
'BEDOK NTH AVE 3',
'BEDOK RESERVOIR VIEW',
'CHAI CHEE RD',
'LENGKONG TIGA',
'BEDOK CTRL',
'JLN DAMAI',
'BEDOK NTH AVE 2',
'BEDOK STH AVE 3',
'SIN MING RD',
'SIN MING AVE',
'BISHAN ST 12',
'BISHAN ST 13',
'BISHAN ST 22',
'BISHAN ST 24',
'BISHAN ST 23',
'BRIGHT HILL DR',
'SHUNFU RD',
'BT BATOK ST 34',
'BT BATOK ST 51',
'BT BATOK ST 11',
'BT BATOK ST 52',
'BT BATOK ST 21',
'BT BATOK EAST AVE 5',
'BT BATOK WEST AVE 6',
'BT BATOK CTRL',
'BT BATOK WEST AVE 8',
'BT BATOK EAST AVE 4',
'BT BATOK ST 31',
'BT BATOK ST 25',
'BT BATOK EAST AVE 3',
'BT BATOK WEST AVE 5',
'BT BATOK ST 24',
'JLN BT HO SWEE',
'TELOK BLANGAH DR',
'BEO CRES',
'TELOK BLANGAH CRES',
'TAMAN HO SWEE',
'TELOK BLANGAH RISE',
'TELOK BLANGAH WAY',
'JLN BT MERAH',
'JLN KLINIK',
'TELOK BLANGAH HTS',
'BT MERAH VIEW',
'INDUS RD',
'BT MERAH LANE 1',
'TELOK BLANGAH ST 31',
'MOH GUAN TER',
'HAVELOCK RD',
'HENDERSON CRES',
'BT PURMEI RD',
'KIM TIAN RD',
'DEPOT RD',
'JLN RUMAH TINGGI',
'DELTA AVE',
'JLN MEMBINA',
'REDHILL RD',
'LENGKOK BAHRU',
'ZION RD',
'PETIR RD',
'PENDING RD',
'BANGKIT RD',
'SEGAR RD',
'JELAPANG RD',
'SENJA RD',
'FAJAR RD',
'BT PANJANG RING RD',
'SENJA LINK',
'LOMPANG RD',
'GANGSA RD',
'TOH YI DR',
'FARRER RD',
'JLN KUKOH',
'ROWELL RD',
'WATERLOO ST',
'NEW MKT RD',
'TG PAGAR PLAZA',
'QUEEN ST',
'BAIN ST',
'CANTONMENT RD',
'TECK WHYE LANE',
'CHOA CHU KANG AVE 4',
'CHOA CHU KANG AVE 3',
'CHOA CHU KANG CRES',
'CHOA CHU KANG ST 54',
'CHOA CHU KANG CTRL',
'JLN TECK WHYE',
'CHOA CHU KANG ST 62',
'CHOA CHU KANG NTH 6',
'CHOA CHU KANG DR',
'CHOA CHU KANG NTH 5',
'CHOA CHU KANG ST 52',
'CHOA CHU KANG AVE 2',
'CLEMENTI WEST ST 2',
'WEST COAST RD',
'CLEMENTI WEST ST 1',
'CLEMENTI AVE 4',
'CLEMENTI AVE 5',
'CLEMENTI ST 11',
'CLEMENTI AVE 2',
'CLEMENTI AVE 3',
'CLEMENTI AVE 1',
"C'WEALTH AVE WEST",
'CIRCUIT RD',
'BALAM RD',
'MACPHERSON LANE',
'EUNOS CRES',
'UBI AVE 1',
'HAIG RD',
'OLD AIRPORT RD',
'GEYLANG EAST AVE 1',
'SIMS DR',
'PIPIT RD',
'GEYLANG EAST CTRL',
'EUNOS RD 5',
'CASSIA CRES',
'BUANGKOK CRES',
'HOUGANG AVE 3',
'HOUGANG AVE 8',
'HOUGANG AVE 1',
'HOUGANG AVE 5',
'HOUGANG ST 61',
'HOUGANG ST 11',
'HOUGANG AVE 7',
'HOUGANG AVE 4',
'HOUGANG AVE 2',
'LOR AH SOO',
'HOUGANG ST 92',
'HOUGANG ST 52',
'HOUGANG AVE 10',
'HOUGANG ST 51',
'UPP SERANGOON RD',
'HOUGANG CTRL',
'HOUGANG ST 91',
'BUANGKOK LINK',
'HOUGANG ST 31',
'PANDAN GDNS',
'TEBAN GDNS RD',
'JURONG EAST ST 24',
'JURONG EAST ST 21',
'JURONG EAST AVE 1',
'JURONG EAST ST 13',
'JURONG EAST ST 32',
'TOH GUAN RD',
'JURONG WEST ST 93',
'BOON LAY AVE',
'HO CHING RD',
'BOON LAY DR',
'TAO CHING RD',
'JURONG WEST ST 91',
'JURONG WEST ST 42',
'JURONG WEST ST 92',
'BOON LAY PL',
'JURONG WEST ST 52',
'TAH CHING RD',
'JURONG WEST ST 81',
'YUNG SHENG RD',
'JURONG WEST ST 25',
'JURONG WEST ST 73',
'JURONG WEST ST 72',
'JURONG WEST AVE 3',
'JURONG WEST AVE 5',
'YUNG HO RD',
'JURONG WEST ST 74',
'JURONG WEST AVE 1',
'JURONG WEST ST 71',
'JURONG WEST ST 61',
'JURONG WEST ST 65',
'JURONG WEST CTRL 1',
'JURONG WEST ST 64',
'JURONG WEST ST 62',
'JURONG WEST ST 41',
'JURONG WEST ST 24',
'JLN BATU',
'JLN BAHAGIA',
'LOR LIMAU',
"ST. GEORGE'S RD",
'KALLANG BAHRU',
'DORSET RD',
'GEYLANG BAHRU',
'BENDEMEER RD',
'WHAMPOA DR',
'UPP BOON KENG RD',
'RACE COURSE RD',
'OWEN RD',
'NTH BRIDGE RD',
'TOWNER RD',
'FARRER PK RD',
'MCNAIR RD',
'JLN TENTERAM',
'BOON KENG RD',
'JLN RAJAH',
'MARINE DR',
'MARINE CRES',
'MARINE TER',
'CHANGI VILLAGE RD',
'PASIR RIS ST 71',
'PASIR RIS ST 11',
'PASIR RIS DR 3',
'PASIR RIS DR 6',
'PASIR RIS ST 21',
'PASIR RIS DR 4',
'PASIR RIS ST 53',
'PASIR RIS DR 10',
'PASIR RIS ST 52',
'PASIR RIS ST 12',
'PASIR RIS ST 51',
'PASIR RIS ST 72',
'PASIR RIS DR 1',
'PUNGGOL FIELD',
'EDGEDALE PLAINS',
'PUNGGOL FIELD WALK',
'EDGEFIELD PLAINS',
'PUNGGOL RD',
'PUNGGOL EAST',
'PUNGGOL DR',
'PUNGGOL CTRL',
'PUNGGOL PL',
"C'WEALTH CL",
'STIRLING RD',
'MEI LING ST',
"C'WEALTH CRES",
"C'WEALTH DR",
'GHIM MOH RD',
'DOVER RD',
'HOLLAND AVE',
'STRATHMORE AVE',
'HOLLAND DR',
'GHIM MOH LINK',
'CLARENCE LANE',
'DOVER CRES',
'SEMBAWANG DR',
'SEMBAWANG CL',
'MONTREAL DR',
'ADMIRALTY LINK',
'ADMIRALTY DR',
'SEMBAWANG CRES',
'CANBERRA RD',
'FERNVALE RD',
'COMPASSVALE LANE',
'ANCHORVALE RD',
'RIVERVALE DR',
'RIVERVALE CRES',
'SENGKANG EAST WAY',
'RIVERVALE ST',
'RIVERVALE WALK',
'FERNVALE LANE',
'ANCHORVALE LINK',
'COMPASSVALE RD',
'COMPASSVALE CRES',
'JLN KAYU',
'COMPASSVALE WALK',
'COMPASSVALE DR',
'COMPASSVALE LINK',
'COMPASSVALE BOW',
'SENGKANG CTRL',
'ANCHORVALE LANE',
'ANCHORVALE DR',
'COMPASSVALE ST',
'SERANGOON AVE 4',
'LOR LEW LIAN',
'SERANGOON AVE 2',
'SERANGOON NTH AVE 1',
'SERANGOON AVE 1',
'SERANGOON CTRL',
'SERANGOON NTH AVE 4',
'TAMPINES ST 22',
'TAMPINES ST 41',
'TAMPINES AVE 4',
'TAMPINES ST 44',
'TAMPINES ST 81',
'TAMPINES ST 11',
'TAMPINES ST 23',
'TAMPINES ST 91',
'TAMPINES ST 21',
'TAMPINES ST 83',
'TAMPINES ST 42',
'TAMPINES ST 71',
'TAMPINES ST 45',
'TAMPINES ST 34',
'TAMPINES ST 82',
'TAMPINES AVE 9',
'SIMEI ST 1',
'SIMEI ST 5',
'TAMPINES ST 72',
'TAMPINES ST 84',
'SIMEI ST 2',
'TAMPINES CTRL 7',
'TAMPINES ST 33',
'TAMPINES ST 32',
'TAMPINES AVE 5',
'LOR 5 TOA PAYOH',
'LOR 7 TOA PAYOH',
'LOR 4 TOA PAYOH',
'LOR 1 TOA PAYOH',
'TOA PAYOH EAST',
'POTONG PASIR AVE 1',
'TOA PAYOH NTH',
'LOR 8 TOA PAYOH',
'LOR 3 TOA PAYOH',
'POTONG PASIR AVE 3',
'JOO SENG RD',
'LOR 2 TOA PAYOH',
'TOA PAYOH CTRL',
'MARSILING DR',
'WOODLANDS ST 13',
'WOODLANDS DR 52',
'WOODLANDS ST 41',
'MARSILING CRES',
'WOODLANDS ST 83',
'WOODLANDS CIRCLE',
'WOODLANDS DR 40',
'WOODLANDS ST 31',
'WOODLANDS DR 16',
'WOODLANDS ST 81',
'WOODLANDS RING RD',
'WOODLANDS DR 53',
'WOODLANDS DR 62',
'WOODLANDS DR 70',
'WOODLANDS DR 42',
'WOODLANDS DR 50',
'WOODLANDS AVE 6',
'WOODLANDS DR 14',
'WOODLANDS AVE 1',
'WOODLANDS AVE 5',
'MARSILING RISE',
'WOODLANDS CRES',
'WOODLANDS DR 73',
'WOODLANDS DR 44',
'YISHUN RING RD',
'YISHUN AVE 3',
'YISHUN ST 11',
'YISHUN AVE 4',
'YISHUN ST 22',
'YISHUN ST 71',
'YISHUN AVE 5',
'YISHUN ST 21',
'YISHUN ST 41',
'YISHUN ST 61',
'YISHUN AVE 6',
'YISHUN AVE 11',
'YISHUN CTRL',
'YISHUN ST 81',
'YISHUN ST 72',
'YISHUN AVE 2',
'ANG MO KIO ST 32',
'ANG MO KIO ST 31',
'BEDOK NTH ST 2',
'BEDOK NTH ST 1',
'JLN TENAGA',
'BEDOK NTH ST 4',
'BT BATOK WEST AVE 4',
'CANTONMENT CL',
'BOON TIONG RD',
'SPOTTISWOODE PK RD',
'REDHILL CL',
'KIM TIAN PL',
'CASHEW RD',
"QUEEN'S RD",
'CHANDER RD',
'KELANTAN RD',
'SAGO LANE',
'UPP CROSS ST',
'CHIN SWEE RD',
'SMITH ST',
'TECK WHYE AVE',
'CHOA CHU KANG ST 51',
'CHOA CHU KANG AVE 5',
'CHOA CHU KANG AVE 1',
'WEST COAST DR',
'PAYA LEBAR WAY',
'ALJUNIED CRES',
'JOO CHIAT RD',
'PINE CL',
'HOUGANG ST 22',
'HOUGANG AVE 9',
'HOUGANG AVE 6',
'HOUGANG ST 21',
'JURONG WEST ST 75',
'KANG CHING RD',
'KG KAYU RD',
'CRAWFORD LANE',
'WHAMPOA WEST',
'BEACH RD',
'CAMBRIDGE RD',
"ST. GEORGE'S LANE",
'JELLICOE RD',
'ELIAS RD',
'HOLLAND CL',
'TANGLIN HALT RD',
"C'WEALTH AVE",
'WELLINGTON CIRCLE',
'CANBERRA LINK',
'SENGKANG WEST AVE',
'SENGKANG EAST RD',
'SERANGOON CTRL DR',
'SERANGOON AVE 3',
'SERANGOON NTH AVE 3',
'TAMPINES AVE 8',
'TAMPINES ST 24',
'TAMPINES ST 12',
'SIMEI LANE',
'SIMEI ST 4',
'LOR 6 TOA PAYOH',
'KIM KEAT LINK',
'MARSILING LANE',
'WOODLANDS ST 82',
'WOODLANDS DR 60',
'WOODLANDS AVE 3',
'WOODLANDS DR 75',
'WOODLANDS AVE 4',
'WOODLANDS ST 32',
'YISHUN AVE 7',
'ANG MO KIO ST 11',
'BISHAN ST 11',
'BT BATOK WEST AVE 2',
'BT BATOK ST 32',
'BT BATOK ST 33',
'BT BATOK ST 22',
'BT BATOK WEST AVE 7',
'HOY FATT RD',
'SILAT AVE',
'EVERTON PK',
'BT MERAH CTRL',
'JELEBU RD',
'EMPRESS RD',
'VEERASAMY RD',
'CHOA CHU KANG ST 64',
'CHOA CHU KANG ST 53',
'CHOA CHU KANG NTH 7',
'CLEMENTI AVE 6',
'CLEMENTI ST 13',
'GEYLANG SERAI',
'JLN TIGA',
'ALJUNIED RD',
'YUNG LOH RD',
'YUNG AN RD',
"JLN MA'MOR",
'WHAMPOA RD',
'LOR 3 GEYLANG',
'PASIR RIS ST 13',
"QUEEN'S CL",
'DOVER CL EAST',
'SEMBAWANG VISTA',
'TAMPINES ST 43',
'SIMEI RD',
'KIM KEAT AVE',
'UPP ALJUNIED LANE',
'POTONG PASIR AVE 2',
'WOODLANDS DR 72',
'MARSILING RD',
'WOODLANDS DR 71',
'YISHUN AVE 9',
'YISHUN ST 20',
'ANG MO KIO ST 21',
'TIONG BAHRU RD',
'KLANG LANE',
'CHOA CHU KANG LOOP',
'CLEMENTI ST 14',
'SIMS PL',
'JURONG EAST ST 31',
'YUAN CHING RD',
'CORPORATION DR',
'YUNG PING RD',
'WHAMPOA STH',
'TESSENSOHN RD',
'JLN DUSUN',
'QUEENSWAY',
'FERNVALE LINK',
'KIM PONG RD',
'KIM CHENG ST',
'SAUJANA RD',
'BUFFALO RD',
'CLEMENTI ST 12',
'DAKOTA CRES',
'JURONG WEST ST 51',
'FRENCH RD',
'GLOUCESTER RD',
'KG ARANG RD',
'MOULMEIN RD',
'KENT RD',
'AH HOOD RD',
'SERANGOON NTH AVE 2',
'TAMPINES CTRL 1',
'TAMPINES AVE 7',
'LOR 1A TOA PAYOH',
'WOODLANDS AVE 9',
'YISHUN CTRL 1',
'LOWER DELTA RD',
'JLN DUA',
'WOODLANDS ST 11',
'ANG MO KIO AVE 2',
'SELEGIE RD',
'SIMS AVE',
'REDHILL LANE',
"KING GEORGE'S AVE",
'PASIR RIS ST 41',
'PUNGGOL WALK',
'LIM LIAK ST',
'JLN BERSEH',
'SENGKANG WEST WAY',
'BUANGKOK GREEN',
'SEMBAWANG WAY',
'PUNGGOL WAY',
'YISHUN ST 31',
'TECK WHYE CRES',
'KRETA AYER RD',
'MONTREAL LINK',
'UPP SERANGOON CRES',
'SUMANG LINK',
'SENGKANG EAST AVE',
'YISHUN AVE 1',
'ANCHORVALE CRES',
'YUNG KUANG RD',
'ANCHORVALE ST',
'TAMPINES CTRL 8',
'YISHUN ST 51',
'UPP SERANGOON VIEW',
'TAMPINES AVE 1',
'BEDOK RESERVOIR CRES',
'ANG MO KIO ST 61',
'DAWSON RD',
'FERNVALE ST',
'SENG POH RD',
'HOUGANG ST 32',
'TAMPINES ST 86',
'HENDERSON RD',
'SUMANG WALK',
'CHOA CHU KANG AVE 7',
'KEAT HONG CL',
'JURONG WEST CTRL 3',
'KEAT HONG LINK',
'ALJUNIED AVE 2',
'CANBERRA CRES',
'SUMANG LANE',
'CANBERRA ST',
'ANG MO KIO ST 44',
'ANG MO KIO ST 51',
'BT BATOK EAST AVE 6',
'BT BATOK WEST AVE 9',
'GEYLANG EAST AVE 2',
'MARINE PARADE CTRL',
'CANBERRA WALK',
'WOODLANDS RISE',
'TAMPINES ST 61',
'YISHUN ST 43',
'SENGKANG WEST RD',
'BIDADARI PK DR',
'CANBERRA VIEW'], value = "ANG MO KIO AVE 10", label = "Street Name"),
gr.components.Number(label="Floor", value = 1),
gr.components.Dropdown(choices=['1 ROOM', '2 ROOM', '3 ROOM', '4 ROOM', '5 ROOM', 'EXECUTIVE', 'MULTI-GENERATION'], value='1 ROOM', label="Flat Type"),
gr.components.Dropdown(choices=['2-room', 'Improved', 'Simplified', 'Standard', 'Apartment', 'Type S1', 'Type S2', 'Model A', 'Model A2', 'New Generation', 'Adjoined flat', 'Improved-Maisonette', 'Maisonette', 'Model A-Maisonette', 'Multi Generation', 'Premium Apartment', 'Premium Maisonette', 'DBSS', 'Terrace', 'Premium Apartment Loft', '3Gen'], value='Improved', label="Flat Model"),
gr.components.Number(label="Floor Area (sqm)"),
gr.components.Number(label="Lease Commence Year")
],
outputs=[gr.components.Textbox(label="Predicted Resale Price"),
gr.components.Image(type="filepath", label="Resale Price Trend Timeseries with following year prediction"),
gr.components.Textbox(label="AI Real Estate Advisor")],
allow_flagging="never"
)
# Launch the interface
interface.launch()
|