1DS21ET046
1DS21ET046
Course Co-Ordinator:
Prof. Devaraju. R
Assistant Professor
Dept. of ETCE
Python Programming 2023-24
WORKSHOP NARRATION:
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.
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.
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.
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
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.
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.
Evaluating the Model: The model's accuracy is evaluated, and a classification report and confusion matrix are
printed to understand the performance.
OUTPUT:
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.