"No one is harder on a talented person than the person themselves" - Linda Wilkinson ; "Trust your guts and don't follow the herd" ; "Validate direction not destination" ;

September 13, 2015

Central Limit Theorem


Normal Distribution



Standard Normal Distribution - Mean = 0, Variance = 1

Distribution approaches to normal distribution for larger set of variables. 

"As n increases, the distribution of sample mean approaches normal distribution"

Central Limit Theorem - Almost all measurable "random" variables in real world follow some kind of normal distribution.

Good Link

"Sampling distribution of the sampling means approaches a normal distribution as the sample size gets larger"

"Average of your sample means will be the population mean"




Happy Learning!!!

September 09, 2015

Linear Algebra Playlist

Linear Algebra and Calculus basics Playlist bookmarked based on reference from my colleague

Pauls Online Calculus Notes

MIT Linear Algebra Playlist



Linear Algebra


Calculus



Linear Regression Basics

To Understand Linear Regression basics of Slope, Correlation was useful.

Slope Revision

Finding the slope of a line from its graph: Slope of a line


Slope = Change in Y / Change in X
Slope is constant for a line

Simple Linear Regression

  • One Explanatory Variable Simple Regression
  • More than one Explanatory Variable multiple Regression
  • X - Independant Variable(Explanatory), Y - Dependant Variable (Response)
  • Good fitting line (Reasonable for predicting relationship) - Measure of Strength of Relationship (Co-relation)
  • Correlation - A & B are observed at Same time
  • Methods of Least Squares to estimate B0 and B1
  • Residual = Observed - Predicted value (Above Line +ve, Below Line -ve)
Reference Videos

September 07, 2015

Covariance and Correlation - Random Variable - Probability


This video was useful to understand the covariance and correlation relationship


Happy Learning!!!

Working with R - InterQuartile Range

Concept - IQR - InterQuartile Range

IQR = Q3 - Q1 = 3rd Quartile - 1st Quartile
  • Median - Arrange data from lowest to highest
  • On Even dataset - Average of two most middle numbers
  • On Odd dataset - Single Number that is halfway into the set
Dataset - 5,6,12,13,15,18,22,50

Q2 = (13+15)/2 = 14 - Median of Data Value

Q1 = (6+12)/2 = 9 - Median Before Q2

Q3 = (18+22)/2 = 20 - Median After Q2

IQR = Q3-Q1 = 20-9 = 11

BoxPlot is used to identify outliers

For Above Dataset
  • Minimum Value - 5
  • Q1 - 9
  • Q2 - 14
  • Q3 - 20
  • Maximum Value - 50
This is the mathematical concept. This is used for finding outliers.

Outlier - Much larger or smaller than other values in data set. IQR obtained by subtracting third vs first quartile. 

Finding Outliers
1. Any value < Q1-1.5(IQR) or > Q3+1.5(IQR) is an outlier
2. Any Value < (9-1.5(11)) = -7.5
    Any Value > 20+1.5(11) = 20+16.5 = 36.5

This Video was useful to understand the concept before trying out in R


Computing using R

IQR between 25th percentile and the 75th

dataset <-c( 5,6,12,13,15,18,22,50 )
quantile(x=dataset, probs= c(.25,.75))
IQR(x=dataset)
boxplot(dataset)

Sample Output


Outlier highlighted in circles

Happy Learning!!!

September 06, 2015

Class 3 - Statistics Notes

This was mostly on probability distribution functions. Couple of one liners from session

Conditional Probability Distribution - Value of one random variable not impacting another then random variables are independent

Variance - How many values < mean and > mean

Covariance - If X and Y are two independent variables Covariance is zero
Correlation Values between -1 and 1
Correlation
Probability "Chebyshev Inequality"
Chebyshev Inequality - For computing mean for specific region (Integrated over smaller region). Probability in tail for any random variable.



Related Reads
Happy Learning!!!

September 03, 2015

R Basic Examples

Listed below are couple of basic examples working from R Console

Example 1 - Set and get working directory
Example 2 - Read from Data Files

Example 3 - Count row and columns in data

Example 4 - Functions

Example 5 - Plotting



Happy Learning!!!

August 30, 2015

Video Analytics Class 2

My Notes
  • Linear Filter - Linear combination of neighbours
  • Box filter - All values constant [1's]
  • Corr-relation - Masked and Moved across Image
  • Gradient  - due to surface normal discontinuity, depth discontinuity, illumination discontinuity
  • LOG - Laplace of Gaussian. LOG capable of finding edges
  • Salt and Pepper Image - Image has random black and white 
Basics
  • Represent Image as a Matrix
  • Represent Image as a function
  • Point, local operations, histogram equalization, moving average model
  • Cross Correlation g = H X F
  • Gaussian filter (Removes High frequency, blurring, smoothens image)
  • Symmetric Matrix (When you shift rows into columns it would appear the same ( aij = aji, for all indices i and j) example link 
Convolution Basics
Programmatic Walkthru - link

From link 
From link

From Link
FFT

Convolution Applications
  • Smoother image
  • Gaussian (Point spread function)
  • Different Kinds of filter (Box, Gaussian filter)

Cross Correlation - Assess how similar are two different functions. Compares position by position. 
Correlation Walkthru

From Link 

Mathematics concepts to learn
  • Vector Product
  • Eigen Value decomposition
  • First Derivative, Second Derivative
Vertical and horizontal edge detection filters - Sobel, Roberts, Prewitt (Veritical, Horizontal, Diagonal edge detection filters).

Good Read Link
MIT Course Slides link

Related Reads







Happy Learning!!!

August 25, 2015

OpenCV Python Basics

Basic image loading modules

Example #1

import cv2
import numpy as np
from matplotlib import pyplot as plt
#Load Image
source = cv2.imread('D:\images\Benz.png')

Ref - Link

Example #2

#Printing width and height of image
import cv2
import numpy as np
from matplotlib import pyplot as plt

#Load Image
source = cv2.imread('D:\images\Benz.png')
print source.shape

#Output Number of Rows / Columns
rowCount = source.shape[0]
columnCount = source.shape[1]
print rowCount, columnCount

Ref - Link

Example #3
#Drawing Histogram

import cv2
import numpy as np
from matplotlib import pyplot as plt

#Load Image
source = cv2.imread('D:\images\Benz.png')

# Image, Channel
# Channels - grayscale image - [0], RGB - 0,1,2
# Mask - Supplied None as FULL Region Needed
# histSize - Bin Size
# ranges - 0 to 256
hist = cv2.calcHist([source], [0], None, [256], [0,256])
plt.plot(hist)
plt.show()

Happy Learning!!!

August 24, 2015

SettingUp OpenCV and Python

Reference Steps - Link

1. Download and Install python from link. Install with Default Settings
2. Download and Install MatPlot Lib (Link in reference steps are fine)
3. Download and Install OpenCV executable. Extract it to C:\OpenCV location
4. Now All Installations are located in C:\
5. Open Python IDLE from program files. In win7 run-it-as admin to open Program Files ->Python IDLE
6. Copy File from below location
      From - C:\OpenCV\opencv\build\python\2.7\x86\cv2.pyd
      To - C:\Python27\Lib\site-packages
7. Got the Error Link
8. Download and install numpy from link (Link provided 1.7 of numpy is incorrect. You need 1.9.2)
9. Validating installation steps

Happy Learning!!!