Skip to content

Instantly share code, notes, and snippets.

Linear Regression

Please clone this repo and import the life_expectancy.csv file into a jupyter notebook. Fit a linear regression model.

Please answer the following questions in your warmups slack channel.

  1. How did you handle categorical variables?
  • Did you use dummies?
    • What column did you designate as your baseline?
    • How many columns does your dataframe have after creating dummies?
  • Did you drop columns?
  • What columns did you drop?
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 1.
Unnamed: 0,"Abingdon city, Illinois","Addieville village, Illinois","Addison village, Illinois","Adeline village, Illinois","Albany village, Illinois","Albers village, Illinois","Albion city, Illinois","Aledo city, Illinois","Alexis village, Illinois","Algonquin village, Illinois","Alhambra village, Illinois","Allendale village, Illinois","Allenville village, Illinois","Allerton village, Illinois","Alma village, Illinois","Alorton village, Illinois","Alpha village, Illinois","Alsey village, Illinois","Alsip village, Illinois","Altamont city, Illinois","Alton city, Illinois","Altona village, Illinois","Alto Pass village, Illinois","Alvan village, Illinois","Amboy city, Illinois","Anchor village, Illinois","Andalusia village, Illinois","Andover village, Illinois","Anna city, Illinois","Annawan town, Illinois","Antioch village, Illinois","Apple River village, Illinois","Arcola city, Illinois","Arenzville village, Illinois","Argenta village, Illinois","Arlington village, Illinois","Arlington Heights village, Illi
[{"Image": "https://en.wikipedia.org/wiki/File:Richard_Shelby,_official_portrait,_112th_Congress_(cropped).jpg", "Senator": "Richard Shelby", "Party": "Republican", "Born": "May 6, 1934 (age 85)", "Occupation(s)": "Lawyer", "Previous\noffice(s)": "U.S. House\nAlabama Senate", "Assumed office": "January 3, 1987", "Term up": "2022", "Residence": "Tuscaloosa[1]", "state": "Alabama"}, {"Image": "https://en.wikipedia.org/wiki/File:Senator_Doug_Jones_official_photo_(cropped_2).jpg", "Senator": "Doug Jones[d]", "Party": "Democratic", "Born": "May 4, 1954 (age 65)", "Occupation(s)": "Lawyer", "Previous\noffice(s)": "Staff counsel, U.S. Senate Judiciary Committee\nU.S. Attorney for the Northern District of Alabama", "Assumed office": "January 3, 2018", "Term up": "2020", "Residence": "Birmingham[1]", "state": "Alabama"}, {"Image": "https://en.wikipedia.org/wiki/File:Lisa_Murkowski_official_photo_(cropped).jpg", "Senator": "Lisa Murkowski", "Party": "Republican", "Born": "May 22, 1957 (age 62)", "Occupation(s)": "Lawye
[
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "@channel Happy {}! :wave:"
}
},
{
"type": "section",
[
{
"type": "section",
"text": { "type": "mrkdwn", "text": "@channel Happy {}! :wave:" }
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "_Respond to be counted in today's attendance_ :arrow_down:"