Affan Report

Download as pdf or txt
Download as pdf or txt
You are on page 1of 36

Visvesvaraya Technological University

Belgaum, Karnataka-590 014

A Internship – 18CSI85 Report on


“Prediction Of different type of Migraines
using Random Forest”
submitted in partial fulfillment of the requirement for the
award of the degree of

Bachelor of Engineering in
Computer Science & Engineering

Submitted by
SYED AFFAN 1HK20CS164
Under the Guidance of

Prof. Preetha M Mr. Mahesh


(Internal Guide) (Ext Guide)
Asst. Professor Project Manager
Dept. of CSE KARUNADU
HKBKCE, Bengaluru Technologies Pvt. Ltd

HKBK College of Engineering


No.22/1, Opp., Manyata Tech Park Rd, Nagavara, Bengaluru, Karnataka 560045.
Approved by AICTE & Affiliated by VTU

Department of Computer Science & Engineering


2023-24
HKBK College of Engineering
No.22/1, Opp., Manyata Tech Park Rd, Nagavara, Bengaluru, Karnataka 560045.
Approved by AICTE & Affiliated by VTU

Department of Computer Science and Engineering

CERTIFICATE

Certified that the technical seminar work entitled “Prediction Of different type of
Migranes using Random Forest” carried out by Mr. Syed Affan(1HK20CS164), a
bonafide student of HKBK College of Engineering.in partial fulfillment for the award
of Bachelor of Engineering in Computer Science and Engineering of the Visvesvaraya
Technological University, Belgaum during the year 2023-24. It is certified that all
corrections/suggestions indicated for Internal Assessment have been incorporated in the
Report deposited in the departmental library.The Internship report has been approved as
it satisfies the academic requirements in respect of Internship work-18CSI85
prescribed for the said Degree.

Signature of Guide Signature of HOD Signature of Principal


Prof. Preetha M Dr. Smitha Kurian Dr. Mohammed Riyaz Ahmed

External Viva
Name of the examiners Signature with date

1. _____________________ __________________

2. _____________________ __________________
ORGANIZATIN CERTIFICATE

iii
ACKNOWLEDGEMENT

I would like to express my regards and acknowledgement to all who helped me in completing
this Internship successfully.

First of all I would take this opportunity to express my heartfelt gratitude to the personalities
of HKBK College of Engineering, Mr. C M Ibrahim, Chairman, HKBKGI and Mr. C M
Faiz, Director, HKBKGI for providing facilities throughout the course.

I express my sincere gratitude to Dr. Mohammed Riyaz Ahmed , Principal, HKBCE for
his support and which inspired us towards the attainment of knowledge.

I consider it as great privilege to convey my sincere regards to Dr. Smitha Kurian ,


Professor and HOD, Department of CSE, HKBKCE for her constant encouragement
throughout the course of the internship.

I would especially like to thank my guide, Prof. Preetha M, Professor, Department of CSE
for her vigilant supervision and her constant encouragement. She spent his precious time in
reviewing the Internship work and provided many insightful comments and constructive
criticism.

We are grateful to Dr. Deepak N R and Dr. Nandha Gopal S M., Professors, Department of
Computer Science and Engineering for providing us useful insights, corrections and valuable
guidance.

I would also like to thank my external guide Mr. Mahesh from Karunadu Technologies for
giving me an opportunity to work as an Intern in the field of Machine Learning and Artificial
Intelligence

Finally, I thank Almighty, all the staff members of CSE Department, our family members and
friends for their constant support and encouragement in carrying out the Internship work.

1HK20CS164 SYED AFFAN

iv
ABSTRACT

The use of Machine Learning models, particularly K-Nearest Neighbors (KNN)


for high-energy Gamma particle classification and Artificial Intelligence (AI) for
car prediction, addresses challenges in financial security, scientific advancements,
and automotive decision-making. The project introduces two innovative solutions,
deploying KNN to classify high-energy Gamma particles based on provided
features and employing AI to predict car attributes.In the realm of financial
security, the high-energy Gamma particle classification system utilizes the KNN
algorithm to precisely categorize particles, contributing to scientific advancements
in nuclear research and environmental science. Simultaneously, the car prediction
system leverages AI models to provide accurate insights into various car attributes,
enhancing decision-making processes for both enthusiasts and industry
professionals.Both projects underscore the importance of meticulous dataset
curation, rigorous evaluation metrics, and user-friendly interfaces to maximize
accessibility and efficacy. By combining these efforts, the project showcases the
transformative potential of machine learning and AI technologies in diverse
sectors, ranging from security and scientific research to automotive practices.

