diff --git a/Tutorials/CNTK_101_LogisticRegression.ipynb b/Tutorials/CNTK_101_LogisticRegression.ipynb index 013f8f454bb8..6265c9701ae8 100644 --- a/Tutorials/CNTK_101_LogisticRegression.ipynb +++ b/Tutorials/CNTK_101_LogisticRegression.ipynb @@ -724,8 +724,12 @@ } ], "source": [ - "print(\"Label :\", [np.argmax(label) for label in labels])\n", - "print(\"Predicted:\", [np.argmax(x) for x in result])" + "labelList=[np.argmax(label) for label in labels]\n", + "predictedList=[np.argmax(x) for x in result]\n", + "Accuracy=1-np.sum(np.absolute(np.array(labelList)-np.array(predictedList)))/np.size(labelList)\n", + "print(\"Label :\", labelList)\n", + "print(\"Predicted:\", predictedList)\n", + "print(\"Accuracy:\", Accuracy*100,\"%\")" ] }, { @@ -820,16 +824,16 @@ "language_info": { "codemirror_mode": { "name": "ipython", - "version": 3.0 + "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.5.2" + "version": "3.6.3" } }, "nbformat": 4, - "nbformat_minor": 0 -} \ No newline at end of file + "nbformat_minor": 1 +} diff --git a/Tutorials/CNTK_104_Finance_Timeseries_Basic_with_Pandas_Numpy.ipynb b/Tutorials/CNTK_104_Finance_Timeseries_Basic_with_Pandas_Numpy.ipynb index a592bc11af95..60c83853093d 100644 --- a/Tutorials/CNTK_104_Finance_Timeseries_Basic_with_Pandas_Numpy.ipynb +++ b/Tutorials/CNTK_104_Finance_Timeseries_Basic_with_Pandas_Numpy.ipynb @@ -806,7 +806,7 @@ "## Evaluation\n", "Here we take the output of our test set and compute the probabilities from the softmax function. Since we have probabilities we want to trade when there is a \"higher\" chance that we will be right, instead of just a >50% chance that the market will go in one direction. The goal is to find a signal, instead of trying to classify the market. Since the market is so noisy we want to only trade when we have an \"edge\" on the market. Moreover, trading frequently has higher fees (you have to pay each time you trade).\n", "\n", - "We will say that if the prediction probability is greater than 55% (in either direction) we will take a position in the market. If it shows that the market will be up the next day with greater than 55% probability, we will take a 1-day long. If it is greater than a 55% chance that the next day will be below today's position we will take 1-day [short] (http://www.investopedia.com/university/shortselling/shortselling1.asp)(the same as borrowing a stock and buying it back). \n", + "We will say that if the prediction probability is greater than 55% (in either direction) we will take a position in the market. If it shows that the market will be up the next day with greater than 55% probability, we will take a 1-day long. If it is greater than a 55% chance that the next day will be below today's position we will take 1-day [short](http://www.investopedia.com/university/shortselling/shortselling1.asp) (the same as borrowing a stock and buying it back). \n", "\n", "We will then evaluate this timeseries performance by looking at some more metrics: average monthly return, standard deviation of monthly returns, the [Sharpe ratio](http://www.investopedia.com/terms/s/sharperatio.asp), and the [Maximum drawdown](https://en.wikipedia.org/wiki/Drawdown_%28economics%29). The Sharpe ratio is the average return minus the risk free rate (which is basically zero) over the standard deviation of returns normalized to a year. \n", "\n", @@ -1089,7 +1089,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.5.4" + "version": "3.6.3" } }, "nbformat": 4,