Machine Learning With Python
Machine Learning With Python
– Concept representation.
– Function approximation.
– Overfitting
– Regularization
– Cross-validation
Definition of learning systems
• A computer system that achieves AI through a rule-based technique is called
rule-based system. A computer system that achieves AI through a machine
learning technique is called a learning system.
• Rule-based artificial intelligence systems are immutable objects. On the other
hand, machine learning models are mutable objects that enable enterprises
to transform the data or value by utilizing mutable coding languages such as
java.
• Objects whose value can change are said to be mutable; objects whose
value is unchangeable once they are created are called immutable.
Definition of learning systems
Difference between rule-based AI and machine learning
• A rule-based artificial intelligence produces pre-defined outcomes that are
based on a set of certain rules coded by humans. These systems are simple
artificial intelligence models which utilize the rule of if-then coding
statements. The two major components of rule-based artificial intelligence
models are “a set of rules” and “a set of facts”.
• Machine learning systems are probabilistic and rule-based AI models are
deterministic. Machine learning systems constantly evolve, develop and
adapt its production in accordance with training information streams.
Machine learning models utilize statistical rules rather than a deterministic
approach.
Definition of learning systems
Difference between rule-based AI and machine learning
• The other major key difference between machine learning and rule-based
systems is the project scale. Rule-based artificial intelligence developer
models are not scalable. On the other hand, machine learning systems can be
easily scaled.
• Scale-helps to normalize the data within a particular range.
7. Banking Domain
• Banks are now using the latest advanced technology machine learning has to offer to
help prevent fraud and protect accounts from hackers. The algorithms determine
what factors to consider to create a filter to keep harm at bay. Various sites that are
unauthentic will be automatically filtered out and restricted from initiating
transactions.
Applications
8. Language Translation
• One of the most common machine learning applications is language
translation. Machine learning plays a significant role in the translation of one
language to another. We are amazed at how websites can translate from
one language to another effortlessly and give contextual meaning as well.
The technology behind the translation tool is called ‘machine translation.’ It
has enabled people to interact with others from all around the world;
without it, life would not be as easy as it is now. It has provided confidence
to travelers and business associates to safely venture into foreign lands with
the conviction that language will no longer be a barrier.
Definition of learning systems
• But machine learning comes with disadvantages. First and foremost, it can
be expensive. Machine learning projects are typically driven by data
scientists, who command high salaries. These projects also require
software infrastructure that can be expensive.
• There is also the problem of machine learning bias. Algorithms trained on
data sets that exclude certain populations or contain errors can lead to
inaccurate models of the world that, at best, fail and, at worst, are
discriminatory. When an enterprise bases core business processes on
biased models it can run into regulatory and reputational harm.
Definition of learning systems
How machine learning works
• A Decision Process: In general, machine learning algorithms are used to
make a prediction or classification. Based on some input data, which can
be labeled or unlabeled, your algorithm will produce an estimate about a
pattern in the data.
• An Error Function: An error function evaluates the prediction of the
model. If there are known examples, an error function can make a
comparison to assess the accuracy of the model.
• A Model Optimization Process: If the model can fit better to the data
points in the training set, then weights are adjusted to reduce the
discrepancy between the known example and the model estimate. The
algorithm will repeat this “evaluate and optimize” process, updating
weights autonomously until a threshold of accuracy has been met.
Definition of learning systems
Selecting an Approach
• The decision whether to go for a rule-based system or learning system
depends on the problem you want to solve, and it’s always a trade-off
among efficiency, training costs, and understanding. As stated above,
rule-based systems as well as learning systems are implemented by
concrete techniques (algorithms). These terms are just umbrella terms,
each representing a set of various specific techniques.
Definition of learning systems
Selecting an Approach
• For example, learning systems are implemented by machine learning
techniques, whereas the term “machine learning” itself is again a
collective title for a variety of techniques, such as deep machine
learning (which implements neural nets), reinforcement learning, genetic
algorithms, decision tree learning, support vector machines, and many
(many) more. So, there is no single machine learning technique. The rule-
based category is also just a suitcase word for a bunch of techniques
(e.g., optimization techniques).
Definition of learning systems
Designing a learning system
• “Machine Learning enables a Machine to Automatically learn from Data,
Improve performance from an Experience and predict things without
explicitly programmed.”
• When we fed the Training Data to Machine Learning Algorithm, this
algorithm will produce a mathematical model and with the help of the
mathematical model, the machine will make a prediction and take a
decision without being explicitly programmed.
Machine Learning
What is Training Data?
• Machine learning uses algorithms to learn from data in datasets. They find
patterns, develop understanding, make decisions, and evaluate those decisions.
• In machine learning, datasets are split into two subsets.
The first subset is known as the training data - it’s a portion of our actual dataset
that is fed into the machine learning model to discover and learn patterns. In this
way, it trains our model.
• The other subset is known as the testing data. We’ll cover more on this below.
Machine Learning
• Training data is typically larger than testing data. This is because we want to feed the model
with as much data as possible to find and learn meaningful patterns. Once data from our
datasets are fed to a machine learning algorithm, it learns patterns from the data and makes
decisions.
• Algorithms enable machines to solve problems based on past observations. Kind of like
learning from example, just like humans. The only difference is that machines require a lot
more examples in order to be able to see patterns and learn.
• As machine learning models are exposed to more relevant training data, the more they
improve over time.
Machine Learning
• Your training data will vary depending on what type of machine learning
you’re using: supervised or unsupervised.
• To summarize: Your training data is a subset of your dataset that you use
to teach a machine learning model to recognize patterns or perform your
criteria.
Machine Learning
What is Testing Data?
• Once your machine learning model is built (with your training data), you
need unseen data to test your model. This data is called testing data, and
you can use it to evaluate the performance and progress of your
algorithms’ training and adjust or optimize it for improved results.
• Testing data has two main criteria. It should:
• In data science, it’s typical to see your data split into 80% for training and 20%
for testing.
Machine Learning
What is Testing Data?
• Like we said above, this dataset needs to be new, “unseen” data. This is
because your model already “knows” the training data. How it performs on new
test data will let you know if it’s working accurately or if it requires more
training data to perform to your specifications.
• In data science, it’s typical to see your data split into 80% for training and 20%
for testing.
Machine Learning
What is Testing Data?
• Like we said above, this dataset needs to be new, “unseen” data. This is
because your model already “knows” the training data. How it performs on new
test data will let you know if it’s working accurately or if it requires more
training data to perform to your specifications.
• In data science, it’s typical to see your data split into 80% for training and 20%
for testing.
Definition of learning systems
Designing a learning system
• Example : In Driverless Car, the training data is fed to Algorithm like how
to Drive Car in Highway, Busy and Narrow Street with factors like speed
limit, parking, stop at signal etc. After that, a Logical and Mathematical
model is created on the basis of that and after that, the car will work
according to the logical model. Also, the more data the data is fed the
more efficient output is produced.
Definition of learning systems
Designing a learning system
• “A computer program is said to learn from experience E with respect to
some class of tasks T and performance measure P, if its performance at
tasks in T, as measured by P, improves with experience E’’.
• Example: In Spam E-Mail detection,
The concept of the overfitting can be understood by the below graph of the
linear regression output:
Overfitting and Underfitting in Machine Learning
Overfitting:
• As we can see from the above graph, the model tries to cover all the data
points present in the scatter plot. It may look efficient, but in reality, it is
not so. Because the goal of the regression model to find the best fit line,
but here we have not got any best fit, so, it will generate the prediction
errors.