Skip to content

Commit d267fd4

Browse files
vivekmigfacebook-github-bot
authored andcommitted
Fix titanic tutorial to convert datatypes to float (#1331)
Summary: Currently, the Titanic tutorial for Captum leads to an error due to mismatched datatypes within the training data. Explicitly converting to a numpy array with floats resolves this issue. Pull Request resolved: #1331 Reviewed By: jjuncho Differential Revision: D61443014 Pulled By: vivekmig fbshipit-source-id: a7696fa9ce3f14256debe895571e402f35f025c4
1 parent 24869fa commit d267fd4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tutorials/Titanic_Basic_Interpret.ipynb

+2-2
Original file line numberDiff line numberDiff line change
@@ -136,9 +136,9 @@
136136
"# Separate training and test sets using \n",
137137
"train_indices = np.random.choice(len(labels), int(0.7*len(labels)), replace=False)\n",
138138
"test_indices = list(set(range(len(labels))) - set(train_indices))\n",
139-
"train_features = data[train_indices]\n",
139+
"train_features = np.array(data[train_indices], dtype=float)\n",
140140
"train_labels = labels[train_indices]\n",
141-
"test_features = data[test_indices]\n",
141+
"test_features = np.array(data[test_indices], dtype=float)\n",
142142
"test_labels = labels[test_indices]"
143143
]
144144
},

0 commit comments

Comments
 (0)