Simple Linear Regression with Kobra

Simple Linear Regression with Kobra

Simple Linear Regression with Kobra

Hey! Welcome to Kobra! We're so happy that you're trying it out, and we'd love your feedback! Here are some basic instructions for how to get started with Kobra – we really hope you won't have to use these instructions, but when you do, please take a note of it so we'll know which parts of the experience aren't intuitive
💡
Do not open the specific steps unless you're stuck

Here are the basic steps to creating a Kobra program (we're going to be creating a Simple Linear Regression):
  1. Upload dataset
    1. Download dataset here
      Upload the file
      In the top right, go to the file upload tab and upload your dataset. If this isn't intuitive, please make a note of it
      Load in the dataset
      Go to the variables tab and create a variable for data
      notion image
      Set the data variable to a new dataframe – make the filename the same as the dataset you uploaded (the String block is in the text tab)
      notion image
  1. Create X and y variables
    1. Create variables for X and y
      Go to the variables tab and create a variable for X and y
      Set each variable to one column of the dataframe
      Drag out the "Get column" block from the dataframes tab
      notion image
  1. Create scatterplot
    1. Add a scatterplot to the plo
      Get this blocks from the plots tab, and add it to your program
      notion image
  1. Click the run button to view your scatterplot (in data visualization tab)
  1. Create & Train Linear Regression Model
    1. Create a variable for your linear regression model
      Go to the variables tab, and create a variable for a model
      Set it to a linear regression model
      Drag out the linear regression model from the Linear Regression tab and set model to it
      notion image
      Fit the linear regression model
      Drag out the `fit linear regression model` block and fit the model variable
      notion image
       
  1. Make prediction with linear regression
    1. Make a prediction and print it out
      Drag out the print block from the text category, and then use the create text block to combine a string saying "Prediction (5 yrs experience)" and your predction
      notion image
      Add in a prediction block, where you're making a prediction with your linear regression model (in linear regression tab)
      notion image
Full program
Full program
notion image
notion image
notion image

Explore ML

Build machine learning models with Kobra

Try it out