Logistic models and ROC
To run your code, click run. It will let you know if your code is correct or not, and will offer hints on what to fix if needed. If you are stuck, you can see the solution by clicking Solution.
Exercise 1: Running a logit regression
This is a continuation of Session_4’s exercises.
eyJsYW5ndWFnZSI6InIiLCJwcmVfZXhlcmNpc2VfY29kZSI6ImxpYnJhcnkoZHBseXIpICMgbG9hZHMgZHBseXIgZm9yIGRhdGEgbWFuaXB1bGF0aW9uXG5kZiA8LSBkYXRhLmZyYW1lKHRpYz1yZXAoXCJXTVRcIiwxOTQpLFxuICAgICAgICAgICAgICAgICBmeWVhcnE9YygxOTcwLDE5NzAsMTk3MCwxOTcwLDE5NzEsMTk3MSwxOTcxLDE5NzEsMTk3MiwxOTcyLDE5NzIsMTk3MiwxOTczLDE5NzMsMTk3MywxOTczLDE5NzQsMTk3NCwxOTc0LDE5NzQsMTk3NSwxOTc1LDE5NzUsMTk3NSwxOTc2LDE5NzYsMTk3NiwxOTc2LDE5NzcsMTk3NywxOTc3LDE5NzcsMTk3OCwxOTc4LDE5NzgsMTk3OCwxOTc5LDE5NzksMTk3OSwxOTc5LDE5ODAsMTk4MCwxOTgwLDE5ODAsMTk4MSwxOTgxLDE5ODEsMTk4MSwxOTgyLDE5ODIsMTk4MiwxOTgyLDE5ODMsMTk4MywxOTgzLDE5ODMsMTk4NCwxOTg0LDE5ODQsMTk4NCwxOTg1LDE5ODUsMTk4NSwxOTg1LDE5ODYsMTk4NiwxOTg2LDE5ODYsMTk4NywxOTg3LDE5ODcsMTk4NywxOTg4LDE5ODgsMTk4OCwxOTg4LDE5ODksMTk4OSwxOTg5LDE5ODksMTk5MCwxOTkwLDE5OTAsMTk5MCwxOTkxLDE5OTEsMTk5MSwxOTkxLDE5OTIsMTk5MiwxOTkyLDE5OTIsMTk5MywxOTkzLDE5OTMsMTk5MywxOTk0LDE5OTQsMTk5NCwxOTk0LDE5OTUsMTk5NSwxOTk1LDE5OTUsMTk5NiwxOTk2LDE5OTYsMTk5NiwxOTk3LDE5OTcsMTk5Nyw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F9jYWxsZWRfbXNnPScnLGluY29ycmVjdF9tc2c9JycpXG4jICAgICAtIHRlc3RfaWZfZWxzZSgpIC0tIGNoZWNraW5nIGlmIHN0YXRlbWVudHNcbiMgICAgIC0gdGVzdF9leHByZXNzaW9uX2Vycm9yKCkgLS0gY2FuIGNoZWNrIGlmIGZ1bmN0aW9ucyBhcmUgcHJvcGVybHkgZGVmaW5lZFxuIyAgICAgLSB0ZXN0X29wZXJhdG9yKCdvcGVyYXRvcicsKSwgbm90X2NhbGxlZF9tc2c9JycsaW5jb3JyZWN0X21zZz0nJylcbiMgICAgIC0gdGVzdF9mdW5jdGlvbl9kZWZpbml0aW9uKCkgLS0gcmlnb3JvdXNseSBjaGVjayBkZWZpbmVkIGZ1bmN0aW9uXG4jICAgICAtIHRlc3RfZGF0YV9mcmFtZSgpIC0tIGNoZWNrIGlmIGRhdGFmcmFtZSBbY29sdW1uc10gYXJlIGVxdWl2YWxlbnRcbiMgICAgIC0gdGVzdF9mdW5jdGlvbl9yZXN1bHQsIHRlc3RfZXhwcmVzc2lvbl9yZXN1bHQifQ==
Exercise 3: ROC curve and AUC
Note: This isn’t using the yardstick library directly, but instead implements a small subset of the functionality of it.
eyJsYW5ndWFnZSI6InIiLCJwcmVfZXhlcmNpc2VfY29kZSI6ImxpYnJhcnkoZHBseXIpICMgbG9hZHMgZHBseXIgZm9yIGRhdGEgbWFuaXB1bGF0aW9uXG5saWJyYXJ5KGdncGxvdDIpXG5kZiA8LSBkYXRhLmZyYW1lKHRpYz1yZXAoXCJXTVRcIiwxOTQpLFxuICAgICAgICAgICAgICAgICBmeWVhcnE9YygxOTcwLDE5NzAsMTk3MCwxOTcwLDE5NzEsMTk3MSwxOTcxLDE5NzEsMTk3MiwxOTcyLDE5NzIsMTk3MiwxOTczLDE5NzMsMTk3MywxOTczLDE5NzQsMTk3NCwxOTc0LDE5NzQsMTk3NSwxOTc1LDE5NzUsMTk3NSwxOTc2LDE5NzYsMTk3NiwxOTc2LDE5NzcsM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B0ZXN0X2Z1bmN0aW9uX3Jlc3VsdCwgdGVzdF9leHByZXNzaW9uX3Jlc3VsdCJ9
Exercise 4: Plotting a ROC curve
As the autoplot()
method is unsupported here, code is given below to visualize the ROC curve for the model you have built.
eyJsYW5ndWFnZSI6InIiLCJwcmVfZXhlcmNpc2VfY29kZSI6ImxpYnJhcnkoZ2dwbG90MilcbmRmX1JPQyA8LSBkYXRhLmZyYW1lKEZhbHNlUG9zaXRpdmU9YygwLCAwLjAwNTQzNDc4MjYwODY5NTY1LCAwLjAxMDg2OTU2NTIxNzM5MTMsIDAuMDEwODY5NTY1MjE3MzkxMywgMC4wMTA4Njk1NjUyMTczOTEzLCAwLjAxNjMwNDM0NzgyNjA4NywgMC4wMjE3MzkxMzA0MzQ3ODI2LCAwLjAyMTczOTEzMDQzNDc4MjYsIDAuMDI3MTczOTEzMDQzNDc4MywgMC4wMzI2MDg2OTU2NTIxNzM5LCAwLjAzODA0MzQ3ODI2MDg2OTYsIDAuMDQzNDc4MjYwODY5NTY1MiwgMC4wNDg5MTMwNDM0NzgyNjA5LCAwLjA1NDM0NzgyNjA4Njk1NjUsIDAuMDU0MzQ3ODI2MDg2OTU2NSwgMC4wNTk3ODI2MDg2OTU2NTIyLCAwLjA1OTc4MjYwODY5NTY1MjIsIDAuMDY1MjE3MzkxMzA0MzQ3OCwgMC4wNzA2NTIxNzM5MTMwNDM1LCAwLjA3NjA4Njk1NjUyMTczOTEsIDAuMDgxNTIxNzM5MTMwNDM0OCwgMC4wODY5NTY1MjE3MzkxMzA0LCAwLjA5MjM5MTMwNDM0NzgyNjEsIDAuMDk3ODI2MDg2OTU2NTIxNywgMC4xMDMyNjA4Njk1NjUyMTcsIDAuMTA4Njk1NjUyMTczOTEzLCAwLjExNDEzMDQzNDc4MjYwOSwgMC4xMTk1NjUyMTczOTEzMDQsIDAuMTI1LCAwLjEzMDQzNDc4MjYwODY5NiwgMC4xMzU4Njk1NjUyMTczOTEsIDAuMTQxMzA0MzQ3ODI2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