Data Science MAchine Learning AI, Study notes of Computer science

Data Science Machine Learning AI

Typology: Study notes

2024/2025

Uploaded on 11/07/2025

shoua-iqbal
shoua-iqbal 🇵🇰

7 documents

1 / 12

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Page#1 Unit # 4 Data and Analysis Instructor: Sartaj Aziz Khan
Data:
Data is any kind of information we collect.
It can be numbers, words, pictures, or facts.
Example: The names of students in a class, their marks, or the weather report.
Analysis:
Analysis means studying data to understand it better.
We look for patterns, trends, or answers in the data.
Example: If we check students' marks and find out who scored the highest or lowest, that's analysis.
Purpose of Data Analysis:
The main purpose of data analysis is to turn raw information into useful knowledge.
Key points:
To understand data clearly.
To find patterns or trends.
To solve problems or answer questions.
To support better decisions.
Data Science:
Data science is the study of data. It uses tools and methods to find patterns(نےنمو) and useful information. It helps in making
better decisions using data.
Objective of Data Science:
The main objective of data science is to understand data and use it to solve problems or make better decisions.
Key Points:
To collect and organize data.
To find patterns and useful information.
To predict future trends.
To help in making smart decisions.
Data Science and Its Scope:
Data science is the study of data to find useful information. It is used in many fields to make better decisions.
1. Healthcare:
Data science helps doctors study patient data. It improves diagnosis and treatment.
2. Sport:
Data science tracks players' performance. It helps in making winning strategies.
3. Finance:
Data science studies money-related data. It helps in preventing fraud and managing investments.
pf3
pf4
pf5
pf8
pf9
pfa

Partial preview of the text

Download Data Science MAchine Learning AI and more Study notes Computer science in PDF only on Docsity!

Data: Data is any kind of information we collect.

  • It can be numbers, words, pictures, or facts.
  • Example: The names of students in a class, their marks, or the weather report. Analysis: Analysis means studying data to understand it better.
  • We look for patterns, trends, or answers in the data.
  • Example: If we check students' marks and find out who scored the highest or lowest, that's analysis. Purpose of Data Analysis: The main purpose of data analysis is to turn raw information into useful knowledge. Key points:
  • To understand data clearly.
  • To find patterns or trends.
  • To solve problems or answer questions.
  • To support better decisions. Data Science: Data science is the study of data. It uses tools and methods to find patterns(ومنےن) and useful information. It helps in making better decisions using data. Objective of Data Science: The main objective of data science is to understand data and use it to solve problems or make better decisions. Key Points:
  • To collect and organize data.
  • To find patterns and useful information.
  • To predict future trends.
  • To help in making smart decisions. Data Science and Its Scope: Data science is the study of data to find useful information. It is used in many fields to make better decisions. 1. Healthcare: Data science helps doctors study patient data. It improves diagnosis and treatment. 2. Sport: Data science tracks players' performance. It helps in making winning strategies. 3. Finance: Data science studies money-related data. It helps in preventing fraud and managing investments.

