Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed Link #3468

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions Tutorials/CNTK_101_LogisticRegression.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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,\"%\")"
]
},
{
Expand Down Expand Up @@ -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
}
"nbformat_minor": 1
}
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -1089,7 +1089,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.5.4"
"version": "3.6.3"
}
},
"nbformat": 4,
Expand Down