MACHINE LEARNING

MACHINE LEARNING

Machine Learning from the basics

 

Machine Learning from the basics

Introduction of the Topic

Basically, ML focuses on creating and innovating applications that learn from the information and data we provide as input and tend to enhance their accuracy over a period of time without being ordered to do so.

No alt text provided for this image

We gather some data, and then we train our computer with that information collected, and according to that, we make a model, and afterwards we predict various scenarios.

Machine Learning is used in:

1. Virtual Personal Assistants

2. Predictions while Commuting

3. Videos Surveillance

4. Social Media Services

5. Email Spam and Malware Filtering

6. Online Customer Support

7. Search Engine Result Refining

8. Product Recommendations

9. Online Fraud Detection

10. Self Driving Cars

Types of Machine Learning:

  1. Unsupervised Learning
  2. Supervised Learning
  3. Reinforced Learning

Ecosystem of Python for Machine Learning:

Python is a powerful, dynamic, object-oriented and high-level programming language. It is the fantastic companion for ML.

Some of the essential components of the Python environment for ML are:

●    Jupyter Notebook

●    NumPy

●    Pandas

●    Scikit-learn.

Jupyter Notebook provides us an immersive framework for designing Python-based data science applications that lets us anticipate our model.

NumPy essentially stands for Numerical Python and consists of multi-D array objects that help us perform algebraic, arithmetic, and logical operations o the dataset.

Pandas is used for manipulation and interpretation of data. It’s done in five steps: Load, Plan, Control, Model, and Evaluate.

Scikit-Learn is used to apply a broad variety of ML algorithms covering core areas such as grouping, regression, dimensional reduction, sample collection, clustering.

No alt text provided for this image


Machine Learning in Python:

Lists: Python lists are one of the most flexible array object types available. The other two forms are dictionaries and tuples, but they are much like list combinations.

Python lists do the function of most of the data collection structures used in other languages, and because they are built-in, you don’t have to think about building them manually. Lists can be used with any form of entity, from numbers and strings to several lists.

In fact, the Python lists are C arrays within the Python interpreter, behaving like a collection of pointers. There are various Functions that can be carried out on lists like append(), extend(), reverse(), pop() etc.

example: [1, ‘a’, ‘string’, 3, 6]

Tuple: Tuple : Python tuples work exactly like Python lists except they are immutable, i.e. they can’t be changed in place. The position has improved. In order to differentiate them from lists (which use square brackets), they are usually written in parentheses, although as you can see, parentheses are not necessarily necessary. Their length is set because tuples are immutable. For a tuple to expand or shrink, a new tuple must be formed.

example: (1, ‘a’, ‘string’, 3, 6)

Dictionary: In python, dictionary is similar to hash or maps in other languages. It consists of key value pairs. The value can be accessed by unique key in the dictionary.

●    Keys are unique & immutable objects.

●    Syntax:

dictionary = {“key name”: value}

Sets: Unordered unique items’ collection.

It is possible to apply set operations such as union (|)-, intersection(&), difference(-) on a set.

Sets are immutable, i.e. they can not be inserted until new data has been generated.

() are used to represent a set. Objects that are put inside these brackets are viewed as a set.

set1 = {“apple”, “banana”, “cherry”}

Function: A function is a block of code which only runs when it is called.You can pass data, known as parameters, into a function. A function can return data as a result. It helps in carrying out a specific task with or without multiple values of input.

Keyword def that marks the start of the function header.

def my_function():

 print(“Hello from a function”)

my_function()

Python Condition Statement(if…else): An else statement can be combined with an if statement. An else statement contains the block of code that executes if the conditional expression in the if statement resolves to 0 or a FALSE value.

The else statement is an optional statement and there could be at most only one else statement following if.

if expression:

 statement(s)

else:

 statement(s)

For Loop: A for loop is used for iterating over a sequence (that is either a list, a tuple, a dictionary, a set, or a string).

This is less like the for keyword in other programming languages, and works more like an iterator method as found in other object-orientated programming languages.

fruits = [“orange”, “papaya”, “cherry”]

for x in fruits:

 print(x)

Statistics :-

Statistics is interpreting data in order to make predictions for the population.

Branches of Statistics:

- DESCRIPTIVE STATISTICS : Descriptive Statistics is a statistics or a measure that describes the data.  

- INFERENTIAL STATISTICS : Using a random sample of data taken from a population to describe and make inferences about the population is called Inferential Statistics.

Classification Problem :

A classification problem is when the output variable is a category, such as “red” or “blue” or “disease” and “no disease”. A classification model attempts to draw some conclusion from observed values. Given one or more inputs a classification model will try to predict the value of one or more outcomes.

For example, when filtering emails “spam” or “not spam”, when looking at transaction data, “fraudulent”, or “authorized”. In short Classification either predicts categorical class labels or classifies data (construct a model) based on the training set and the values (class labels) in classifying attributes and uses it in classifying new data. There are a number of classification models. 

Classification models includes:

- Logistic Regression.

- Decision Tree

- Random Forest

- Gradient-boosted tree

- Multilayer perceptron

- Naive Bayes.

What is a Z-Score?

A z-score can be placed on a normal distribution curve. Z-scores range from -3 standard deviations (which would fall to the far left of the normal distribution curve) up to +3 standard deviations (which would fall to the far right of the normal distribution curve). In order to use a z-score, you need to know the mean μ and also the population standard deviation σ.

Z-scores are a way to compare results to a “normal” population. Results from tests or surveys have thousands of possible results and units; those results can often seem meaningless. For example, knowing that someone’s weight is 150 pounds might be good information, but if you want to compare it to the “average” person’s weight, looking at a vast table of data can be overwhelming (especially if some weights are recorded in kilograms). A z-score can tell you where that person’s weight is compared to the average population’s mean weight.


Z Score Formula: Standard Error of the Mean

When you have multiple samples and want to describe the standard deviation of those sample means (the standard error), you would use this z score formula:

z = (x – μ) / (σ / √n)

This z-score will tell you how many standard errors there are between the sample mean and the population mean.

Example problem: In general, the mean height of women is 65″ with a standard deviation of 3.5″. What is the probability of finding a random sample of 50 women with a mean height of 70″, assuming the heights are normally distributed?

  • z = (x – μ) / (σ / √n)
  • = (70 – 65) / (3.5/√50) = 5 / 0.495 = 10.1
No alt text provided for this image



Prabhjeet Singh

Software Engineer @ FinSpectra | Platform Developer-1 Certified Salesforce Developer | Salesforce QA Tester

4 年

Great Ishika Jain

要查看或添加评论,请登录

社区洞察

其他会员也浏览了