v
TABLE OF CONTENTS
ACKNOWLADEMENT……………………………………… IV
ABSTRACT……………………………………………………. V
TABLE OF CONTENTS………………………………………. VI
LIST OF FIGURES…………………………………………… VII
CHAPTER 1:………………………………………………… 1
COMPANY PROFILE…………………………………………
CHAPTER 2: …………………………………………………. 7
ABOUT THE PROJECT………………………………………
CHAPTER 3: …………………………………………………. 12
TECHNICAL DESCRIPTION ……………………………….
CHAPTER 4 : ………………………………………………… 16
DESIGN MODEL …………………………………………….
CHAPTER 5:………………………………………………….. 21
SPECIFIC OUTCOMES………………………………………
CHAPTER 6:…………………………………………………. 24
SCREENSHOTS………………………………………………
REFERENCE ………………………………………………… 33

vi
LIST OF FIGURES

Sl. Figure no. Name of the figure Pg


No. no.
1 1.1 Company Logo 3
2 4.1 Machine Learning Model Building basic 18
steps
3 4.2 KNN 19
4 4.3 AI Workflow and Basic Working 20
5 6.1 Training Data-set 26
6 6.2 Code Snippet 27
7 6.3 Views.py of PYQT5 28
8 6.4 PYQT5 Output 29
9 6.5 Splitting data into train and test 29
10 6.6 Train dataset 30
11 6.7 Test Data-set 30
12 6.8 Training of data-set 31
13 6.9 Result of image detection with label 32

vii
18CSI85 Prediction Of different type of Migraines using Random Forest

CHAPTER 1
COMPANY PROFILE

Dept. Of CSE HKBKCE 2 2023-24


18CSI85 Prediction Of different type of Migraines using Random Forest

CHAPTER 1
COMPANY PROFILE
It is pleasure in introducing “Karunadu Technologies Private Limited” as a leading IT
software solutions and services industry focusing on quality standards and customer values. It is
also a leading Skills and Talent Development company that is building a manpower pool for
global industry requirements.

1.1 Profile

Fig 1.1 Company Logo


The company offers broad range of customized software applications powered by concrete
technology and industry expertise. It also offers end to end embedded solutions and services.
They deal with broad range of product development along with customized features ensuring at
most customer satisfaction and also empower individual with knowledge, skills and competencies
that assist them to escalate as integrated individuals with a sense of commitment and dedication.

1.1.1 Vision
To Empower Unskilled Individual with knowledge, skills and technical competencies in the field
of Information Technology and Embedded engineering which assist them to escalate as integrated
individuals contributing to company’s and Nation’s growth.

1.1.2 Mission
• Provide cost effective and reliable solutions to customers across various latest
technologies.
• Offer scalable end-to-end application development and management solutions
• Provide cost effective highly scalable products for varied verticals.
• Focus on creating sustainable value growth through innovative solutions and unique
partnerships.

Dept. Of CSE HKBKCE 3 2023-24


18CSI85 Prediction Of different type of Migraines using Random Forest

• Create, design and deliver business solutions with high value and innovation by leveraging
technology expertise and innovative business models to address long-term business
objectives.
• Keep our products and services updated with the latest innovations in the respective
requirement and technology.
1.1.3 Objectives
• To develop software and Embedded solutions and services focussing on quality standards
and customer values.
• Offer end to end embedded solutions which ensure the best customer satisfaction.
• To build Skilled and Talented manpower pool for global industry requirements.
• To develop software and embedded products which are globally recognized.
• To become a global leader in Offering Scalable and cost-effective Software solutions and
services across various domains like E-commerce, Banking, Finance, Healthcare and
much more.
• To generate employment for skilled and highly talented youth of our Country INDIA.

1.2 Company Products and Services Offered


1.2.1 Products
• KECMS – Karunadu Enterprise Content Management System
Karunadu Enterprise Content Management System is a one stop solution for all our
enterprise content management System relating to digital asset management, document imaging,
workflow systems and records management systems. Increasing digitalization has led to an
exponential growth in business content and managing this sea of unstructured data is tedious
work. KECMS enables you to create, capture, manage, distribute, archive different forms of
content and has much more features.
⚫ KEMS – Karunadu Education Management System: Manage diversified data relating to
education management on cloud. Educational data including students and staff is gathered
over years which contain information from admission/appointment until leaving the
Education. Statistical reports for the College/school can be generated along with
admission Tracking and result analysis to keep track of progressive improvements of both
student and staff.
• KASS – Karunadu Advanced Security System: A Complete one stop embedded
solution for large apartments. Security system which monitors door breakage, window

Dept. Of CSE HKBKCE 4 2023-24


18CSI85 Prediction Of different type of Migraines using Random Forest

