Skip to content

Commit

Permalink
note on adding more input variables.
Browse files Browse the repository at this point in the history
  • Loading branch information
tompollard committed Aug 23, 2022
1 parent 58b5056 commit 15659f8
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions _episodes/04-modelling.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ from sklearn.linear_model import LinearRegression
reg = LinearRegression()

# use a single feature (apache score)
# note: remove the reshape if fitting to >1 input variable
X = cohort.apachescore.values.reshape(-1, 1)
y = cohort.actualhospitalmortality_enc.values

Expand Down
1 change: 1 addition & 0 deletions _episodes/05-validation.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ y = cohort[outcome]
x_train, x_test, y_train, y_test = train_test_split(X, y, train_size = 0.7, random_state = 42)

# restructure data for input into model
# note: remove the reshape if fitting to >1 input variable
x_train = x_train.values.reshape(-1, 1)
y_train = y_train.values.ravel()
x_test = x_test.values.reshape(-1, 1)
Expand Down
1 change: 1 addition & 0 deletions _episodes/06-evaluation.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ y = cohort[outcome]
x_train, x_test, y_train, y_test = train_test_split(X, y, train_size = 0.7, random_state = 42)

# restructure data for input into model
# note: remove the reshape if fitting to >1 input variable
x_train = x_train.values.reshape(-1, 1)
y_train = y_train.values.ravel()
x_test = x_test.values.reshape(-1, 1)
Expand Down
1 change: 1 addition & 0 deletions _episodes/07-bootstrapping.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ y = cohort[outcome]
x_train, x_test, y_train, y_test = train_test_split(X, y, train_size = 0.7, random_state = 42)

# restructure data for input into model
# note: remove the reshape if fitting to >1 input variable
x_train = x_train.values.reshape(-1, 1)
y_train = y_train.values.ravel()
x_test = x_test.values.reshape(-1, 1)
Expand Down

0 comments on commit 15659f8

Please sign in to comment.