Posts

Showing posts with the label data science

Hypothesis Testing - Statistics

  1. What is Hypothesis Testing and when do we use it? Hypothesis testing is a part of statistical analysis, where we test the assumptions made regarding a population parameter. It is generally used when we were to compare: a single group with an external standard two or more groups with each other A  Parameter  is a number that describes the data from the  population  whereas, a  Statistic  is a number that describes the data from a  sample . 2. Terminology used Null Hypothesis:  Null hypothesis is a statistical theory that suggests there is no statistical significance exists between the populations. Alternative Hypothesis:  An Alternative hypothesis suggests there is a significant difference between the population parameters. It could be greater or smaller. Basically, it is the contrast of the Null Hypothesis. Note: H 0  must always contain equality(=). H a  always contains difference( ≠,  >, <). For example, if we...

Z Score - Normal Distribution

 -> We are going to have a deep discussion on the Z score. But right before that, we need to understand what a normal distribution and a standard normal distribution are. What is a distribution? A distribution in statistics is a function that shows the possible values for a variable and how often they occur. it may occur with various different values like age, height, the weight of people. What is a Normal distribution? The normal distribution is a distribution that is symmetric about the mean(mean is nothing but average of all the observations). Most of the observations in the normal distribution are surrounded by the mean. What is a standard normal distribution? The standard normal distribution is a normal distribution whose mean and standard deviation are scaled at 0 and 1 respectively. Z score can only be calculated for the observations which follow a normal distribution. What is a Z score? A Z-score is a numerical measurement that describes a value’s relationship to the mea...

Machine Learning Cross Validation

Image
 There are various pipelines for the machine learning use cases: Data collection, Feature engineering, Feature selection, Model creation, and Model deployment. So always remember before model creation what we do is whenever we have a dataset suppose I have 1000 records we usually perform a train test split saying that Training set has 70% of data and Test set have 30% or 80% train set and 20% test set depends on the count of the dataset. so our model will use 70% of the data to only train the model itself and the remaining 30% we will use to check the accuracy so when we do train test split 70% of data will randomly select and 30% also randomly select so when this kind of random selection happens so the type of data present in the test may not present in train set due to this our model accuracy go down. so whenever we use train test split we usually use random state, It will randomly select the data point so when we take random state=0 then it will shuffle our data and provide accu...

Normalization and Standardization

Suppose if you have any use case, so the most important thing for the use case is data. Initially, you will be collecting the data so if you have collected the data that data have many features so those features may contain independent feature and dependent feature so with the help of the independent we will try to predict dependent feature in supervised machine learning. so when you consider these features this has 2 important properties. 1. Unit   2. Magnitude let's have features like personage, height, weight, etc. so if I consider the feature age the unit basically no of years and the magnitude is basically value.  For Ex: Suppose if I say 25years then 25 is magnitude and years is unit. Each feature is calculated with unit and magnitude so if you have many features so it will get computed with different units. so this unit and magnitude vary between different features. so it is very necessary that for the machine learning algorithm the data we provide that we should try t...

Covariance

Covariance is one of a family of statistical measures used to analyze the linear relationship between two variables. How do two variables behave as PAIR? There are certain terminology like covariance, correlation, linear regression etc.. make confuse how all are related to each other. here linear regression related to correlation which is related to covariance in nature so all this measures analyses by looking with linear relationship between two variables. Covariance is a Descriptive measure of the linear association between two variables that is very simple to interpret. 1. A positive value indicates a direct or increasing linear relationship. 2. A negative value indicates a decreasing relationship. A concept here is the direction that is sign on the covariance whether it is positive or negative For Example, if we have 4 quadrants like (I ,II ,III ,IV) I - (+,+) : represents the both x and y values are positive. II - (-,+) : represents the x is negative and y is positive. III - (-...

Difference Between R square and Adjusted R square

Image
In many of the supervised machine learning problem statement basically we have two kind of use cases. 1.Regression 2.classification For Regression type use case if we want to check accuracy usually we follow the techniques like R square and adjusted R square. In this article we will be discuss about difference between R square and adjusted R square. 1. R square R square formula is given by, = coefficient of determination = sum of square of residuals or error = total sum of square Here residuals are sum of square of difference between actual point and predict point. and for given data if we have only target variable we will find the best fit line by taking average of all the values. so total sum of square of actual points and average value. So from above formula we will get value between 0 and 1, the more value near to 1 is the best fit line.  whether can we get R2 value less than 0? YES, only when your best fit line is worse than average best fit line. If RSS > TSS so ratio beco...

Continuous vs Categorical Variable

  What is Variable? A variable is something that is need to be measured. it is a type of recorded piece of information or characteristic about a person or case or unit in our study. for Example : We might record the age of everyone in our sample and for every one we're recording the age but the age is going to change or vary from person to person so this is kind of the opposite of a constant which is always the same. for the sake of our discussion we have few examples like age , weight , BMI, does someone have disease, yes or no etc.. we summarize and analyze the data depend on type of variable we have.  Type of variables: 1. Independent variable : It is also known as experimental or predictor variable. Independent variable is a variable that is the causes or reason of any situation which can be manipulated. 2. Dependent variable : Dependent variable is something that depends on their factors. It is also known as outcome variable. for Example : Time spent studying causes a c...