0% found this document useful (0 votes)
4 views9 pages

1DS21ET046

Uploaded by

manjunathgowd035
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views9 pages

1DS21ET046

Uploaded by

manjunathgowd035
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 9

DAYANANDA SAGAR COLLEGE OF ENGINEERING

Shavige Malleshwara Hills, Kumaraswamy Layout, Bangalore-560078


(An Autonomous Institute affiliated to VTU, Accredited by NAAC with ‘A’ Grade, UGC &
ISO 9001:2008 Certified)
VISVESVARAYA TECHNOLOGICAL UNIVERSITY
“JnanaSangama”, Belagavi-18, Karnataka, India.

Department of Electronics and Telecommunication Engineering


Accredited by National Board of Accreditation Council (NBA)
2023-24

BE VI Sem ‘A’ Sec


Course: Python Programming
Course Code: 21ET641
ASSIGNMENT REPORT TOPIC:
“Prediction of Whether the person has Fracture or Not using Naïve Bayes”

Student Name USN


MANJUNATH B N 1DS21ET046

Course Co-Ordinator:
Prof. Devaraju. R
Assistant Professor
Dept. of ETCE
Python Programming 2023-24

WORKSHOP NARRATION:

Day One Workshop Sessions


The Python workshop began with an introduction to basic ideas and real-world applications, laying a
solid basis for further learning. Participants quickly advanced through interactive sessions covering
fundamental operations such as arithmetic computations, input handling, and control flow structures,
starting with basic syntax and data types. These lessons were interspersed with practical exercises that
improved comprehension through application, like developing basic calculators and iterative countdown
timers.

The introduction to Python's flexible capabilities for managing intricate data structures and leveraging
libraries for increased capability was a noteworthy highlight. In order to prepare for data manipulation
tasks that arise in the real world, participants dug into file management, learning how to create, write,
append to, and read from files.

The workshop also ventured into the realm of visualization using matplotlib, demonstrating how to
create various plots-line plots, pie charts, and scatter plots-effectively conveying data insights visually.
This session emphasized the importance of data representation in analysis and decision-making
processes.

Moreover, participants were introduced to essential modules like math and calendar, showcasing
Python's extensive standard library and its utility in diverse computational tasks, from mathematical
computations to date manipulation and calendar generation.

Overall, the first day fostered a comprehensive understanding of Python's syntax, capabilities, and
practical applications. Participants gained hands-on experience in fundamental programming constructs,
file operations, data visualization, and module utilization, laying a solid foundation for deeper
exploration in subsequent workshop sessions.

Dept. ETCE, DSCE, Bangalore Page 1


Python Programming 2023-24

Day Two Workshop Sessions


On the second day of your workshop, you worked with PyQt5, concentrating on improving your Python
application development skills and building interactive graphical user interfaces (GUIs). You installed
PyQt5 and associated tools first, then you set up PyQt5 environments to make sure they worked and
were compatible. This was an important stage since it made it possible for you to move smoothly into
the application design process.

With the help of {designer.exe} in the command window, you started creating interfaces visually. With
the help of this tool, you may quickly arrange widgets, establish styles, and specify functionality right
inside the GUI designer. After utilizing ‘pyuic5’, you transformed these ‘.ui’ files into executable Python
code (‘*.py’), incorporating your visual designs into usable apps that were prepared for distribution.

This session produced two noteworthy projects: a straightforward calculator and a personalized name
entry application. The name entry program included first and last name input fields that, when a button
was pressed, dynamically updated a result label. This illustrated your ability to leverage PyQt5's signals
and slots method to connect user inputs to application logic.

Similarly, PyQt5's ability to manage user interactions for arithmetic operations was demonstrated via the
straightforward calculator application. Using input fields for numerical data and buttons for addition,
subtraction, multiplication, and division, your implementation demonstrated a useful application of
PyQt5 in developing intuitive and responsive user interfaces.

Apart from developing the GUI, you also kept learning more about how to manipulate and analyze data
using pandas and scikit-learn. With the help of these libraries, you investigated data handling operations
like reading CSV files, filling in data gaps, and using linear regression to predictive modelling. Your
comprehensive strategy for using Python for both front-end and back-end application components is
highlighted by this integration of data analysis and GUI development.

Dept. ETCE, DSCE, Bangalore Page 2


Python Programming 2023-24

All things considered, Day 2 demonstrated your advancement in using PyQt5 for GUI development in
addition to your continuous investigation of data science tools, strengthening your capacity to use
Python in a variety of contexts, from interactive apps to analytical insights.

Day Three Workshop Sessions