breakage, gas leakage, motion detection and various other features which can be operated
and maintained by centralized monitored system. This Embedded solution enhances the
security measures of apartment/building and enhances the security of individuals may be
from unintended intervention or from unauthorized access.

1.2.2 Services

• IT Solutions and Services: Karunadu Technologies is a Bangalore based IT Training and


Software Development center with an exclusive expertise in the area of IT Services and
Solutions. Karunadu Technologies Pvt. Ltd. is also expertise in Web Designing and
Consulting Services.

• Embedded Design and Development: Karunadu Technologies Pvt. Ltd. has expertise in
Design and development of embedded products and offers solutions and services in field
of Electronics.

• Academic Projects : Karunadu Technologies Pvt. Ltd. helps students in their academics
by imparting industrial experience into projects to strive excellence of students. Karunadu
Technologies Pvt. Ltd. encourages students to implement their own ideas to projects
keeping in mind "A small seed sown upfront will be nourished to become a large tree one
day”, thereby focusing the future entrepreneurs. They have a wide range of IEEE projects
for B.E, MTech, MCA, BCA, DIPLOMA students for all branches in each and every
domain.

• Inplant Training: Karunadu Technologies Pvt. Ltd. provides Implant training for
students according to the interest of students keeping in mind the current technology and
academic benefit one obtains after completing the training. Students will be nourished and
will be trained throughout with practical experience. Students will be exposed to industrial
standards which boost their carrier. Students will become Acquaint to various structural
partitions such as labs, workshops, assembly units, stores, and administrative unit and
machinery units. They help students to understand their functions, applications and
maintenance. Students will be trained from initial stage that is from collection of Project
Requirements, Project Planning, Designing, implementation, testing, deployment and
maintenance there by helping to understand the business model of the industry. Entire
project life cycle will be demonstrated with hands on experience. Students will also be
trained about management skills and team building activities. They assure that by end of

Dept. Of CSE HKBKCE 5 2023-24


18CSI85 Prediction Of different type of Migraines using Random Forest

implant training students will Enhance communication skills and acquire technical skills,
employability skills, start-up skills, and will be aware of risks in industry, management
skills and many other skills which are helpful to professional engagement.

• Software Courses: Karunadu Technologies Pvt. Ltd. provides courses for students
according to the interest of students keeping in mind the current technology and assist
them for their further Employment. Company provides various courses such as C, C++,
VB, DBMS, Dot Net, Core Java and J2EE along with live projects.

Dept. Of CSE HKBKCE 6 2023-24


18CSI85 Prediction Of different type of Migraines using Random Forest

CHAPTER 2
ABOUT THE PROJECT

Dept. Of CSE HKBKCE 7 2023-24


18CSI85 Prediction Of different type of Migraines using Random Forest

CHAPTER 2
ABOUT THE PROJECT

2.1 Prediction of different type of migraines using random forest:


2.2.1 Introduction:

Migraine, a complex neurological condition characterized by recurrent severe headaches often


accompanied by additional symptoms such as nausea, vomiting, and sensitivity to light and sound,
presents a significant challenge for diagnosis and treatment. The diversity of migraine
presentations and triggers necessitates a nuanced understanding of the underlying factors
contributing to each individual's experience.

In recent years, advancements in machine learning techniques have shown promise in assisting
healthcare professionals in accurately diagnosing and predicting various medical conditions.
Among these techniques, the Random Forest algorithm has gained traction for its ability to handle
complex datasets, handle nonlinear relationships, and provide robust predictions.

This proposed system aims to leverage the Random Forest algorithm to develop a predictive
model for the classification and prediction of different types of migraines. By utilizing a carefully
curated dataset comprising various features such as patient demographics, medical history,
symptomatology, and potential triggers, the model seeks to differentiate between migraine
subtypes and predict the likelihood of specific migraine presentations.

2.2.2 Problem Statement :


To develop a model capable of predicting different types of migraines using the information
provided in the training dataset, several steps are required. Initially, the dataset needs
preprocessing to handle missing values, encode categorical variables, and potentially scale
numerical features. This step ensures the data is suitable for training a machine learning model.
Following preprocessing, feature selection or engineering is conducted to identify relevant
features that may distinguish between migraine types. This could include demographic
information, medical history, symptoms, triggers, and other pertinent data points. Random Forest
is chosen as the classification algorithm due to its ability to handle complex datasets and provide
robust predictions. Training the Random Forest model involves feeding it the preprocessed

Dept. Of CSE HKBKCE 8 2023-24


18CSI85 Prediction Of different type of Migraines using Random Forest

