MachineLearning.1.如何使用ML进行股票投资.Day1

参考内容:
一周时间,初试 ML
在Hacker News上提问

在此之前我学习过Coursera上Andrew Ng机器学习的大部分课程,以及一些数据挖掘和深度学习方面的算法。根据一周时间,初试 ML中提到的过程,继续实践和学习Machine Learning。

星期一:学习实用技巧
使用Sentdex的关于如何使用ML进行股票投资的教程,该教程提供了进行下一步学习的必备知识,带领你经历收集数据的每一个步骤。从文件或网络上提取有效数据的编程技术必不可少。
但如果已经熟悉如何从网络提取数据,Udacity的《Intro to Machine Learning》 课程也许是更好的入门选择。

1. Intro to Machine Learning with Scikit Learn and Python

MachineLearning.1.如何使用ML进行股票投资.Day1_第1张图片
Machine Learning

2. Simple Support Vector Machine (SVM) example with character recognition

使用SVM做手写数字识别

$ python
>>>

import matplotlib.pyplot as plt
from sklearn import datasets
from sklearn import svm

digits = datasets.load_digits()
print(digits.data)
print(digits.target)

clf = svm.SVC(gamma=0.001, C=100)  #clf = svm.SVC(gamma=0.0001, C=100)
x,y = digits.data[:-10],digits.target[:-10]
clf.fit(x,y)  #train

print(clf.predict(digits.data[-5]))
plt.imshow(digits.images[-5], cmap=plt.cm.gray_r, interpolation='nearest')
plt.show()

tutorials on Matplotlib

3. Our Method and where we will be getting our Data

3.1. Question

Can we use machine learning to analyze public company (stocks) fundamentals (things like price/book ratio, P/E ratio, Debt/Equity ... etc), and then classify the stocks as either out-performers compared to the market (labeled as 1's), or under-performers (labeled as 0's).

3.2. 抓取数据(此处直接下载IntraQuarter.Zip文件)

machine learning data file
This data is straight HTML source code for the S&P 500 index of companies over a bit over a decade from Yahoo Finance.
Yahoo Finance has a bunch of nicely organized data points all in a table. This isn't ideal for us, but we can work with it. It turns out there are some options for connecting to EDGAR via an API, so later we will cover using EDGAR specifically.

3.3. Best source for public company data

证券交易委员会SEC (Securities and Exchange Commission) website.
To navigate the SEC.gov website, you should go to "company filings" near the top right, then use the "fast search" by typing the company's ticker symbol, like AAPL for Apple. An example of some forms you may be interested in here would be the 10K and 10Q forms. The 10K is the annual report, and the 10Q is a quarterly report.

你可能感兴趣的:(MachineLearning.1.如何使用ML进行股票投资.Day1)