Lesson 3: Your first machine learning model Flashcards

1
Q

How do you find out a list of column headings of a DataFrame?

A

That is done with the columns property of the DataFrame (the bottom line of code below)

e.g. melbourne_data.columns

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How do you drop rows of data with missing values?

A

melbourne_data = melbourne_data.dropna(axis=0)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

The column we want to predict is called the p—– t—-

A

prediction target

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

By convention, the prediction target is called -

A

y

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

The columns that are inputted into our model (and later used to make predictions) are called f——

A

features

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

By convention, the features data is called…

A

X

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How do you see a sample of the the first few rows of a DataFrame (“X”)?

A

X.head()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

S—-L—– is easily the most popular library for modeling the types of data typically stored in DataFrames

A

Scikit-learn

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Why define a number for random_state?

A

Specifying a number for random_state ensures you get the same results in each run.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

4 basic steps for building and using a model

A
  1. Define: What type of model will it be? A decision tree? Some other type of model? Some other parameters of the model type are specified too.
  2. Fit: Capture patterns from provided data. This is the heart of modeling.
  3. Predict: Just what it sounds like
  4. Evaluate: Determine how accurate the model’s predictions are.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

How do you import a Decision Tree model?

A

from sklearn.tree import DecisionTreeRegressor

How well did you know this?
1
Not at all
2
3
4
5
Perfectly