dataset to learn the patterns associated with different migraine types. Once trained, the model's
performance is evaluated using metrics such as accuracy, precision, recall, and F1-score to assess
its effectiveness in predicting migraine types. Iterative refinement may be necessary, involving
fine-tuning hyperparameters and feature selection to enhance model performance further. Finally,
upon satisfactory performance, the model can be deployed for predictions on new data, providing
valuable insights to healthcare professionals for diagnosis and treatment planning.

2.2.3 Proposed System:


⚫ The proposed system aims to develop an advanced fruit classification solution leveraging
artificial intelligence (AI) techniques to accurately identify and categorize guava, mango,
pineapple, and watermelon based on their visual attributes. By harnessing machine learning
algorithms and deep learning methodologies, the system will analyze a diverse dataset of fruit
images to extract intricate patterns and features crucial for classification.
⚫ Additionally, the proposed system prioritizes user accessibility and interaction by integrating
a user-friendly interface, facilitating seamless communication between stakeholders and the
classification system. Users across various industries, including agriculture, food processing,
and quality control, will benefit from real-time fruit classification results, empowering them
to make informed decisions and optimize operational processes effectively.
⚫ Furthermore, the proposed system offers scalability and adaptability, allowing for integration
into existing workflows and systems. Through continuous monitoring and feedback
mechanisms, the system can evolve and improve its classification accuracy over time,
ensuring long-term effectiveness and reliability in fruit identification tasks. Overall, the
proposed system represents a significant advancement in fruit classification technology, with
potential applications across diverse sectors and industries.

Dept. Of CSE HKBKCE 9 2023-24


18CSI85 Prediction Of different type of Migraines using Random Forest

CHAPTER 3
TECHNICAL DESCRIPTION

Dept. Of CSE HKBKCE 10 2023-24


18CSI85 Prediction Of different type of Migraines using Random Forest

CHAPTER 3
TECHNICAL DESCRIPTION
⚫ Python:Python is a multiparadigm, general-purpose, interpreted, high-level programming
language. Python allows programmers to use different programming styles to create simple
or complex programs, get quicker results and write code almost as if speaking in a human
language.
⚫ Pandas : Pandas is a powerful Python library for data manipulation and analysis. It provides
easy-to-use data structures and functions that enable users to efficiently work with structured
data, such as tables and time series. With pandas, users can load, clean, transform, and
analyze data with ease, making it an indispensable tool for data scientists, analysts, and
developers. Its intuitive syntax and rich functionality make it a popular choice for tasks
ranging from data cleaning and preparation to exploratory data analysis and statistical
modeling
⚫ sklearn.impute.SimpleImputer: It is a scikit-learn class used to handle missing values
in datasets. It offers strategies like mean, median, most frequent value, or a constant to replace
missing data. With its simple interface, SimpleImputer streamlines data preprocessing,
ensuring datasets are suitable for analysis or modeling tasks. Overall, it's a valuable tool for
maintaining data integrity in machine learning workflows.
⚫ K-Nearest Neighbors (KNN) is a supervised learning technique primarily employed for
classification tasks, although it can also be adapted for regression problems. Unlike decision
trees, KNN doesn't construct explicit decision rules or a predefined structure but relies on the
proximity of data points.
⚫ In the KNN algorithm, each data point in the dataset becomes a potential decision point. The
classification of a new data point is determined by the majority class among its k-nearest
neighbors, where "k" is a user-defined parameter. These neighbors are identified based on a
distance metric, commonly Euclidean distance, in the feature space.
⚫ The essence of KNN lies in its simplicity and flexibility. It adapts to the underlying patterns
in the data, making it suitable for various applications. However, its effectiveness can be
influenced by the choice of distance metric and the value of "k." Smaller values of "k" lead
to more flexible models but can be sensitive to noise, while larger values of "k" provide
smoother decision boundaries at the cost of overlooking local patterns.

Dept. Of CSE HKBKCE 11 2023-24


18CSI85 Prediction Of different type of Migraines using Random Forest

⚫ In summary, KNN offers an intuitive approach to classification, emphasizing the influence


of neighboring data points in the decision-making process. Its ease of implementation and
adaptability make it a valuable tool in scenarios where understanding the local structure of
the data is crucial.
⚫ Django: Django provides the backend infrastructure for your web application. You define
the application logic, data models, and URL routing using Python code. Django also comes
with a built-in templating engine that allows you to dynamically generate HTML content
based on data from the backend
⚫ HTML: HTML is used to create the structure and content of web pages. With Django, you
can create HTML templates that define the layout of your web pages. These templates can
contain placeholders (or template variables) that are replaced with actual data when the page
is rendered. For example, you might have a template for displaying a list of products, where
each product's name, description, and price are dynamically inserted into the HTML.
⚫ CSS: CSS is used to style the appearance of web pages, including elements like fonts, colors,
margins, and borders. With Django, you can include CSS files in your HTML templates to
apply styles to your web pages. You can define CSS rules to control the layout and visual
presentation of elements on the page, ensuring a consistent and appealing user interface.
⚫ PyQt5: PyQt5 is a Python library that enables developers to create desktop applications with
rich graphical user interfaces (GUIs) using the Qt framework.

