Simple way to measure cell execution time in ipython notebook
The only way I found to overcome this problem is by executing the last statement with print.
Do not forget that cell magic starts with
%% and line magic starts with
%%timeclf = tree.DecisionTreeRegressor().fit(X_train, y_train)res = clf.predict(X_test)print(res)