I've been wildly curious about machine learning, and I'm using this to learn.
I was able to compile the code without issue, and generate the graph.
I would like to use a different data source. Currently they are using stock prices:
d1 = datetime.datetime(2003, 01, 01)
d2 = datetime.datetime(2008, 01, 01)
symbol_dict = {
'TOT': 'Total',
'XOM': 'Exxon',
'CVX': 'Chevron',
'COP': 'ConocoPhillips',
...
...
}
symbols, names = np.array(symbol_dict.items()).T
quotes = [finance.quotes_historical_yahoo(symbol, d1, d2, asobject=True)
for symbol in symbols]
open = np.array([q.open for q in quotes]).astype(np.float)
close = np.array([q.close for q in quotes]).astype(np.float)
- what does
quotes
return? I understand it is price per stock, but I am getting something like this:
[rec.array([ (datetime.date(2003, 1, 2), 2003, 1, 2, 731217.0, 28.12235692134198, 28.5, 28.564279672963064, 28.09825204398083, 12798800.0, 28.5), (datetime.date(2003, 1, 3), 2003, 1, 3, 731218.0, 28.329084507042257, 28.53, 28.634476056338034, 28.28890140845071, 9221900.0, 28.53), (datetime.date(2003, 1, 6), 2003, 1, 6, 731221.0, 28.482778999450247, 29.23, 29.406761957119297, 28.45064046179219, 11925100.0, 29.23), ...,
- i would like to input my own dataset. can you please give me an example of a dataset that I can input into
quotes
?
the entire code is here:
http://scikit-learn.org/dev/auto_examples/applications/plot_stock_market.html