4. Goods Transportation: Data science plans the best delivery routes. It saves time and reduces costs. 5. Airline: Data science helps manage flight schedules. It improves ticket pricing and passenger safety. 6. Energy and Utilities: Data science checks energy use patterns. It helps save electricity and reduce waste. 7. Education: Data science studies student progress. It helps teachers improve learning methods. 8. Communication Media: Data science analyzes audience interest. It helps in creating better content. 9. Entertainment: Data science suggests movies, songs, or shows. It improves user experience. 10. Business: Data science studies customer behavior. It helps increase sales and profits. Artificial Intelligence (AI): Artificial Intelligence is the ability of computers or machines to think and act like humans. It helps machines learn, solve problems, and make decisions automatically. Scope of AI: The scope of AI is using intelligent machines to solve problems and make tasks easier. It is applied in healthcare, business, education, transportation, and many other fields. 1. Decision Making: AI analyzes large amounts of data quickly. It helps in making accurate and smart decisions. Example: AI helps banks decide whether to approve a loan. 2. Personalized Recommendation: AI studies user preferences. It suggests products, movies, or content they may like. Example: Netflix recommends movies you might enjoy. 3. Automation Industry: AI controls machines and processes. It reduces human effort and increases efficiency. Example: AI-powered robots assemble cars in factories. 4. Natural Language Processing (NLP): AI helps computers understand human language. It powers chatbots, translators, and voice assistants. Example: Google Translate converts text into another language. 5. Robotics: AI gives robots the ability to think and act. It helps robots perform tasks like humans.

  • Reinforcement Learning: The model learns by trial and error using rewards or penalties. Example: Training a robot to walk. Supervised Learning: Supervised Learning is when a model learns from labeled data, meaning it already knows the correct answers during training. For example , an email spam filter learns from marked emails (spam or not spam) to filter new emails correctly. Unsupervised Learning: Unsupervised Learning is when a model works with unlabeled data and finds hidden patterns on its own. For example, shopping websites group customers with similar buying habits to give better product recommendations. Reinforcement Learning : Reinforcement Learning is when a model learns by trial and error using rewards and penalties. For example , self-driving cars learn to follow traffic rules by getting rewarded for correct actions and penalized for mistakes. Do You Know? TensorFlow is an open-source library created by Google that helps build and train machine learning and deep learning models. It makes it easier for developers to work with large amounts of data and create smart applications. Deep Learning is a part of machine learning that uses multiple layers of algorithms to process data. It helps computers learn complex tasks like image recognition and speech understanding. Neural Network is a system in deep learning designed to work like the human brain. It has layers of connected "neurons" that process data and make decisions, such as recognizing faces in photos. Choosing an appropriate Machine Learning model: It means selecting the best model based on the type of problem and data you have. If the data has labeled answers, Supervised Learning is used (e.g., predicting house prices). If the data has no labels, Unsupervised Learning is chosen (e.g., grouping customers). For tasks that require learning by trial and error, Reinforcement Learning is the best option (e.g., training a robot to walk). The Machine Learning Process: Imagine you want a computer to learn to identify pictures of cats. **Steps:
  1. Training Data:** Collect a large set of images and label them as "cat" or "not cat." 2. Algorithm Selection: Choose a machine learning model (e.g., a neural network) that is good at image recognition.

3. Training: Feed the labeled images to the model. The model learns the visual patterns that distinguish a cat from other objects. 4. Prediction: Show the trained model a new, unlabeled picture. It will use the patterns it learned to predict whether the picture contains a cat. 5. Evaluation: Test the model's predictions against a separate set of labeled images to see how accurate it is. Similarities and differences between AI, ML, and Data Science: Similarities: 1. All three work with data to create smart solutions. 2. All aim to improve decision-making and solve real-world problems. 3. All use programming, math, and algorithms. **Differences:

  1. AI** focuses on making machines think and act like humans, ML teaches machines to learn from data, while Data Science analyzes data to extract useful insights. 2. AI is the broadest field, ML is a part of AI, and Data Science uses AI/ML as tools. 3. AI/ML build smart systems, while Data Science focuses more on understanding and interpreting data. Churn Prediction: Churn prediction means finding out which customers are likely to stop using a product or service. Example: A mobile company uses churn prediction to identify customers who might switch to another network so they can offer discounts to keep them. Behavioral Segmentation: Behavioral segmentation means grouping customers based on how they act or use a product. Example: An online store groups customers who buy sports items often and shows them special sports-related offers. Data Visualization: Data visualization is the process of showing data in a visual form like charts, graphs, or maps. It makes it easier to understand patterns, trends, and comparisons in data. Example: Showing student exam results as a bar chart to quickly see who scored the highest and lowest. Methods of Data Visualization: Data visualization can be done using different methods to represent information clearly: Bar Chart: Shows data using rectangular bars for easy comparison. Example: Comparing sales of different products. Line Chart: Displays data points connected by lines to show trends over time. Example: Tracking monthly website visitors.