The third day of the course saw participants going further into real-world Python uses for machine
learning and data analysis. Managing datasets, applying classification methods, and visualization were
among the important subjects discussed.

Dataset Handling and Exploration: Participants gained knowledge about how to use pandas, a potent
Python data manipulation toolkit, to import and explore datasets. They worked on reading CSV files and
loading data into pandas DataFrames using functions like ‘read_csv()’. They worked with datasets like
Social_Network_Ads.csv, Insurance_Data.csv, Iris.csv, Salaries.csv, and TitanicSurvival.csv, for
example.

Data Exploration and Preprocessing: It's essential to comprehend the features and structure of data.
Methods such as ‘info()’ were utilized by participants to obtain a summary of the types, columns, and
missing values in the dataset. Additionally, they handled missing values (e.g., by using ‘fillna()’),
encoded categorical variables (e.g., by using ‘LabelEncoder’), and divided data into training and testing
sets (e.g., by using ‘train_test_split’) as part of their data pre-processing duties.

Visualization: Visualization is essential for understanding data patterns and relationships. Participants
utilized matplotlib for creating scatter plots to visualize relationships between variables like age and
insurance purchase likelihood.

Classification Algorithms: The workshop introduced classification algorithms for predictive modeling.
Participants implemented algorithms like K-Nearest Neighbors (KNN), Naive Bayes, and Support
Vector Machines (SVM) using scikit-learn. They learned how to split data, train models, make
predictions (`fit`, `predict` methods), and evaluate model performance using metrics like confusion
matrices.
Dept. ETCE, DSCE, Bangalore Page 3
Python Programming 2023-24

Regression Methods: Although not detailed in the provided sample codes, regression methods such as
Linear Regression or Logistic Regression are typically covered in machine learning workshops for
predicting continuous or binary outcomes respectively. These methods involve fitting a model to training
data and predicting outcomes based on learned relationships.

ASSIGNMENT:

Dataset Description

The dataset includes the following columns:


1.id: Unique identifier for each person
2. age: Age of the person
3.sex: Sex of the person (F for female, M for male)
4.fracture: Indicates whether the person has a fracture ("no fracture" or "fracture")
5. weight: Weight of the person in kilograms
6.height: Height of the person in centimetres
7.medication: Type of medication the person is taking
8 waiting time: Waiting time before treatment
9.bmd: Bone mineral density

We'll use the Naïve Bayes classifier to predict whether a person has a fracture or not. Let's start by
preprocessing the data and then training the model.

Dept. ETCE, DSCE, Bangalore Page 4


Python Programming 2023-24

Approach Taken in the Code:

 Loading the Dataset: This example assumes you have a dataset in a CSV file named data.csv. The dataset
should have various features (like age, gender, symptoms) and a target variable Fracture indicating whether the
person has a fracture or not.

 Separating Features and Target: The features (independent variables) are separated from the target variable
(dependent variable) Fracture.

 Splitting the Data: The dataset is split into training and testing sets. Here, 80% of the data is used for training and
20% for testing.

 Initializing and Training the Model: A Gaussian Naive Bayes classifier is initialized and trained on the training
data.

 Making Predictions: Predictions are made on the test set.

 Evaluating the Model: The model's accuracy is evaluated, and a classification report and confusion matrix are
printed to understand the performance.

Dept. ETCE, DSCE, Bangalore Page 5


Python Programming 2023-24

Dept. ETCE, DSCE, Bangalore Page 6


Python Programming 2023-24

OUTPUT:

Dept. ETCE, DSCE, Bangalore Page 7


Python Programming 2023-24

REFERENCES:

The workshop provided a comprehensive foundation in machine learning and data analysis, leveraging
prominent references such as "Hands-On Machine Learning with Scikit-Learn, Keras, and TensorFlow"
by Aurélien Géron and Coursera's "Machine Learning" course by Andrew Ng. Participants gained
practical insights through tutorials on Towards Data Science, and deepened their understanding with
realworld applications from the Scikit-learn documentation. This structured approach equipped attendees
with essential skills to navigate complex datasets and apply diverse machine learning algorithms
effectively.

Here are concise references for machine learning and data analysis:

➔ "Hands-On Machine Learning with Scikit-Learn, Keras, and TensorFlow" by Aurélien Géron.

➔ "Pattern Recognition and Machine Learning" by Christopher M. Bishop

➔ "Machine Learning: A Probabilistic Perspective" by Kevin P. Murphy

➔ Coursera's "Machine Learning" course by Andrew Ng.

➔ Towards Data Science (towardsdatascience.com) for tutorials.

➔ Scikit-learn documentation (scikit-learn.org) for algorithms and examples.

Dept. ETCE, DSCE, Bangalore Page 8

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy