top of page

Machine Learning Assign.-1 BCA sem-5

Subject: Machine Learning

Assignment: 1 (BCA Sem-5)

Unit: 1 Introduction to Machine Learning



1. Define machine learning and explain how it differs from traditional programming.

Ans. Machine Learning is a branch of artificial intelligence that develops algorithms by learning the hidden patterns of the datasets used it to make predictions on new similar type data, without being explicitly programmed for each task.


Traditional Machine Learning combines data with statistical tools to predict an output that can be used to make actionable insights.


Machine learning is used in many different applications, from image and speech recognition to natural language processing, recommendation systems, fraud detection, portfolio optimization, automated task, and so on. Machine learning models are also used to power autonomous vehicles, drones, and robots, making them more intelligent and adaptable to changing environments.


A typical machine learning tasks are to provide a recommendation. Recommender systems are a common application of machine learning, and they use historical data to provide personalized recommendations to users. In the case of Netflix, the system uses a combination of collaborative filtering and content-based filtering to recommend movies and TV shows to users based on their viewing history, ratings, and other factors such as genre preferences.

Machine Learning

Traditional Programming

Machine Learning is a subset of artificial intelligence(AI) that focus on learning from data to develop an algorithm that can be used to make a prediction.

In traditional programming, rule-based code is written by the developers depending on the problem statements.

Machine Learning uses a data-driven approach, It is typically trained on historical data and then used to make predictions on new data.

Traditional programming is typically rule-based and deterministic. It hasn’t self-learning features like Machine Learning and AI.

ML can find patterns and insights in large datasets that might be difficult for humans to discover.

Traditional programming is totally dependent on the intelligence of developers. So, it has very limited capability.

Machine Learning is the subset of AI. And Now it is used in various AI-based tasks like Chatbot Question answering, self-driven car., etc.

Traditional programming is often used to build applications and software systems that have specific functionality.


2. Describe the main type of Machine Learning: Supervised Learning, Unsupervised Learning and Reinforcement Learning. Include one-real world example for each type.

Ans. Types of Machine Learning:

  • Supervised Machine Learning

  • Unsupervised Machine Learning

  • Reinforcement Machine Learning

1. Supervised Machine Learning:

Supervised learning is a type of machine learning in which the algorithm is trained on the labeled dataset. It learns to map input features to targets based on labeled training data. In supervised learning, the algorithm is provided with input features and corresponding output labels, and it learns to generalize from this data to make predictions on new, unseen data.

There are two main types of supervised learning:

  • Regression: Regression is a type of supervised learning where the algorithm learns to predict continuous values based on input features. The output labels in regression are continuous values, such as stock prices, and housing prices. The different regression algorithms in machine learning are: Linear Regression, Polynomial Regression, Ridge Regression, Decision Tree Regression, Random Forest Regression, Support Vector Regression, etc

  • Classification: Classification is a type of supervised learning where the algorithm learns to assign input data to a specific category or class based on input features. The output labels in classification are discrete values. Classification algorithms can be binary, where the output is one of two possible classes, or multiclass, where the output can be one of several classes. The different Classification algorithms in machine learning are: Logistic Regression, Naive Bayes, Decision Tree, Support Vector Machine (SVM), K-Nearest Neighbors (KNN), etc.

2. Unsupervised Machine Learning:

Unsupervised learning is a type of machine learning where the algorithm learns to recognize patterns in data without being explicitly trained using labeled examples. The goal of unsupervised learning is to discover the underlying structure or distribution in the data.

There are two main types of unsupervised learning:

  • Clustering: Clustering algorithms group similar data points together based on their characteristics. The goal is to identify groups, or clusters, of data points that are similar to each other, while being distinct from other groups. Some popular clustering algorithms include K-means, Hierarchical clustering, and DBSCAN.

  • Dimensionality reduction: Dimensionality reduction algorithms reduce the number of input variables in a dataset while preserving as much of the original information as possible. This is useful for reducing the complexity of a dataset and making it easier to visualize and analyze. Some popular dimensionality reduction algorithms include Principal Component Analysis (PCA), t-SNE, and Autoencoders.

3. Reinforcement Machine Learning:

Reinforcement learning is a type of machine learning where an agent learns to interact with an environment by performing actions and receiving rewards or penalties based on its actions. The goal of reinforcement learning is to learn a policy, which is a mapping from states to actions, that maximizes the expected cumulative reward over time.

