KNN is a technique used to estimate new values based on the similarity of known ones. In this assignment, your company wants you to estimate the selling price of a customer's building The price you calculate will be given to the customer as the company selling price recommendation. You decide to use Data Science techniques such as the K-Nearest Neighbor.(KNN) You will need to: Import the necessary libraries from your program. (You can use the model class sklearn.neighbors.KNeighborsClassifier, part of the package sci-kit-learn 1.1.1 (Links to an external site) or any other. Train/test the model with the data included in the module (cal_housing.tgz). The house you need to estimate the value for has the following properties: longitude: 120.75 latitude: 39.34 housingMedianAge: 35.5 total rooms: 260 totalBedrooms:120 population:540 households: 12 medianIncome:1.8 K BuildingValue: ? What is the recommended price? You need to provide the code, properly commented. You could use the following packages (if you like): from matplotlib.pyplot import sca from sklearn import datasets,neighbors from sklearn.neighbors import KNeighborsRegressor from sklearn.model_selection import train_test_split from sklearn.preprocessing import StandardScaler import numpy as np import pandas as pd
KNN is a technique used to estimate new values based on the similarity of known ones.
In this assignment, your company wants you to estimate the selling price of a customer's building
The price you calculate will be given to the customer as the company selling price recommendation.
You decide to use Data Science techniques such as the K-Nearest Neighbor.(KNN)
You will need to:
- Import the necessary libraries from your program. (You can use the model class sklearn.neighbors.KNeighborsClassifier, part of the package sci-kit-learn 1.1.1 (Links to an external site) or any other.
- Train/test the model with the data included in the module (cal_housing.tgz).
The house you need to estimate the value for has the following properties:
longitude: 120.75
latitude: 39.34
housingMedianAge: 35.5
total rooms: 260
totalBedrooms:120
population:540
households: 12
medianIncome:1.8 K
BuildingValue: ?
What is the recommended price?
You need to provide the code, properly commented.
You could use the following packages (if you like):
from sklearn import datasets,neighbors
from sklearn.neighbors import KNeighborsRegressor
from sklearn.preprocessing import StandardScaler
import pandas as pd
Step by step
Solved in 4 steps with 2 images