⚫ TensorFlow.keras.models: TensorFlow is a machine learning library, and Keras is its


high-level neural networks API. The 'Sequential' model from TensorFlow.keras.models
allows for easy creation of neural network architectures by stacking layers sequentially.
⚫ TensorFlow.keras.layers: This module provides various types of layers that can be
added to neural network models, including convolutional, pooling, dense, and dropout layers,
enabling the construction of complex architectures.
⚫ TensorFlow.keras.utils: TensorFlow.keras.utils offers utility functions for working
with Keras models, such as one-hot encoding categorical variables using the 'to_categorical'
function.
⚫ sklearn.model_selection: This scikit-learn module provides tools for splitting datasets
into training and testing sets, cross-validation, and other model selection techniques, essential
for evaluating and validating machine learning models.

Dept. Of CSE HKBKCE 12 2023-24


18CSI85 Prediction Of different type of Migraines using Random Forest

⚫ NumPy: NumPy is a fundamental package for numerical computing in Python, providing


powerful tools for working with multi-dimensional arrays and matrices, essential for handling
numerical data in machine learning tasks.
⚫ matplotlib.pyplot: Matplotlib is a comprehensive plotting library for Python. The 'pyplot'
module provides a MATLAB-like interface for creating a variety of plots and visualizations,
commonly used for data visualization and analysis.
⚫ PIL: The Python Imaging Library (PIL) allows for opening, manipulating, and saving many
different image file formats in Python, making it a valuable tool for image processing and
computer vision applications.
⚫ Hardware Requirements:
⚫ Processor : Intel i3 or higher
⚫ RAM : 8GB or higher
⚫ ROM : 500 GB or Higher
⚫ Architecture :32 or 64 bits
⚫ Software Requirements:
⚫ Software: Python & Jupyter Notebook
⚫ Software Tool & Libraries : html, tensor flow , pandas , dklearn , keras , Django

Dept. Of CSE HKBKCE 13 2023-24


18CSI85 Prediction Of different type of Migraines using Random Forest

CHAPTER 4
DESIGN MODEL

Dept. Of CSE HKBKCE 14 2023-24


18CSI85 Prediction Of different type of Migraines using Random Forest

CHAPTER 4
DESIGN MODEL

4.1 Flow Chart for Machine Learning

The Fig 4.1 show a flow chart or flow diagram for a basic step in building Machine learning
model which discuss about various steps such as
⚫ Connecting to the Data Source: Establish a connection to the data source where the dataset is
stored. This could be a database, data warehouse, cloud storage, or any other data repository.
⚫ Data Extraction: Extract the dataset from the data source. Depending on the source and format
of the data, this may involve querying a database, downloading files from the internet, or
accessing data via APIs.
⚫ Structured Data: Organize the extracted data into a structured format suitable for analysis.
This typically involves converting the data into a tabular format, such as a DataFrame in
Python, where rows represent observations and columns represent features.
⚫ Feature Engineering: Process and transform the raw data into meaningful features that can be
used to train a machine learning model. This may include techniques such as encoding
categorical variables, scaling numerical features, handling missing values, and creating new
derived features.
⚫ Model Training: Select an appropriate machine learning algorithm and train a model using
the prepared dataset. The model learns patterns and relationships in the data that enable it to
make predictions or decisions.
⚫ Evaluate Model: Assess the performance of the trained model using evaluation metrics and
techniques. This helps determine how well the model generalizes to unseen data and whether
it meets the desired performance criteria.
⚫ Deploy and Serve Model: Deploy the trained model to a production environment where it
can be accessed by end-users or other applications. This may involve setting up a web service,
containerizing the model, or integrating it into an existing application.
⚫ Result Evaluation: Continuously monitor and evaluate the performance of the deployed
model in the production environment. Collect feedback, analyze model predictions, and
assess how well the model meets the intended objectives.

Dept. Of CSE HKBKCE 15 2023-24


18CSI85 Prediction Of different type of Migraines using Random Forest

Fig 4.1 Machine Learning Model Building Basic Steps


4.2 Flow Chart for Random Forest algorithm
Data Collection: Collect relevant data for training the KNN algorithm. This dataset should include
both input features and corresponding target labels or outcomes, facilitating the training process.

Data Preprocessing: Prepare the collected data for KNN training by addressing missing values,
encoding categorical variables, and scaling numerical features as required. This step ensures the
data is appropriately formatted for effective use with the KNN algorithm.

