
Data Description for Garment Factory Analysis Project using Python
Our dataset belongs to the garment factory and workers focusing on their productivity.
We have considered “NUMBER OF STYLE CHANGE” column as a base column in each of our machine learning models. It has only categorical data in it.
Below is the description of dataset columns:
- Date: This column of the dataframe has the date in MM-DD-YYYY
- Day: This column of the dataframe has the day of the Week
- Quarter: A portion of the month. A month was divided into four quarters
- Department: This column of the dataframe depicts the associated department with the instance
- Team_no: This column of the dataframe represents the Associated team number with the instance
- No_of_workers: This column of the dataframe represents the Number of workers in each team
- No_of_style_change: This column of the dataframe describes the Number of changes in the style of a
particular product - Targeted_productivity: This column of the dataframe depicts the Targeted productivity set by the
Authority for each team for each day. - Smv: This column of the dataframe depicts Standard Minute Value, it is the allocated time for a
task. - Wip: This column of the dataframe depicts wip (Work in progress) which includes the number of
unfinished items for products - Over_time: This column of the dataframe represents the amount of overtime by each team in
minutes. - Incentive: This column of the dataframe represents the amount of financial incentive (in BDT)
that enables or motivates a particular course of action. - Idle_time: This column of the dataframe depicted the amount of time when the production was
interrupted due to several reasons - Idle_men: This column of the dataframe depicts the number of workers who were idle due to
production interruption - Actual_productivity: This column of the dataframe depicts the actual % of productivity that the workers delivered. It ranges from 0-to 1
CODES:
Garment Factory Analysis Project using Python
Let us have a look at code screenshots:
The first step is that import the required libraries that we want to use in the process. We are importing pandas, numpy, seaborn, matplotlib.
Here it is

In the above cell, we are importing the libraries. We have imported numpy, pandas.
We have used pd. read csv ( ) function to read the excel dataset.

We are using the info ( ) function to print the data type and null count of each column

We are using the shape ( ) function to print the number of rows and columns in the dataset

We have used describe ( ) function to print the basic statistical values of all data columns that are numeric

Afterwards, we have used isnull( ) function followed by sum( ) to find the number of null values in each column.

Here, our exploratory data analysis and data cleaning end. Next, we have started with data visualization techniques.
DATA VISUALISATION

First of all, we are importing seaborn and matplotlib for data visualization.

In the above screenshot, we have plotted a heat map using the seaborn library for df.corr ( ).
Then, we have plotted a bar plot depicting the incentives for all the departments.

Garment Factory Analysis Project with Data Science and Ml using Python
We have presented a box plot for all the numeric columns present in our dataset for Garment Factory Analysis Project using Python

We have also presented the count of departments for each quarter. We have differentiated them using different colors for our ML Analysis Project using Python

We have plotted a pie chart showing the number of records in each department.

MACHINE LEARNING MODELS used in this ML and Data Science Project
Firstly, we need to prepare the dataset for training and testing the models.
We are dropping irrelevant columns. For example, date.


We would need categorial data for training the models of machine learning.
We have used “processing . Label Encoder ( )” to convert strings to numbers. We are using for loop to iterate over the dataset.

We have pasted the screenshot of the data frame that we have obtained after label encoding. We can see that we only have numerical values in our data frame now.
We are then importing the libraries for machine learning

We have imported the test train split, classification report, confusion matrix, and an accuracy score.

We are choosing NUMBER OF STYLE CHANGE as the target variable. We have to store the values of NUMBER OF STYLE CHANGE in Y and the remaining dataframe values in X. We are splitting the dataset as train and test data in the ratio of 80: 20 which means that 80 % of data is train data and 20 % data in test data
MODEL 1: RANDOM FOREST CLASSIFIER
We are importing the machine learning model, Random Forest Classifier from sklearn.ensemble.

Next, we are passing 600 estimators for the random forest classifier.

We have used the fit ( ) method to train the model by passing training data into it. Afterward, we used the predict ( ) method to find the accuracy of the model.
We have used x_test, x_train, y_test, and y_train that we have obtained after label encoding
in the first step of Garment Factory Analysis Project using Python

Our machine learning model has an accuracy score of 95.42%. It is accurate to conclude that our model is capable of predicting the target variable with a higher rate of accuracy.