2. Categorical Visualization: Shows data divided into groups or categories. It helps to compare parts or proportions. Example: A pie chart showing the market share of different brands. 3. Temporal Visualization: Shows how data changes over time. It is used to track trends or progress. Example: A line graph showing temperature changes throughout the week. 4. Spatial Visualization: Shows data connected to places or locations. It helps to see patterns based on geography. Example: A map showing population density in different cities. 5. Multivariate Visualization: Shows data with several variables at the same time. It helps to see relationships between different factors. Example: A bubble chart showing product sales, profit, and market size together. 6. Interactive Visualization: Shows data that the user can explore or control. It lets users zoom in, filter, or click to find details. Example: A dashboard where you can select a year and see only that year’s data. 7. Statistical Visualization: Shows statistical data like averages, distributions, or probabilities. It explains patterns in data. Example: A box plot showing exam score distributions in a class. 8. Information Visualization: Shows any kind of information in a clear visual form. It simplifies and organizes complex data. Example: A flowchart showing the steps of a process. Uses of Data Visualization: Data visualization is used in almost every field of life, just like Artificial Intelligence, Data Science, and Machine Learning. 1. Business Intelligence: It helps businesses make better decisions using data. It is used to find market trends and track performance to improve results. 2. Healthcare: It helps doctors and researchers see how diseases affect patients. It is also used to track and show the spread of diseases. 3. Education: It makes learning easier by teaching data skills, building concepts, and improving creative and critical thinking. 4. Science and Research: It helps scientists understand and show very large and complex data, such as satellite images and other research data. 5. Sports and Gaming: It helps analyze players’ performance in sports like football or even online games like chess. It is also useful in sports broadcasting and predicting results. 6. Finance: It helps analyze market trends, track investment performance, and find new opportunities for earning money. 7. Entertainment: It helps in studying how movies or shows perform and in predicting future trends. It is also used to improve content by studying audience interests. Advantages/Benefits of Data Visualization: Data visualization has many benefits that make it easier to understand and use data. It helps people who are not technical understand complex data and make better decisions for their business or services. It allows decision-makers to clearly see the data and make smart and strategic choices. It improves the performance of businesses or services by using data effectively. It makes communication easier and helps in understanding data better with clear, real-time visuals. It saves time by quickly identifying patterns and trends. It helps in making fast and accurate decisions compared to manual analysis.

Database and Machine Learning: A database is a collection of organized data stored in tables using software like Oracle, MS-Access, or MySQL. Databases and machine learning are connected because machine learning needs data, and databases store and manage this data so it can be used for training and making predictions. Characteristic Database Machine Learning Data Storage Stores data in structured tables. Uses the same structured data (rows and columns) to train models. Data Preprocessing (^) Data is cleaned and free from duplicates and errors. Needs clean data; bad data reduces model performance. Data Retrieval Easy and fast retrieval using SQL queries. Retrieves data from datasets using simple algorithms. Data Integration Data is integrated and accurate. Requires integrated data for proper training. Scalability Can handle small to very large databases. Needs scalable data for big data applications. Real-time Processing Supports real-time data storage and access. Uses real-time data for online training and updates. Analytical Tools Provides tools like SQL for data analysis. Uses database tools for fast and accurate results. Stages of the Data Science Life Cycle: The data science life cycle is a step-by-step process to solve problems using data. It includes: Stage Explanation Example Problem Definition Identify the main problem or question. Understand what needs to be solved. A company wants to predict which products will sell more next month. Data Collection Gather data from different sources. Make sure the data is useful for the problem. Collect past sales data, customer details, and market trends. Data Cleaning Remove errors, duplicates, and missing values. Prepare clean data for analysis. Fix missing prices, remove duplicate customer records. Data Analysis Study the data to find patterns and insights. Use charts or statistics to understand it. Check which products sell more in summer compared to winter. Data Modeling Build a model using the data. The model helps predict or solve the problem. Create a prediction model to forecast next month’s sales. Model Evaluation Test the model to see how well it works. Make changes if it is not accurate. Compare predicted sales with actual sales to check accuracy. Model Deployment Put the model into real use. Share it so it can give results in real-world situations. Deploy the sales prediction model for the company’s marketing team. Maintenance & Monitoring Keep checking the model’s performance. Update it when data or conditions change. Update the model if customer buying trends change in the next season.

Correct Answer: b) Data security

