Skip to content

Commit c4ed18d

Browse files
author
Aaron England
authored
Add files via upload
1 parent 5b3debf commit c4ed18d

File tree

7 files changed

+16
-1
lines changed

7 files changed

+16
-1
lines changed

Chapter 2/Exercises/Exercise_04.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Exercise 4: Fitting a multiple linear regression model and determining the intercept and coefficient
22

3-
# continuing from Exercise 1:
3+
# continuing from Exercise 3:
44

55
# instantiate linear regression model
66
from sklearn.linear_model import LinearRegression

Chapter 2/Exercises/Exercise_05.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Exercise 5: Fitting a logistic regression model and determining the intercept and coefficient
22

3+
# clear environment prior to running this code
4+
35
# import data
46
import pandas as pd
57
df = pd.read_csv('weather.csv')

Chapter 2/Exercises/Exercise_08.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Exercise 8: Preparing data for support vector classifier
22

3+
# clear environment prior to running this code
4+
35
# import data
46
import pandas as pd
57
df = pd.read_csv('weather.csv')

Chapter 2/Exercises/Exercise_10.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Exercise 10: Tuning decision tree classifier using grid search in pipeline
22

3+
# continuing from Activity 4:
4+
35
# Set up the steps for a pipeline
46
from sklearn.preprocessing import StandardScaler
57
from sklearn.tree import DecisionTreeClassifier

Chapter 2/Exercises/Exercise_11.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,8 @@
3636
plt.legend(loc=4)
3737
plt.show()
3838

39+
40+
41+
42+
43+

Chapter 2/Exercises/Exercise_12.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Exercise 12: Preparing data for random forest regressor pipeline
22

3+
# clear environment prior to running this code
4+
35
# import data
46
import pandas as pd
57
df = pd.read_csv('weather.csv')

Chapter 2/Exercises/Exercise_13.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Exercise 13: Programmatically extracting tuned hyperparameters and determining feature importance from random forest regressor grid search model
22

3+
# continuing from Activity 6
4+
35
# instantiate model
46
from sklearn.ensemble import RandomForestRegressor
57
model = RandomForestRegressor(criterion=best_parameters['Forest__criterion'],

0 commit comments

Comments
 (0)