Learn practical skills, build real-world projects, and advance your career
#Setting working directory
import os
os.chdir('E:\\Imarticus\\DSP17\\final')
print (os.getcwd())
E:\Imarticus\DSP17\final
# Import necessary libraries
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
import seaborn as sns
%matplotlib inline
from IPython.display import Image
#------------#
# Some Basics
#------------#

# kNN and Decision Trees are believed to be two most simple and intuitive Algos
# They are simple to understand and easy to explain

# KNN can be used for both classification and regression predictive problems.
    # Find k Nearest Neighbors and take the majority vote or average as applicable
# If you would like to substitute a missing value, (whether continuous or
# Categorical) kNN might work best in some cases
# It is also very useful in building recommender systems

# kNN is also called a Lazy Learner
# A lazy learner, on the other hand, does not build any model beforehand; it waits for 
# the unclassified data and then winds it way through the algorithm to make classification 
# prediction. Lazy learners are, therefore, time consuming–each time a prediction is to be 
# made all the model building effort has to be performed again. We will see!

# KNN algorithm fairs across all parameters of considerations. 
# It is commonly used for its easy of interpretation and low calculation time.
# See below:
Image('KNN comparison.png')
Notebook Image