There are two main types of reinforcement learning:

  • Model-based reinforcement learning: In model-based reinforcement learning, the agent learns a model of the environment, including the transition probabilities between states and the rewards associated with each state-action pair. The agent then uses this model to plan its actions in order to maximize its expected reward. Some popular model-based reinforcement learning algorithms include Value Iteration and Policy Iteration.

  • Model-free reinforcement learning: In model-free reinforcement learning, the agent learns a policy directly from experience without explicitly building a model of the environment. The agent interacts with the environment and updates its policy based on the rewards it receives. Some popular model-free reinforcement learning algorithms include Q-Learning, SARSA, and Deep Reinforcement Learning.


3. Explain the steps involved in the machine learning modeling flow.

Briefly describe each step.

Ans. Machine learning life cycle involves seven major steps, which are given below:

1. Gathering Data:

Data Gathering is the first step of the machine learning life cycle. The goal of this step is to identify and obtain all data-related problems.

In this step, we need to identify the different data sources, as data can be collected from various sources such as files, database, internet, or mobile devices. It is one of the most important steps of the life cycle. The quantity and quality of the collected data will determine the efficiency of the output. The more will be the data, the more accurate will be the prediction.

This step includes the below tasks:

  • Identify various data sources

  • Collect data

  • Integrate the data obtained from different sources

By performing the above task, we get a coherent set of data, also called as a dataset. It will be used in further steps.


2. Data preparation:

After collecting the data, we need to prepare it for further steps. Data preparation is a step where we put our data into a suitable place and prepare it to use in our machine learning training.

In this step, first, we put all data together, and then randomize the ordering of data.

This step can be further divided into two processes:

Data exploration: It is used to understand the nature of data that we have to work with. We need to understand the characteristics, format, and quality of data. A better understanding of data leads to an effective outcome. In this, we find Correlations, general trends, and outliers.

Data pre-processing: Now the next step is preprocessing of data for its analysis.


3. Data Wrangling:

Data wrangling is the process of cleaning and converting raw data into a useable format. It is the process of cleaning the data, selecting the variable to use, and transforming the data in a proper format to make it more suitable for analysis in the next step. It is one of the most important steps of the complete process. Cleaning of data is required to address the quality issues.

It is not necessary that data we have collected is always of our use as some of the data may not be useful. In real-world applications, collected data may have various issues, including:

  • Missing Values

  • Duplicate data

  • Invalid data

  • Noise

So, we use various filtering techniques to clean the data.

It is mandatory to detect and remove the above issues because it can negatively affect the quality of the outcome.


4. Data Analysis:

Now the cleaned and prepared data is passed on to the analysis step. This step involves:

  • Selection of analytical techniques

  • Building models

  • Review the result

The aim of this step is to build a machine learning model to analyze the data using various analytical techniques and review the outcome. It starts with the determination of the type of the problems, where we select the machine learning techniques such as Classification, Regression, Cluster analysis, Association, etc. then build the model using prepared data, and evaluate the model.


5. Train Model:

Now the next step is to train the model, in this step we train our model to improve its performance for better outcome of the problem.

We use datasets to train the model using various machine learning algorithms. Training a model is required so that it can understand the various patterns, rules, and, features.


6. Test Model:

Once our machine learning model has been trained on a given dataset, then we test the model. In this step, we check for the accuracy of our model by providing a test dataset to it.

Testing the model determines the percentage accuracy of the model as per the requirement of project or problem.


7. Deployment:

The last step of machine learning life cycle is deployment, where we deploy the model in the real-world system.

If the above-prepared model is producing an accurate result as per our requirement with acceptable speed, then we deploy the model in the real system. But before deploying the project, we will check whether it is improving its performance using available data or not. The deployment phase is similar to making the final report for a project.


4. Compare and contrast Supervised Learning and Unsupervised Learning. How do they differ in terms of data, training process, and typical use cases?

Ans.

SUPERVISED LEARNING

UNSUPERVISED LEARNING

Input Data

Uses Known and Labeled Data as input

Uses Unknown Data as input

Computational Complexity

Less Computational Complexity

More Computational Complex

Real Time

Uses off-line analysis

Uses Real Time Analysis of Data

Number of Classes

Number of Classes are known

Number of Classes are not known

Accuracy of Results

Accurate and Reliable Results

Moderate Accurate and Reliable Results

Output data

Desired output is given.

Desired output is not given.

Model

In supervised learning it is not possible to learn larger and more complex models than with supervised learning

In unsupervised learning it is possible to learn larger and more complex models than with unsupervised learning

Training data

In supervised learning training data is used to infer model

In unsupervised learning training data is not used.

Another name

Supervised learning is also called classification.

Unsupervised learning is also called clustering.

Test of model

We can test our model.

We can not test our model.

Example

Optical Character Recognition

Find a face in an image.