Random Forest Model Training: Train the random forest model using the prepared dataset. The
algorithm classifies data points based on the majority class among their k-nearest neighbors,
where k is a user-defined parameter. The model learns to categorize new instances by considering
the labels of nearby data points in the feature space.

Hyperparameter Tuning (Optional): Optionally, perform hyperparameter tuning to optimize the


performance of the random forest model. Adjust parameters such as the number of neighbors (k)
to enhance the model's accuracy and generalization capabilities.

Model Evaluation: Evaluate the model's performance using relevant metrics like accuracy,
precision, recall, and F1 score. This step provides insights into the model's ability to generalize
to unseen data and its overall performance against specified criteria.

Dept. Of CSE HKBKCE 16 2023-24


18CSI85 Prediction Of different type of Migraines using Random Forest

Model Deployment: Deploy the trained KNN model to a production environment, enabling it to
make predictions on new, unseen data. Integration may involve incorporating the model into
existing systems or deploying it as a standalone application or service.

Monitoring and Maintenance: Continuously monitor the performance of the deployed KNN
model in the production environment. Regularly retrain the model with new data, updating it as
needed to ensure continued accuracy and effectiveness over time. This iterative process helps
maintain the model's relevance and reliability in dynamic environments.

Fig 4.2 KNN


4.3 Flow Chart for AI
The Fig 4.2 show a flow chart or flow diagram for a basic step in tranning and evaluating a AI
Model the steps are mentioned below
⚫ Training Data: This represents the raw data you use to train the machine learning model. In
linear regression, this data typically consists of input features (independent variables) and a
target variable (dependent variable).
⚫ Feature Extraction: This step might involve extracting relevant features from the raw data.
For instance, if your raw data contained text documents, you might extract features like word
frequencies or document length. In the context of the image, it likely refers to extracting the
midterm exam score and its squared value as features from the raw student data.
⚫ Feature Matrix: This represents a table where each row represents a training example, and
each column represents a feature. So, the first row might have the midterm exam score and

Dept. Of CSE HKBKCE 17 2023-24


18CSI85 Prediction Of different type of Migraines using Random Forest

its squared value for student 1, the second row might have the same features for student 2,
and so on.
⚫ Labels: These are the target values you want your model to predict. In linear regression, the
labels are usually continuous numerical values. In the image, it likely refers to the final exam
scores for each student in the training data.
⚫ Model Learning: This is where the machine learning algorithm learns a model from the
training data. In linear regression, the model learns a linear relationship between the features
and the labels. This involves calculating the weights (coefficients) for each feature that best
fit the data.
⚫ Machine Learning Algorithm: This refers to the specific algorithm used to train the model.
In the case of the image, it's likely referring to a linear regression algorithm.
⚫ Model: This represents the final model learned from the training data. The model can then be
used to predict the target variable (final exam score) for new, unseen data points (students
whose final exam scores are unknown) based on their midterm exam scores.
⚫ Predicting: This refers to using the trained model to make predictions on new data. In linear
regression, you would input the features of a new data point (midterm exam score) into the
model, and the model would predict the corresponding target variable (final exam score).
⚫ Labels (New Data): These represent the actual target values for the new data points you're
making predictions on. In the image, it likely refers to the actual final exam scores of new
students whose scores you're trying to predict.
⚫ Evaluation: This step involves evaluating the performance of the model on unseen data. You
can use various metrics to assess how well the model's predictions match the actual target

values.
Fig 4.3 AI Workflow and Basic Working

Dept. Of CSE HKBKCE 18 2023-24


18CSI85 Prediction Of different type of Migraines using Random Forest

CHAPTER 5
SPECIFIC OUTCOMES

Dept. Of CSE HKBKCE 19 2023-24


18CSI85 Prediction Of different type of Migraines using Random Forest

CHAPTER 5
SPECIFIC OUTCOMES

5.2 Migrane Detection Outcome:

The outcome of migraine detection using Random Forest involves the model's predictions on
new, unseen data. After training and evaluating the Random Forest model, it can be deployed to
make predictions on individuals' migraine types based on their characteristics and symptoms.

For example, given a new patient's demographic information, medical history, symptoms, and
potential triggers, the Random Forest model can classify their migraine type as either migraine
with aura, migraine without aura, or another specific subtype.

The outcome of the model would be a prediction indicating the most likely migraine type for the
individual, along with the associated probability or confidence score. This prediction can assist
healthcare professionals in making informed decisions regarding diagnosis, treatment planning,
and management strategies tailored to the patient's specific migraine type.

Additionally, the model's predictions can contribute to ongoing research efforts in


