Skip to content

Commit

Permalink
Remove load_boston in survival.py
Browse files Browse the repository at this point in the history
  • Loading branch information
jyx-su committed Nov 6, 2023
1 parent 0154ac5 commit 1710840
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions examples/survival.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import numpy as np
from sklearn.datasets import load_boston
from sklearn.metrics import mean_squared_error
from sklearn.model_selection import train_test_split

Expand All @@ -8,7 +7,12 @@

if __name__ == "__main__":

X, Y = load_boston(return_X_y=True)
#Load Boston housing dataset
data_url = "http://lib.stat.cmu.edu/datasets/boston"
raw_df = pd.read_csv(data_url, sep="\s+", skiprows=22, header=None)
X = np.hstack([raw_df.values[::2, :], raw_df.values[1::2, :2]])
Y = raw_df.values[1::2, 2]

X_train, X_test, Y_train, Y_test = train_test_split(X, Y, test_size=0.2)

# introduce administrative censoring
Expand Down

0 comments on commit 1710840

Please sign in to comment.