5. What is Reinforcement Learning? Provide an example scenario where reinforcement learning could be applied.

Ans. Reinforcement learning is an area of Machine Learning. It is about taking suitable action to maximize reward in a particular situation. It is employed by various software and machines to find the best possible behavior or path it should take in a specific situation. Reinforcement learning differs from supervised learning in a way that in supervised learning the training data has the answer key with it so the model is trained with the correct answer itself whereas in reinforcement learning, there is no answer but the reinforcement agent decides what to do to perform the given task. In the absence of a training dataset, it is bound to learn from its experience.


Reinforcement Learning (RL) is the science of decision making. It is about learning the optimal behavior in an environment to obtain maximum reward. In RL, the data is accumulated from machine learning systems that use a trial-and-error method. Data is not part of the input that we would find in supervised or unsupervised machine learning.


Reinforcement learning uses algorithms that learn from outcomes and decide which action to take next. After each action, the algorithm receives feedback that helps it determine whether the choice it made was correct, neutral or incorrect. It is a good technique to use for automated systems that have to make a lot of small decisions without human guidance.


Reinforcement learning is an autonomous, self-teaching system that essentially learns by trial and error. It performs actions with the aim of maximizing rewards, or in other words, it is learning by doing in order to achieve the best outcomes.


Types of Reinforcement:

There are two types of Reinforcement:

  1. Positive: Positive Reinforcement is defined as when an event, occurs due to a particular behavior, increases the strength and the frequency of the behavior. In other words, it has a positive effect on behavior.

  2. Negative: Negative Reinforcement is defined as strengthening of behavior because a negative condition is stopped or avoided.

Example:

The problem is as follows: We have an agent and a reward, with many hurdles in between. The agent is supposed to find the best possible path to reach the reward. The following problem explains the problem more easily.

The above image shows the robot, diamond, and fire. The goal of the robot is to get the reward that is the diamond and avoid the hurdles that are fired. The robot learns by trying all the possible paths and then choosing the path which gives him the reward with the least hurdles. Each right step will give the robot a reward and each wrong step will subtract the reward of the robot. The total reward will be calculated when it reaches the final reward that is the diamond.


Main points in Reinforcement learning –

  • Input: The input should be an initial state from which the model will start

  • Output: There are many possible outputs as there are a variety of solutions to a particular problem

  • Training: The training is based upon the input, The model will return a state and the user will decide to reward or punish the model based on its output.

  • The model keeps continues to learn.

  • The best solution is decided based on the maximum reward.


6. List and briefly explain three challenges that machine learning faces. How might these challenges impact the accuracy and effectiveness of machine learning models? Ans. we will discuss seven major challenges faced by machine learning professionals. Let’s have a look.


1. Poor Quality of Data:

Data plays a significant role in the machine learning process. One of the significant issues that machine learning professionals face is the absence of good quality data. Unclean and noisy data can make the whole process extremely exhausting. We don’t want our algorithm to make inaccurate or faulty predictions. Hence the quality of data is essential to enhance the output. Therefore, we need to ensure that the process of data preprocessing which includes removing outliers, filtering missing values, and removing unwanted features, is done with the utmost level of perfection.


2. Underfitting of Training Data:

This process occurs when data is unable to establish an accurate relationship between input and output variables. It simply means trying to fit in undersized jeans. It signifies the data is too simple to establish a precise relationship. To overcome this issue:

  • Maximize the training time

  • Enhance the complexity of the model

  • Add more features to the data

  • Reduce regular parameters

  • Increasing the training time of model

3. Machine Learning is a Complex Process:

The machine learning industry is young and is continuously changing. Rapid hit and trial experiments are being carried on. The process is transforming, and hence there are high chances of error which makes the learning complex. It includes analyzing the data, removing data bias, training data, applying complex mathematical calculations, and a lot more. Hence it is a really complicated process which is another big challenge for Machine learning professionals.


4. Slow Implementation:

This is one of the common issues faced by machine learning professionals. The machine learning models are highly efficient in providing accurate results, but it takes a tremendous amount of time. Slow programs, data overload, and excessive requirements usually take a lot of time to provide accurate results. Further, it requires constant monitoring and maintenance to deliver the best output.





BEST OF LUCK

69 views2 comments

Recent Posts

See All

2 Comments

Rated 0 out of 5 stars.
No ratings yet

Add a rating
Guest
Jul 31, 2023
Rated 4 out of 5 stars.

👍👍

Like

Guest
Jul 31, 2023
Rated 5 out of 5 stars.

Nice Work

Like

Connect To Me 

  • YouTube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter
  • Pinterest
bottom of page