understanding migraine pathophysiology, identifying risk factors, and developing targeted
interventions for different migraine subtypes. Overall, the outcome of migraine detection using
Random Forest provides valuable insights that can improve patient care and advance our
understanding of migraine disorders.

Dept. Of CSE HKBKCE 20 2023-24


18CSI85 Prediction Of different type of Migraines using Random Forest

CHAPTER 6
SCREEN SHOTS

Dept. Of CSE HKBKCE 21 2023-24


18CSI85 Prediction Of different type of Migraines using Random Forest

CHAPTER 6
SCREENSHOTS

6.1 DETECTION OF FAKE CURRENCY

The dataset used in this project consists of the variables:


• Alpha
• Delta
• U
• G
• R
• Z
• Run_id
• Rerun_id
• Cam_col
• Field_id
• Spec_obj_id
• Redshift
• Plate
• MD
• Fiber_id

The dataset consists of below features which can be summarized as follows:


1. fLength: major axis of ellipse [mm]
2. fWidth: minor axis of ellipse [mm]
3. fSize: 10-log of sum of content of all pixels [in #phot]
4. fConc: ratio of sum of two highest pixels over fSize [ratio]
5. fConc1: ratio of highest pixel over fSize [ratio]
6. fAsym: distance from highest pixel to center, projected onto major axis [mm]
7. fM3Long: 3rd root of third moment along major axis [mm]
8. fM3Trans: 3rd root of third moment along minor axis [mm]
9. fAlpha: angle of major axis with vector to origin [deg]

Dept. Of CSE HKBKCE 22 2023-24


18CSI85 Prediction Of different type of Migraines using Random Forest

10. fDist: distance from origin to center of ellipse [mm]


11. class: g = gamma (signal), h = hadron (background)
The overview of the original dataset is shown in fig 6.1., with its original features:

Fig 6.1 Training Data-set

The code snippet presented in Fig 6.2 illustrates a machine learning pipeline designed for
detecting counterfeit currency bills using a K-Nearest Neighbors (KNN) classifier. The process
begins by loading a dataset from a CSV file, ensuring an organized approach to data retrieval. To
maintain data integrity, missing values are handled by replacing them with the median of a
specific column, a crucial step in data preprocessing. Subsequently, the input features and target
variable are separated, preparing the dataset for effective model training and evaluation. The K-
Nearest Neighbors classifier is then initialized and trained on the preprocessed dataset,
showcasing the model's readiness to discern patterns within the provided features. Following
training, the code employs the trained KNN model to predict the authenticity of a sample bill
based on its feature values. The prediction result is printed, providing a transparent demonstration
of the model's efficacy in making accurate predictions on unseen data. Overall, this code snippet
offers a clear and systematic depiction of the data preprocessing, model training, and prediction
processes, facilitating a straightforward implementation for counterfeit currency detection using
the K-Nearest Neighbors algorithm.

Dept. Of CSE HKBKCE 23 2023-24


18CSI85 Prediction Of different type of Migraines using Random Forest

Fig 6.2 Code Snippet

In Django, `views.py` serves as the file containing Python functions responsible for handling
requests from web clients and generating appropriate responses. Fig 6.3 view function
corresponds to a URL endpoint in the web application and contains the necessary business logic
to process requests, such as querying the database, processing form data, or rendering templates.
Views can return various types of responses, including HTML content, JSON data, file
downloads, or redirects. While traditionally containing function-based views, Django also
supports class-based views for more flexibility and reusability. Decorators are often used to add
functionality to views, such as authentication or permission checks, and error handling logic
ensures the application remains robust in the face of unexpected conditions. Overall, `views.py`
plays a pivotal role in defining the behavior and functionality of a Django web application.

Dept. Of CSE HKBKCE 24 2023-24


18CSI85 Prediction Of different type of Migraines using Random Forest

Fig 6.3 Views.py of PYQT5

Fig 6.4 details the creation of a counterfeit currency detection system utilizing machine learning,
with a specific focus on the K-Nearest Neighbors (KNN) algorithm. The system takes as input
various features extracted from currency bills, including diagonal length, height, and margin
dimensions. These features are then input into a trained KNN model, which predicts the
authenticity of the currency bill, classifying it as either genuine or counterfeit. Users have the
capability to input relevant features of a currency bill, such as its dimensions, and receive a binary
classification indicating the likelihood of the bill being genuine or fraudulent. The primary goal
of this system is to provide an accurate and reliable means of counterfeit currency detection,
supporting financial institutions and regulatory bodies in their efforts to combat financial fraud
effectively.

Problem Statement: High-Energy Gamma Particle Classification using K-Nearest Neighbors


(KNN) AlgorithmThe task at hand involves leveraging machine learning models, specifically the
K-Nearest Neighbors (KNN) algorithm, to classify high-energy Gamma particles in the
atmosphere based on provided features. The input features include various characteristics of the
Gamma particles, and the objective is to develop a robust model capable of accurately
categorizing these particles. Users can input the relevant features of a Gamma particle, and the
system will provide a binary classification, indicating the likely type of the particle. The goal of
this project is to advance scientific understanding and environmental monitoring by facilitating
the identification and characterization of different types of high-energy Gamma particles. This

Dept. Of CSE HKBKCE 25 2023-24


18CSI85 Prediction Of different type of Migraines using Random Forest

classification system holds significant applications in areas such as nuclear research, space
exploration, and environmental science. The ultimate aim is to contribute to scientific
advancements and enhance our comprehension of atmospheric physics through precise high-
energy Gamma particle classification.

Fig 6.4 PYQT5 Output of Whether the Bill is fake or not Prediction

6.2 Prediction of Migrane using random forest:

Migraine detection using Random Forest is a sophisticated approach that leverages ensemble
learning to classify different types of migraines based on a diverse array of features and
symptoms. This methodology revolves around the construction and aggregation of multiple
decision trees, each contributing to the final prediction through a voting mechanism. By dissecting
the process, we gain insight into how Random Forest operates and its implications for migraine
diagnosis and treatment..
Random Forest operates on the principle of ensemble learning, which involves training multiple
decision trees independently and combining their predictions to produce a more accurate and
robust result. Decision trees, in essence, are flowchart-like structures that segment data based on
features, ultimately leading to a prediction at the leaf nodes. However, individual decision trees
are susceptible to overfitting, wherein they become overly tailored to the training data and fail to
generalize well to unseen instances. Random Forest mitigates this issue by constructing an
ensemble of decision trees, each trained on a random subset of the data and utilizing only a subset

Dept. Of CSE HKBKCE 26 2023-24


18CSI85 Prediction Of different type of Migraines using Random Forest

of the features. This randomness injects diversity into the decision trees, reducing the likelihood

Fig 6.6 Train dataset


Feature importance plays a crucial role in the functioning of Random Forest for migraine
detection. During the construction of decision trees, the algorithm evaluates the importance of
each feature in splitting the data and improving the purity of the resulting nodes. Features that
contribute significantly to distinguishing between different types of migraines are assigned
higher importance scores. By identifying these critical features, Random Forest gains insights

Fig 6.7

Dept. Of CSE HKBKCE 27 2023-24


18CSI85 Prediction Of different type of Migraines using Random Forest

Hyperparameter tuning is a critical aspect of optimizing Random Forest for migraine detection.
Hyperparameters are parameters that govern the behavior of the algorithm, such as the number
of decision trees in the forest, the maximum depth of each tree, and the minimum number of
samples required to split a node. Fine-tuning these hyperparameters is essential for optimizing
the model's performance and achieving the best possible accuracy. Through iterative
experimentation and validation, healthcare professionals can fine-tune the hyperparameters to
ensure that the Random Forest model effectively captures the underlying patterns in the data
In conclusion, Random Forest presents a powerful and versatile approach to migraine detection,
harnessing the principles of ensemble learning to classify different types of migraines based on
diverse sets of features and symptoms. By constructing an ensemble of decision trees, evaluating
feature importance, aggregating predictions, and tuning hyperparameters, Random Forest offers
a robust and accurate methodology for healthcare professionals to diagnose migraine types and
tailor treatment strategies according

Fig 6.9 Result of image detection with label

Dept. Of CSE HKBKCE 28 2023-24


18CSI85 Prediction Of different type of Migraines using Random Forest

REFERENCE

Dept. Of CSE HKBKCE 29 2023-24


18CSI85 Prediction Of different type of Migraines using Random Forest

REFERENCE

1) www.karunadutechnologies.com
2) https://www.simplilearn.com/10-algorithms-machine-learning-engineers-need-to-know-
article
3) https://www.edureka.co/blog/machine-learning-algorithms/
4) https://www.analyticsvidhya.com/blog/2017/09/common-machine-learning-algorithms/
5) Towards Data Science: https://towardsdatascience.com/
6) Machine Learning Mastery: https://machinelearningmastery.com/
7) Analytics Vidhya: https://www.analyticsvidhya.com/
8) Kaggle: https://www.kaggle.com/
9) Coursera: https://www.coursera.org/
10) edX: https://www.edx.org/
11) Stanford Online: https://online.stanford.edu/
12) MIT OpenCourseWare: https://ocw.mit.edu/index.htm

Dept. Of CSE HKBKCE 30 2023-24

You might also like