# xavier data science homework 4

1. Identify all questions that you attempted in this template Q1 Chapter 04 Classification ExamplesPart 1 Review logistic regression in Chapter 4 – Classificationhttps://github.com/JWarmenhoven/ISLR-pythonUse the examples to review 4.3 logistic regression for the ISLR Text
1. Plot Figure 4.1
2. Plot Figure 4.2
3. Table 4.1, 4.2, 4.3
4. Plot Figure 4.3

Hint use – https://nbviewer.jupyter.org/github/JWarmenhoven/ISL-python/blob/master/Notebooks/Chapter%204.ipynb#4.3-Logistic-Regression
Part 2 Application to Caravan Insurance DataÂ¶Use Caravan.csv to apply KNN and Logistic Regression to the Caravan dataHint â€“ use https://nbviewer.jupyter.org/github/JWarmenhoven/ISL-python/blob/master/Notebooks/Chapter%204.ipynb#4.6.5-K-Nearest-NeighborsQ2. Classification Textbook ExamplesUsing the Boston data set, fit classification models in order to predict whether a given suburb has a crime rate above or below the median. Explore logistic regression, and KNN models using various subsets of the predictors. Describe your findings.Hint â€“ use: https://botlnec.github.io/islp/sols/chapter4/exercise13/Q3 Iris Data Set and Classification (iris.csv)The Iris dataset was used in R.A. Fisher’s classic 1936 paper. It includes three iris species with 50 samples each as well as some properties about each flower. One flower species is linearly separable from the other two, but the other two are not linearly separable from each other. The columns in this dataset are:

• Id
• Sepal Length Cm
• Sepal Width Cm
• Petal Length Cm
• Petal Width Cm
• Species
1. Plot the iris dataset â€“ i) â€œSepal Length vs Sepal Widthâ€ ii) â€œPetal Length vs Petal Widthâ€

Split into Training / Test and

1. Apply NaÃ¯ve Bayes Classifier to classify species with the decision boundaries
2. Apply logistic regression to classify species with the decision boundaries
3. Apply KNN algorithm to classify species with the decision boundaries
4. Compare the â€œTruth matrixâ€ and Accuracy of the three algorithms
 TP TN FP FN Accuracy NaÃ¯ve Bayes Logistic Regression KNN

HintNaÃ¯ve Bayes – https://xavierbourretsicotte.github.io/Naive_Bayes_Classifier.htmlLogistic Regression â€“https://scikit-learn.org/stable/auto_examples/linear_model/plot_iris_logistic.htmlhttps://www.datacamp.com/community/tutorials/understanding-logistic-regression-pythonKNN Algorithm â€“https://www.ritchieng.com/machine-learning-k-nearest-neighbors-knn/Q4 Titanic Data Set and Classification (titanic.zip â€“ already separated as test, train)

1. Perform Exploratory Data Analysis
2. Do Feature Engineering
3. Apply logistic regression
4. Apply KNN algorithm

Hinthttps://www.kaggle.com/angps95/basic-classification-methods-for-titanicQ5. How does k-fold cross validation and grid search on the Social Ads Network dataUse the references the explain how the two work together to evaluate a modelhttps://scikit-learn.org/stable/auto_examples/model_selection/plot_grid_search_digits.htmlhttps://sebastianraschka.com/faq/docs/evaluate-a-model.htmltitanic.zip
Q5 k_fold and grid search.zip
ISLR4_1to4_3.py
Iris.csv
Default.xlsx
Caravan.csv
HW04.docx

##### "Looking for a Similar Assignment? Order now and Get 10% Discount! Use Code "Newclient" 