In the screenshot presented above, we have presented the confusion matrix.
Also Read:
- 100+ Java Projects for Beginners 2023
- Courier Tracking System in HTML CSS and JS
- Test Typing Speed using Python App
- Top 15 Machine Learning Projects in Python with source code
- Top 15 Java Projects For Resume
- Top 10 Java Projects with source code
- Best 100+ Python Projects with source code
- Gender Recognition by Voice using Python
- Top 15 Python Libraries For Data Science in 2022
- Top 15 Python Libraries For Machine Learning in 2022
- Drawing Application in Python Tkinter
- Top 10 Final Year Projects for Computer Science Students
- Setup and Run Machine Learning in Visual Studio Code
- Diabetes prediction using Machine Learning
- Library Management System Project in Java
- Bank Management System Project in Java
- CS Class 12th Python Projects
- 15 Deep Learning Projects for Final year
- Machine Learning Scenario-Based Questions
- Customer Behaviour Analysis – Machine Learning and Python
- NxNxN Matrix in Python 3
- 3 V’s of Big data
- Naive Bayes in Machine Learning
- Top 10 Python Projects for Final year Students
- Automate Data Mining With Python
- Support Vector Machine(SVM) in Machine Learning
- Python OOP Projects | Source code and example
- Convert ipynb to Python
- Data Science Projects for Final Year
- Multiclass Classification in Machine Learning
- Movie Recommendation System: with Streamlit and Python-ML
- Getting Started with Seaborn: Install, Import, and Usage
- List of Machine Learning Algorithms
- Recommendation engine in Machine Learning
- Machine Learning Projects for Final Year
- ML Systems
- Python Derivative Calculator
- Mathematics for Machine Learning
- Inventory Management System Project in python
- Courier Management System project in Python
- Data Science Homework Help – Get The Assistance You Need
- How to Ace Your Machine Learning Assignment – A Guide for Beginners
- Contact Management System Project in Python
- Top 10 Resources to Find Machine Learning Datasets in 2022
- Reinforcement learning in Python
- Python SQLite Tutorial
- Student Management System Project in Python
- Face recognition Python
- 20 Python Projects for Resume
- Restaurant management system project in Python
- Employee Management System Project in Python
- Bank Management System Project in Python
- Hate speech detection with Python
- Hospital Management System Project in Python
- Attendance Management System Project in Python
- MNIST Handwritten Digit Classification using Deep Learning
- Stock Price Prediction using Machine Learning
- Control Mouse with hand gestures detection python
- Create a Vehicle Parking Management Project in Python
- Build Your Own Map Flight Tracking Application with Python
- Traffic Signal Violation Detection System using Computer Vision
- Deepfake Detection Project Using Deep-Learning
- Employment Trends Of Private & Government Sector in UAE | Data Analysis
- Pokemon Analysis Project in ML and Data Science using Python
- Garment Factory Analysis Project using Python
- Creating a Pong Game using Python Turtle
- Deploy Machine Learning model using Streamlit
- Breast Cancer Detection – Machine Learning
- 8 Steps to Build a Machine Learning Model
- Detect Eyes and Detect Faces in Python
- User Authentication System in Django Python
- Django Framework | Developing a Blog website in Django (Tutorial) Part 2
- Customer Segmentation using Python in Machine Learning
- Titanic Survival Prediction – Machine Learning Project (Part-2)
- Titanic Survival Prediction – Machine Learning Project (Part-1)
- Random Forest in ML: Wisdom of the Crowd
- K Nearest Neighbours|KNN: One of the Earliest ML Algorithm
- 3D animation in Python: vpython
- Complete Racing Game In Python Using PyGame
- Decision Tree: Foundation of Powerful ML Algorithms
- Logistic Regression: Regression Model for Classification
- Gradient Descent: Another Approach to Linear Regression
- Linear Regression: Your 1st Step in Machine Learning
- Set up Python Environment
- Seaborn: Create Elegant Plots
- Matplotlib Python: A Beginner’s Walkthrough
- Python Pandas Tutorial: A Complete Introduction for Beginners
- Numpy For Machine Learning: A Complete Guide
- Jupyter Notebook: The Ultimate Guide
- ML Environment Setup and Overview
- Machine Learning Course Description
- Machine Learning: A Gentle Introduction
- Python Assignment Help Online| Python Homework Help