#### Overview of this book

Machine learning applications are highly automated and self-modifying, and continue to improve over time with minimal human intervention, as they learn from the trained data. To address the complex nature of various real-world data problems, specialized machine learning algorithms have been developed. Through algorithmic and statistical analysis, these models can be leveraged to gain new knowledge from existing data as well. Data Science Algorithms in a Week addresses all problems related to accurate and efficient data classification and prediction. Over the course of seven days, you will be introduced to seven algorithms, along with exercises that will help you understand different aspects of machine learning. You will see how to pre-cluster your data to optimize and classify it for large datasets. This book also guides you in predicting data based on existing trends in your dataset. This book covers algorithms such as k-nearest neighbors, Naive Bayes, decision trees, random forest, k-means, regression, and time-series analysis. By the end of this book, you will understand how to choose machine learning algorithms for clustering, classification, and regression and know which is best suited for your problem
Title Page
Packt Upsell
Contributors
Preface
Free Chapter
Classification Using K-Nearest Neighbors
Time Series Analysis
Python Reference
Statistics
Glossary of Algorithms and Methods in Data Science
Other Books You May Enjoy
Index

## Basic concepts

Notation

A set intersection of two sets, A and B, denoted by A ∩ B, is a subset of A or B that contains all elements that are in both A and B. In other words, A ∩ B := { x : x in A and x in B}.

A set union of two sets, A and B, denoted by A ∪ B, is a set that contains precisely the elements that are in A or in B. In other words, A ∪ B := { x : x in A or x in B}.

A set difference of two sets, A and B, denoted by A – B or A\B, is a subset of A that contains all elements in A that are not in B. In other words, A – B := { x : x in A and x not in B}.

The summation symbol, ∑, represents the sum of all members over the set, for example:

Definitions and terms

• Population: A set of similar data or items subject to analysis.
• Sample: A subset of the population.
• Arithmetic mean (average) of a set: The sum of all the values in the set divided by the size of the set.
• Median: The middle value in an ordered set, for example, the median of the set {x1, …, x2k+1}, where x1 <…< x2k+1 is the value xk+1.
• Random variable: A function from a set of possible outcomes (for example, heads or tails) to a set of values (for example, 0 for heads and 1 for tails).
• Expectation: An expectation of a random variable is the limit of the average values of the increasing sets of the values given by the random variable.
• Variance: Measures the dispersion of the population from its mean. Mathematically, the variance of a random variable, X, is the expected value of the square of the difference between the random variable and the mean μ of X, that is,
.
• Standard deviation: The deviation in the random variable, X, is the square root of the variation in the X variable, that is,
.
• Correlation: The measure of the dependency between the random variables. Mathematically, for the random variables X and Y, the correlation is defined as
.
• Causation: A dependence relation explaining the occurrence of one phenomenon through the occurrence of another phenomenon. Causation implies correlation, but not vice versa!
• Slope: The a variable in the linear equation y=a*x+b.
• Intercept: The b variable in the linear equation y=a*x+b.