Publications by Amit Kapoor
Data622 - Group2 - Homework4
Overview In this project, we analyze a real-life mental health dataset to provide context around suicide prediction given a variety of unidentifiable demographic data. Our goals are to understand the variables relationships, identify those variables that influence our target, and develop models that can predict a patient’s risk of suicide. App...
22074 sym R (28726 sym/18 pcs) 24 img 4 tbl
Data 609 - Module5
Ex. 1 Carry out the logistic regression (Example 22 on Page 94) in R using the data x 0.1 0.5 1.0 1.5 2.0 2.5 y 0 0 1 1 1 0 The formula is \(y(x) = \frac{1}{1 + exp[-(a + bx)]}\) Solution We will use here glm function with family as binomial to perform logistic regression for given values of x and y. x <- c(0.1, 0.5, 1.0, 1.5, 2.0, 2.5) y <- c...
2367 sym R (4402 sym/18 pcs) 4 img 1 tbl
Data622 - Group2 - Homework3
Overview In this project we will develop models that allow us to predict whether a loan is approved given certain indicators. Models will include linear discriminant analysis, K-nearest neighbor, decision trees, and random forest algorithms and we will assess which performs best at predicting loan approval status through performance statistics. ...
15505 sym R (21026 sym/20 pcs) 18 img 2 tbl
Data 609 - Module4
Ex. 1 For Example 19 on Page 79 in the book, carry out the regression using R. x -0.98 1.00 2.02 3.03 4.00 y 2.44 -1.51 -0.47 2.54 7.52 Solution x <- c(-0.98, 1.00, 2.02, 3.03, 4.00) y <- c(2.44, -1.51, -0.47, 2.54, 7.52) model1 <- lm(y~x) summary(model1) ## ## Call: ## lm(formula = y ~ x) ## ## Residuals: ## 1 2 3 4...
885 sym R (2870 sym/14 pcs) 1 img 3 tbl
Data 609 - Module2
Ex. 1 Show \(x^{2} + exp(x) + 2 x^{4} + 1\) is convex. Solution: A function is considered convex if \(f( \alpha x + \beta y) \leq \alpha f(x) + \beta f(y)\), \(\forall x,y \in \Omega\), \(\alpha \ge 0, \beta \ge 0\), \(\alpha + \beta = 1\) \((\alpha x + \beta y)^{2} + exp(\alpha x + \beta y) + 2 (\alpha x + \beta y)^{4} + 1 \leq \alpha (x^{2} + e...
3587 sym R (539 sym/9 pcs) 1 img
Data 609 - Module1
Ex. 1 Find the minimum of \(f(x,y) = x^2 + xy + y^2 in (x, y) \in \mathbb{R}^2\) Solution: \(f_x(x,y) = \frac{\partial}{\partial x} (x^2 + xy + y^2)\) \(f_y(x,y) = \frac{\partial}{\partial y} (x^2 + xy + y^2)\) Now the stationary conditions are \(\frac{\partial f}{\partial x} = 0\) and \(\frac{\partial f}{\partial y} = 0\) That means \(2x + y = 0...
3067 sym
Data 609 - Module3
Ex. 1 Write down Newton’s formula for finding the minimum of \(f(x) = (3x^{4} - 4x^{3}) / 12\) in the range [-10, 10]. Then, implement it in R. Solution: \(f(x) = (3x^{4} - 4x^{3}) / 12\) \(f'(x) = \frac{12x^{3} - 12x^2}{12} = x^3 - x^2\) \(f''(x) = 3x^2 - 2x\) Using Newton’s formula \(x_{k + 1} = x_{k} - \frac{x_k^{3} - x_k^{2}}{3x_k^{2} - 2...
2049 sym R (1282 sym/9 pcs)
Data 609 - Module6
# Libraries library(class) library(cluster) Ex. 1 Use a data set such as the PlantGrowth in R to calculate three different distance metrics and discuss the results. Solution We will use here PlantGrowth dataset in R and dist() function that gives the distance matrix using specified distance to compute the distances between the rows of distance m...
1508 sym R (40460 sym/42 pcs) 3 img