Important
Important
Important
[email protected]
+91 82 67 81 38 69
Order Now
Hurry Up! And Get Flat 10% Discount On Your First Order We are
available by 24/7 for your support!
RealCode4You
Post
All PostsAll PostsJAVA ProjectJava ProgrammingMachine Learning Python ProgrammingData
ScienceWeb ApplicationMySQLGit HubAndroid Assignment HelpSQLPHPBig DataSQL
ServerOracle DatabaseDatabaseMongoDBMySQLR ProgrammingHTMLData VisualizationJava
ScriptData StructureC ProgrammingR ProgrammingNoSQLMATLABVisualization Using
ProcessingPySparkEDA In Machine
LearningNLPMathematicsNodeJSTableauAngularASP .NETMERN StackTkinterResearch Paper
Report Writing HelpPower BIDeep LearningUnix/LinuxDecision Tree ClassifierBig DataReact
JsData MiningWeb ScrapingReact Native
realcode4you
This project is a GUI implementation of the Case Study 15.5 from the Python textbook. For each section, you
will need to have user interaction and the ability to restart at any time. The user must also be prevented from
completing an action that is invalid. For example, the user cannot explore the data until the data is loaded.
Load the dataset (15.5.1)
Explore the data (15.5.2)
Split the data for training and testing (15.5.4)
Train the data model (15.5.5)
Test the data model (15.5.6)
Visualize the expected vs. predicted (15.5.7)
Create the regression model metrics (15.5.8)
Problem Statement
In this task I want to analyse Boston House Data and then creating basic GUI related python Tkinter tool. I
would try to spot Real Estate trends for BostonSuburbs, or predict sale value of residential property in Boston
suburbs based on critical factors. I have downloaded the dataset from Kaggle linked here. Recent time large
number of houses society developed in every year and it is the good place for residence. Prediction of Real
Estate Investment Data is deciding the appropriate price which is applicable for both buyer and investor. Now
a day many Real Estate Investor invest the money every year to develop the society from last decades. In every
year many societies developed. In this some of the gain profit and some of not success. Main objective of each
Real Estate Investor to gain profit to earning point and make it suitable for buyer for both viewer point and
price. In future it gives more accurate result when data is increases.
Data Pre-Processing
Any data or real-world data generally contains many issues like noises, missing values, and not given in proper
format which cannot be directly used for machine learning algorithms. This is the process for cleaning the data
and making it suitable for a ML model to increase the model efficiency and increase the accuracy of the model
also.
Removing Null Values:
In our code we use below methods to remove null values from dataset column:
#Data Processing
#Remove Missing Values by Median
df['RM'].fillna(df['RM'].median(), inplace=True)
Feature Selection
This is the next steps after pre-process the dataset. In machine learning feature selection is the process of
reducing the number of input variables when developing a predictive model.
#Deviding the target and features variables
X = df.drop('MEDV', axis = 1)
Y = df['MEDV']
X is a feature variable and Y is the target variable
Code Implementation
Here in above code block I import all important libraries which used to create tkinter GUI and used for data
analytics and data visualization.
In the data, the column RM has some missing values so we need to remove these missing values and fill it
using median. This is the data pre-processing step.
Here we need to select the features and target variable to predict the machine learning model.
Above the sklearn train_test_split method which used for split the dataset.
The next step is how to train the model
import sys
from tkinter import *
import pandas as pd
from sklearn import linear_model
import tkinter as tk
import matplotlib.pyplot as plt
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg
from sklearn import preprocessing
# Import 'train_test_split'
from sklearn.model_selection import cross_val_score
from sklearn.model_selection import train_test_split
def ml_tkinter_gui():
global root
# tkinter GUI
root= tk.Tk()
#Read Dataset
df = pd.read_csv("Boston Real Est.csv")
#Data Processing
#Remove Missing Values by Median
df['RM'].fillna(df['RM'].median(), inplace=True)
#Accuracy Matrices
def score():
scores = cross_val_score(regr, X_train, y_train)
Prediction_result = ('Scores: ', scores)
label_Prediction = tk.Label(root, text= Prediction_result, bg='orange')
canvas1.create_window(20, 200, window=label_Prediction)
#Add butoon
button = tk.Button(text = "Click and Quit", command = close_window, bg='red')
#Place the button on the x=700 and y=90 window position
button.place(x=900, y=90)
#Add butoon
button = tk.Button(text = "Referece & Restart", command = refresh, bg='green')
#Place the button on the x=700 and y=90 window position
button.place(x=200, y=400)
root.mainloop()
if __name__ == '__main__':
def refresh():
root.destroy()
ml_tkinter_gui()
ml_tkinter_gui()
Now next I create another function which used to print the prediction of test data:
Next I add another function which use to exit the window:
destroy() in built function which used to close or exit the window.
Complete code you can see in code file(.py), Output of this implementation is below:
To get any other Tkinter related help you can contact us at:
Recent Posts
See All
Analysis of Instagram posts | Analyze the Social Media Posts Using Python Jupyter
Notebook
10
Introduction PyTorch is a machine learning framework that is used in both academia and
industry for various applications. PyTorch started of as a more flexible alternative to
TensorFlow, which is a
00
Analysis of Instagram posts | Analyze the Social Media Posts Using Python Jupyter
Notebook
10
Introduction PyTorch is a machine learning framework that is used in both academia and
industry for various applications. PyTorch started of as a more flexible alternative to
TensorFlow, which is a
00
Analysis of Instagram posts | Analyze the Social Media Posts Using Python Jupyter
Notebook
10
Introduction PyTorch is a machine learning framework that is used in both academia and
industry for various applications. PyTorch started of as a more flexible alternative to
TensorFlow, which is a
00
1 Comment
Write a comment...
Newest
NewestOldestMost Reactions
K
Error! Filename not specified.
Kane Dai
Reply
REALCODE4YOU
Realcode4you is the one of the best website where you can get all computer science and
mathematics related help, we are offering python project help, java project help, Machine
learning project help, and other programming language help i.e., C, C++, Data Structure,
PHP, ReactJs, NodeJs, React Native and also providing all databases related help.
Hire Us to get Instant help from realcode4you expert with an affordable price.
Rated 4.9/5
USEFUL LINKS
Services
Careers
About Us
Contact Us
Blog
FAQ
Forum
Discount
Refund Policy
Reviews
ADDRESS
Noida, Sector 63, India 201301
Follows Us!
Error! Filename not specified.
Error! Filename not specified.
Error! Filename not specified.
Error! Filename not specified.
Let's Chat With Us!