# Machine Learning in Python From scratch
A Vectorized Python 馃悕 implementation using only [NumPy](http://www.numpy.org/), [SciPy](https://www.scipy.org/), and [Matplotlib](https://matplotlib.org/) resembling **as closely as possible** to both provided and personally-completed code in the octave/matlab as part of the excellent Stanford University's Machine Learning Course on Coursera.
The course is taught by [Andrew Ng](https://en.wikipedia.org/wiki/Andrew_Ng) a genius and an excellent popularizer, which is a rare combination.
This course helped me write a blog answering the following question [What is Machine Learning?](https://www.linkedin.com/pulse/common-machine-learning-algorithms-hamed-zitoun/)
___
## Supervised Learning
Given a set of labeled observations, find a function f which can be used to assign a class or value to unseen observations. Predictions should be similar to real labels.
### Regression
In a regression problem, we are trying to predict results within a **continuous output**, meaning that we are trying to map input variables to some continuous function.
#### 1. **Linear regression** with one variable to predict pro铿乼s for a food truck
- 馃悕 [Demo | Linear Regression Notebook](https://github.com/hzitoun/coursera_machine_learning_matlab_python/blob/master/jupyter_notebooks/week_2/ex1.ipynb)
- 鈻讹笍 [Demo | Linear Regression Matlab](https://github.com/hzitoun/coursera_machine_learning_matlab_python/tree/master/algorithms_in_matlab/week_2/ex1/ex1.m)
<p align="center">
<img src ="./figures/1_linear_regression.png" alt="Linear regression with one variable"/>
</p>
#### 2. **Regularized Linear regression** with multiple variables to predict the prices of houses
- 馃悕 [Demo | Linear Regression with multiple variables Notebook](https://github.com/hzitoun/coursera_machine_learning_matlab_python/blob/master/jupyter_notebooks/week_2/ex1MultiFeatures.ipynb)
- 鈻讹笍 [Demo | Linear Regression with multiple variables Matlab](https://github.com/hzitoun/coursera_machine_learning_matlab_python/blob/master/algorithms_in_matlab/week_2/ex1/ex1_multi.m)
<p align="center">
<img src ="./figures/1_linear_regression_3d.png" alt="Regularized Linear regression with multiple variables"/>
</p>
### Classification
In a classification problem, we instead are trying to predict results in a **discrete output**. In other words, we are trying to map input variables into discrete categories.
#### 3. Regularized logistic regression to predict whether microchips passes quality assurance (QA)
- 馃悕 [Demo | Regularized Logistic Regression Notebook](https://github.com/hzitoun/coursera_machine_learning_matlab_python/blob/master/jupyter_notebooks/week_3/ex2_reg.ipynb)
- 鈻讹笍 [Demo | Regularized Logistic Regression Matlab](https://github.com/hzitoun/coursera_machine_learning_matlab_python/blob/master/algorithms_in_matlab/week_3/ex2/ex2_reg.m)
<p align="center">
<img src ="./figures/2_logistic_regression.png" alt="Regularized logistic regression"/>
</p>
#### 4. **Multi-class Logistic regression** to recognize handwritten digits
- 馃悕 [Demo | Multi-class Logistic regression Notebook](https://github.com/hzitoun/coursera_machine_learning_matlab_python/blob/master/jupyter_notebooks/week_4/ex3.ipynb)
- 鈻讹笍 [Demo | Multi-class Logistic regression Matlab](https://github.com/hzitoun/coursera_machine_learning_matlab_python/blob/master/algorithms_in_matlab/week_4/ex3/ex3.m)
<p align="center">
<img src ="./figures/3_one_vs_all_classification.png" alt="Multi-class Logistic regression" />
</p>
#### 5. **Neural Networks** (MLP) to recognize handwritten digits
- 馃悕 [Demo | Neural Networks Notebook Part I](https://github.com/hzitoun/coursera_machine_learning_matlab_python/blob/master/jupyter_notebooks/week_4/ex3_nn.ipynb), [Demo | Neural Networks Notebook Part II](https://github.com/hzitoun/coursera_machine_learning_matlab_python/blob/master/jupyter_notebooks/week_5/ex4.ipynb)
- 鈻讹笍 [Demo | Neural Networks Matlab Part I](https://github.com/hzitoun/coursera_machine_learning_matlab_python/blob/master/algorithms_in_matlab/week_4/ex3/ex3_nn.m), [Demo | Neural NetworksMatlab Part II](https://github.com/hzitoun/coursera_machine_learning_matlab_python/blob/master/algorithms_in_matlab/week_5/ex4/ex4.m)
<p align="center">
<img src ="./figures/4_viz_nn.png" alt="Neural Networks"/>
</p>
#### 6. **Support Vector Machines SVM** ( with and without Gaussian Kernels)
- 馃悕 [Demo | Support Vector Machines Notebook](https://github.com/hzitoun/coursera_machine_learning_matlab_python/blob/master/jupyter_notebooks/week_7/ex6.ipynb)
- 鈻讹笍 [Demo | Support Vector Machines Matlab](https://github.com/hzitoun/coursera_machine_learning_matlab_python/blob/master/algorithms_in_matlab/week_7/ex6/ex6.m)
<p align="center">
<img src ="./figures/6_svms.png" />
</p>
- 馃悕 [Demo | SVM for Spam Notebook](https://github.com/hzitoun/coursera_machine_learning_matlab_python/blob/master/jupyter_notebooks/week_7/ex6_spam.ipynb)
- 鈻讹笍 [Demo | SVM for Spam Matlab](https://github.com/hzitoun/coursera_machine_learning_matlab_python/blob/master/algorithms_in_matlab/week_7/ex6/ex6_spam.m)
<p align="center">
<img src ="./figures/6_spam.png" />
</p>
## Metrics to evaluate ML algorithms
Tackling Overfitting and Underfitting problems.
### 7. High Bias vs High Variance
- 馃悕 [Demo | High Bias vs High Variance Notebook](https://github.com/hzitoun/coursera_machine_learning_matlab_python/blob/master/jupyter_notebooks/week_6/ex5.ipynb)
- 鈻讹笍 [Demo | High Bias vs High Variance Matlab](https://github.com/hzitoun/coursera_machine_learning_matlab_python/blob/master/algorithms_in_matlab/week_6/ex5/ex5.m)
<p align="center">
<img src ="./figures/5_learning_curves.png" alt="learning curves"/>
</p>
## Unsupervised Learning
Labeling can be tedious (too long, too slow), often done by humans and no real labels to compare.
Unsupervised learning allows us to approach problems with little or no idea what our results should look like.
We can derive structure from data where we don't necessarily know the effect of the variables. We can derive this structure by clustering the data based on relationships among the variables in the data.
With unsupervised learning there is no feedback based on the prediction results.
### Clustering
Group objects in clusters, similar within cluster, dissimilar between clusters.
#### 8. K-means clustering algorithm for image compression
- 馃悕 [Demo | K-means Notebook](https://github.com/hzitoun/coursera_machine_learning_matlab_python/blob/master/jupyter_notebooks/week_8/ex7.ipynb)
- 鈻讹笍 [Demo | K-means Matlab](https://github.com/hzitoun/coursera_machine_learning_matlab_python/blob/master/algorithms_in_matlab/week_8/ex7/ex7.m)
<p align="center">
<img src ="./figures/7_kmeans.png" />
<img src ="./figures/7_keams_image_compression.png" />
</p>
### Dimensionality reduction
Reduce data set dimensions. Used for ata compression or big data visualization.
#### 9. **Principal Component Analysis (PCA)** to perform dimensionality reduction
- 馃悕 [Demo | Principal Component Analysis Notebook](https://github.com/hzitoun/coursera_machine_learning_matlab_python/blob/master/jupyter_notebooks/week_8/ex7_pca.ipynb)
- 鈻讹笍 [Demo | Principal Component Analysis Matlab](https://github.com/hzitoun/coursera_machine_learning_matlab_python/blob/master/algorithms_in_matlab/week_8/ex7/ex7_pca.m)
<p align="center">
<img src ="./figures/8_pca_datasets_before.png" />
</p>
<p align="center">
<img src ="./figures/8_pca_faces.png" />
</p>
### Anomaly detection
Identifies rare items (outliers) which raise suspicions by differing significantly from the majority of the data.
#### 10. **Anomaly detection algorithm** to detect anomalous behavior in server computers of a data center
- 馃悕 [Demo | Anomaly detection algorithm Notebook](https://github.com/hzitoun/coursera_machine_learning_matlab_python/blob/master/jupyter_notebooks/week_9/ex8.ipynb)
- �
没有合适的资源?快使用搜索试试~ 我知道了~
Machine Learning in Python From scratch.zip
共319个文件
m:98个
py:83个
pdf:35个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 181 浏览量
2023-07-22
17:31:59
上传
评论
收藏 92.87MB ZIP 举报
温馨提示
Machine Learning in Python From scratch.zip
资源推荐
资源详情
资源评论
收起资源包目录
Machine Learning in Python From scratch.zip (319个子文件)
MNIST_DATA.csv 10.35MB
ex4_features.csv 10.35MB
Theta1.csv 92KB
Theta1.csv 92KB
MNIST_DATA_LABEL.csv 10KB
ex4_labels.csv 10KB
Theta2.csv 2KB
Theta2.csv 2KB
cross_validation_features.csv 155B
test_features.csv 155B
cross_validation_labels.csv 152B
test_labels.csv 148B
train_features.csv 89B
train_labels.csv 82B
featuresX.dat 35B
.gitignore 31B
ex7_pca.ipynb 1.68MB
ex7.ipynb 652KB
ex6.ipynb 319KB
ex1.ipynb 250KB
ex8.ipynb 197KB
ex5.ipynb 191KB
ex4.ipynb 135KB
ex1MultiFeatures.ipynb 123KB
ex3_nn.ipynb 109KB
ex3.ipynb 99KB
ex8_cofi.ipynb 93KB
ex2_reg.ipynb 79KB
ex2.ipynb 71KB
ex6_spam.ipynb 13KB
me.jpg 422KB
porterStemmer.m 10KB
fmincg.m 9KB
fmincg.m 9KB
fmincg.m 9KB
fmincg.m 9KB
ex4.m 8KB
ex7_pca.m 7KB
ex8_cofi.m 7KB
ex5.m 7KB
svmTrain.m 6KB
ex7.m 5KB
ex1_multi.m 5KB
ex6_spam.m 4KB
ex2.m 4KB
ex6.m 4KB
ex8.m 4KB
ex1.m 4KB
ex2_reg.m 4KB
nnCostFunction.m 4KB
processEmail.m 3KB
ex3.m 3KB
ex3_nn.m 3KB
runkMeans.m 2KB
checkNNGradients.m 2KB
svmPredict.m 2KB
validationCurve.m 2KB
matrices_vectors.m 2KB
checkCostFunction.m 2KB
displayData.m 1KB
displayData.m 1KB
displayData.m 1KB
plotDecisionBoundary.m 1KB
featureNormalize.m 1KB
learningCurve.m 1KB
oneVsAll.m 1KB
dataset3Params.m 1KB
tuto_2_moving_data_around.m 1KB
computeNumericalGradient.m 1KB
computeNumericalGradient.m 1KB
costFunction.m 1011B
recoverData.m 1002B
tuto_5_for_if.m 998B
plotData.m 986B
cofiCostFunc.m 929B
projectData.m 922B
costFunctionReg.m 888B
randInitializeWeights.m 886B
estimateGaussian.m 877B
findClosestCentroids.m 868B
computeCentroids.m 864B
computeCostMulti.m 863B
tuto_3_computing_on_data.m 854B
debugInitializeWeights.m 841B
plotProgresskMeans.m 840B
pca.m 833B
predictOneVsAll.m 818B
multivariateGaussian.m 808B
plotFit.m 804B
selectThreshold.m 796B
lrCostFunction.m 785B
getVocabList.m 761B
visualizeBoundary.m 729B
tuto_1_basic_operations.m 725B
gaussianKernel.m 723B
trainLinearReg.m 714B
linearRegCostFunction.m 713B
gradientDescent.m 699B
sigmoidGradient.m 698B
normalEqn.m 676B
共 319 条
- 1
- 2
- 3
- 4
资源评论
AbelZ_01
- 粉丝: 877
- 资源: 5441
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 纯python3和numpy实现的符号计算深度学习框架.zip
- 微信小程序 - 涂鸦源码.zip
- 基于C# winform+mysql人事工资管理系统源码+sql文件+运行说明.zip
- 基于Java web搭建的一个简易博客网站源码.rar
- 基于Java web搭建的一个简易博客网站源码.zip
- 基于C#+MySql实现的药品销售库存信息管理系统源码+数据库+项目说明.zip
- mysql 5.7.15 安装配置方法图文教程.zip
- 基于springboot websocket 定制,主要完成的功能是WebSocket的状态管理,具备单机和集群能力.zip
- SpringBoot框架示例:整合SpringMVC、MyBatis、安全框架Shiro、页面布局框架Sitemesh.zip
- SpringBoot集成thumbnailator图片压缩.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功