5. What ethical consideration arises from the integration of Artificial Intelligence (AI) into daily life devices? a) Job displacement due to automation. b) Increased energy consumption. c) Improved customer service. d) Enhanced data security. **Correct Answer: a) Job displacement due to automation.

  1. Which of the following fields of Artificial Intelligence (AI) enables smartphones to recognize faces and unlock devices?** a) NLP b) Computer vision c) Deep learning d) Neural networks **Correct Answer: b) Computer vision
  2. A company wants to develop a system that categorizes customer feedback into positive, negative, or neutral. Which learning model would be most suitable?** a) Supervised learning b) Unsupervised learning c) Reinforcement learning d) Deep learning **Correct Answer: a) Supervised learning
  3. In a Reinforcement Learning model, what is the primary function of rewards and penalties provided as feedback to the agent?** a) Labeling data b) Evaluating performance c) Improving action choices d) Classifying outcomes **Correct Answer: c) Improving action choices
  4. Which stage of the data science life cycle ensures the model's accuracy, reliability, and compliance with privacy rules?** a) Model Deployment b) Model Evaluation c) Data Analysis d) Maintenance and Monitoring **Correct Answer: b) Model Evaluation
  5. Which of the following is the key characteristic of the "Data Cleaning" stage in the data science life cycle?** a) Data collection b) Error removal and data organization c) Pattern Identification d) Model deployment Correct Answer: b) Error removal and data organization Short response questions. Q1. Describe how data science helps businesses make informed decisions and provide two industry examples. Answer: Data science analyzes data to find patterns and trends, helping businesses make better decisions. For example, in retail, it predicts popular products to manage stock. In finance, it checks credit scores to approve safe loans. Q2. Identify three ways data science contributes to machine learning and artificial intelligence. Answer: Data science contributes by cleaning and preparing data (data preprocessing), creating useful new data points (feature engineering), and testing models for accuracy (model evaluation). Q3. Differentiate between supervised learning and unsupervised learning. Answer: Supervised learning uses labeled data and learns from examples, such as classification tasks. Unsupervised learning uses unlabeled data and finds patterns on its own, such as clustering. Q4. Describe an everyday example that illustrates reinforcement learning. Answer: A simple example is teaching a dog tricks. The dog gets a treat for correct actions and learns through rewards and penalties.

5. Write the appropriate machine learning model for each of the following scenarios: Answer: Sr. No. Scenario (^) Suitable Machine Learning Model 1 You have a basket of mixed fruits (apple and banana) and you want a robot/machine to sort them. Supervised Learning (Classification) 2 You are given a task to learn how to ride a bicycle to participate in some sports event. Reinforcement Learning 3 You have pile of Lego blocks of different colors, and you want your computer to group them by colors regardless of their shapes. Unsupervised Learning (Clustering) 4 You have a book with pictures, and you want to teach your sibling to recognize them. Supervised Learning (Classification) 5 You want to train a toy robot to find its way out of maze. Reinforcement Learning 6 Your parents want you to clean your messy room if you want to attend the birthday party of your friend. Reinforcement Learning 7 You have a set of shapes (square, triangle, circle) and you want to teach a computer to recognize them. Supervised Learning (Classification) (^8) You have a book collection without specific categories, and you want your sibling to arrange them according to size, choice or ease of access. Unsupervised Learning (Clustering) 9 You are given a task to find the similarity in various flavors of ice cream. Unsupervised Learning (Clustering) 10 You have to unlock some rewards in your favorite video game. Reinforcement Learning **Extended Response Questions

  1. Analyze the interrelationship between Data Science, Machine Learning, and Artificial Intelligence. Answer:** AI is the main concept of making machines think like humans. ML is a part of AI that uses algorithms to learn from data. Data Science collects, cleans, and analyzes data to give useful insights. Data Science provides data for ML, and ML builds models used in AI. Example: Netflix uses Data Science to collect user data, ML to suggest movies, and AI to create a smart recommendation system. 2. Identify any three types of data visualization, give their applications as well. Answer: A bar chart uses bars to compare data. Example: Comparing monthly sales of products. A line graph shows data changes over time. Example: Tracking temperature changes in a week. A pie chart shows parts of a whole. Example: Showing market share of smartphone brands. 3. Discuss the way data visualization can be used to communicate data uncertainty, provide two specific examples. Answer: Data visualization uses error bars or confidence intervals to show uncertainty, helping people avoid false conclusions. Example 1: Error bars in a student test score chart show the variation of scores. Example 2: A confidence interval in a sales forecast graph shows the possible range of future sales, not just one exact number.