Binary-Class Image Classification Deep Learning Model for PatchCamelyon Grand Challenge Using TensorFlow Take 2

Template Credit: Adapted from a template made available by Dr. Jason Brownlee of Machine Learning Mastery.

SUMMARY: This project aims to construct a predictive model using a TensorFlow convolutional neural network (CNN) and document the end-to-end steps using a template. The PatchCamelyon Grand Challenge dataset is a binary-class classification situation where we attempt to predict one of two possible outcomes.

INTRODUCTION: The PatchCamelyon benchmark is a new and challenging image classification dataset. It consists of 327680 color images (96 x 96px) extracted from histopathologic scans of lymph node sections. Each image is annotated with a binary label indicating the presence of metastatic tissue. This dataset provides a useful benchmark for machine learning models that are bigger than CIFAR10 but smaller than ImageNet.

In iteration Take1, we constructed a CNN model using a simple three-block VGG architecture and tested the model’s performance using a held-out test dataset.

In this Take2 iteration, we will construct a CNN model using the InceptionV3 architecture and test the model’s performance using a held-out test dataset.

ANALYSIS: In iteration Take1, the model’s performance achieved an accuracy score of 79.83% on the validation dataset after ten epochs. After we apply the final model to the test dataset, the model achieved an accuracy score of 79.00%.

In this Take2 iteration, the model’s performance achieved an accuracy score of 83.74% on the validation dataset after ten epochs. After we apply the final model to the test dataset, the model achieved an accuracy score of 79.00%.

CONCLUSION: In this iteration, the InceptionV3 CNN model appeared to be suitable for modeling this dataset. We should consider experimenting with TensorFlow for further modeling.

Dataset Used: PatchCamelyon Grand Challenge

Dataset ML Model: Binary-class image classification with numerical attributes

Dataset Reference: https://patchcamelyon.grand-challenge.org/

A potential source of performance benchmarks: https://patchcamelyon.grand-challenge.org/evaluation/challenge/leaderboard/

The HTML formatted report can be found here on GitHub.

Algorithmic Trading Model for Mean-Reversion with Relative Strength Indicator Using Python Take 3

NOTE: This script is for learning purposes only and does not constitute a recommendation for buying or selling any stock mentioned in this script.

SUMMARY: This project aims to construct and test an algorithmic trading model and document the end-to-end steps using a template.

INTRODUCTION: This algorithmic trading model examines a simple mean-reversion strategy for a stock. The model enters a position when the price reaches either the upper or lower Relative Strength Indicator thresholds for the last X number of days. The model will exit the trade when the stock price crosses the upper or the lower RSI line for the same window size.

In iteration Take1, we set up the models using an RSI window size for long trades only. The window size varied from 10 to 50 trading days at a 5-day increment.

In iteration Take2, we set up the models using an RSI window size for long and short trades. The window size varied from 10 to 50 trading days at a 5-day increment.

In this Take2 iteration, we will set up the models using an RSI window size for long trades only. The window size will vary from 10 to 50 trading days at a 5-day increment. In addition, we will vary the upper and lower RSI thresholds to examine their effects on the return.

ANALYSIS: In iteration Take1, we analyzed the stock prices for Costco Wholesale (COST) between January 1, 2016, and April 23, 2021. The top trading model produced a profit of 143.51 dollars per share. The buy-and-hold approach yielded a gain of 211.45 dollars per share.

In iteration Take2, we analyzed the stock prices for Costco Wholesale (COST) between January 1, 2016, and April 23, 2021. The top trading model produced a profit of 51.19 dollars per share. The buy-and-hold approach yielded a gain of 211.45 dollars per share.

In this Take3 iteration, we analyzed the stock prices for Costco Wholesale (COST) between January 1, 2016, and April 23, 2021. The top trading model produced a profit of 143.51 dollars per share. The buy-and-hold approach yielded a gain of 211.45 dollars per share.

CONCLUSION: For the stock of COST during the modeling time frame, the long-only with variable RSI thresholds trading strategy did not produce a better return than the buy-and-hold approach. We should consider modeling this stock further by experimenting with more variations of the strategy.

Dataset ML Model: Time series analysis with numerical attributes

Dataset Used: Quandl

The HTML formatted report can be found here on GitHub.

Binary-Class Image Classification Deep Learning Model for PatchCamelyon Grand Challenge Using TensorFlow Take 1

Template Credit: Adapted from a template made available by Dr. Jason Brownlee of Machine Learning Mastery.

SUMMARY: This project aims to construct a predictive model using a TensorFlow convolutional neural network (CNN) and document the end-to-end steps using a template. The PatchCamelyon Grand Challenge dataset is a binary-class classification situation where we attempt to predict one of two possible outcomes.

INTRODUCTION: The PatchCamelyon benchmark is a new and challenging image classification dataset. It consists of 327680 color images (96 x 96px) extracted from histopathologic scans of lymph node sections. Each image is annotated with a binary label indicating presence of metastatic tissue. This dataset provides a useful benchmark for machine learning models that are bigger than CIFAR10 but smaller than ImageNet.

In this Take1 iteration, we will construct a CNN model using a simple three-block VGG architecture and test the model’s performance using a held-out test dataset.

ANALYSIS: In this Take1 iteration, the model’s performance achieved an accuracy score of 79.83% on the validation dataset after 10 epochs. After we apply the final model to the test dataset, the model achieved an accuracy score of 79.00%.

CONCLUSION: In this iteration, the simple three-block VGG CNN model appeared to be suitable for modeling this dataset. We should consider experimenting with TensorFlow for further modeling.

Dataset Used: PatchCamelyon Grand Challenge

Dataset ML Model: Binary-class image classification with numerical attributes

Dataset Reference: https://patchcamelyon.grand-challenge.org/

Potential source of performance benchmarks: https://patchcamelyon.grand-challenge.org/evaluation/challenge/leaderboard/

The HTML formatted report can be found here on GitHub.

Multi-Class Image Classification Model for Robusta Coffee Leaf Images Using TensorFlow Take 4

Template Credit: Adapted from a template made available by Dr. Jason Brownlee of Machine Learning Mastery.

SUMMARY: This project aims to construct a predictive model using a TensorFlow convolutional neural network (CNN) and document the end-to-end steps using a template. The Robusta Coffee Leaf Images dataset is a multi-class classification situation where we attempt to predict one of several (more than two) possible outcomes.

INTRODUCTION: The dataset contains 1560 Robusta coffee leaf images with visible mites and spots for infection cases and images without such appearance for healthy cases. Also, the dataset includes labels regarding the health state (healthy and unhealthy) and the severity of the disease (leaf area with spots).

In iteration Take1, we constructed a CNN model using a simple three-block VGG architecture and tested the model’s performance using a validation dataset (20%) set aside from the training images.

In iteration Take2, we constructed a CNN model using the DenseNet121 architecture and tested the model’s performance using a validation dataset (20%) set aside from the training images.

In iteration Take3, we will construct a CNN model using the InceptionV3 architecture and test the model’s performance using a validation dataset (20%) set aside from the training images.

In this Take4 iteration, we will construct a CNN model using the ResNet50V2 architecture and test the model’s performance using a validation dataset (20%) set aside from the training images.

ANALYSIS: In iteration Take1, the baseline model’s performance achieved an accuracy score of 98.16% on the training dataset after 15 epochs. Furthermore, the final model achieved an accuracy score of 51.28% on the validation dataset.

In iteration Take2, the DenseNet121 model’s performance achieved an accuracy score of 97.61% on the training dataset after 15 epochs. Furthermore, the final model achieved an accuracy score of 73.08% on the validation dataset.

In iteration Take3, the InceptionV3 model’s performance achieved an accuracy score of 97.84% on the training dataset after 15 epochs. Furthermore, the final model achieved an accuracy score of 71.15% on the validation dataset.

In this Take4 iteration, the ResNet50V2 model’s performance achieved an accuracy score of 97.82% on the training dataset after 15 epochs. Furthermore, the final model achieved an accuracy score of 73.72% on the validation dataset.

CONCLUSION: In this iteration, the ResNet50V2 CNN model appeared to be suitable for modeling this dataset. We should consider experimenting with more CNN architectures for further modeling.

Dataset Used: Robusta Coffee Leaf Images

Dataset ML Model: Multi-class image classification with numerical attributes

Dataset Reference: Parraga-Alava, Jorge; Cusme, Kevin; Loor, Angélica; Santander, Esneider (2019), “RoCoLe: A robusta coffee leaf images dataset”, Mendeley Data, V2, doi: 10.17632/c5yvn32dzg.2 http://dx.doi.org/10.17632/c5yvn32dzg.2

A potential source of performance benchmarks: https://data.mendeley.com/datasets/c5yvn32dzg/2

The HTML formatted report can be found here on GitHub.

Algorithmic Trading Model for Mean-Reversion with Relative Strength Indicator Using Python Take 2

NOTE: This script is for learning purposes only and does not constitute a recommendation for buying or selling any stock mentioned in this script.

SUMMARY: This project aims to construct and test an algorithmic trading model and document the end-to-end steps using a template.

INTRODUCTION: This algorithmic trading model examines a simple mean-reversion strategy for a stock. The model enters a position when the price reaches either the upper or lower Relative Strength Indicator thresholds for the last X number of days. The model will exit the trade when the stock price crosses the upper or the lower RSI line for the same window size.

In iteration Take1, we set up the models using an RSI window size for long trades only. The window size varied from 10 to 50 trading days at a 5-day increment.

In this Take2 iteration, we will set up the models using an RSI window size for long and short trades. The window size will vary from 10 to 50 trading days at a 5-day increment.

ANALYSIS: In iteration Take1, we analyzed the stock prices for Costco Wholesale (COST) between January 1, 2016, and April 23, 2021. The top trading model produced a profit of 143.51 dollars per share. The buy-and-hold approach yielded a gain of 211.45 dollars per share.

In this Take2 iteration, we analyzed the stock prices for Costco Wholesale (COST) between January 1, 2016, and April 23, 2021. The top trading model produced a profit of 51.19 dollars per share. The buy-and-hold approach yielded a gain of 211.45 dollars per share.

CONCLUSION: For the stock of COST during the modeling time frame, the long-and-short trading strategy did not produce a better return than the buy-and-hold approach. We should consider modeling this stock further by experimenting with more variations of the strategy.

Dataset ML Model: Time series analysis with numerical attributes

Dataset Used: Quandl

The HTML formatted report can be found here on GitHub.

Multi-Class Image Classification Model for Robusta Coffee Leaf Images Using TensorFlow Take 3

Template Credit: Adapted from a template made available by Dr. Jason Brownlee of Machine Learning Mastery.

SUMMARY: This project aims to construct a predictive model using a TensorFlow convolutional neural network (CNN) and document the end-to-end steps using a template. The Robusta Coffee Leaf Images dataset is a multi-class classification situation where we attempt to predict one of several (more than two) possible outcomes.

INTRODUCTION: The dataset contains 1560 Robusta coffee leaf images with visible mites and spots for infection cases and images without such appearance for healthy cases. Also, the dataset includes labels regarding the health state (healthy and unhealthy) and the severity of the disease (leaf area with spots).

In iteration Take1, we constructed a CNN model using a simple three-block VGG architecture and tested the model’s performance using a validation dataset (20%) set aside from the training images.

In iteration Take2, we constructed a CNN model using the DenseNet121 architecture and tested the model’s performance using a validation dataset (20%) set aside from the training images.

In this Take3 iteration, we will construct a CNN model using the InceptionV3 architecture and test the model’s performance using a validation dataset (20%) set aside from the training images.

ANALYSIS: In iteration Take1, the baseline model’s performance achieved an accuracy score of 98.16% on the training dataset after 15 epochs. Furthermore, the final model achieved an accuracy score of 51.28% on the validation dataset.

In iteration Take2, the DenseNet121 model’s performance achieved an accuracy score of 97.61% on the training dataset after 15 epochs. Furthermore, the final model achieved an accuracy score of 73.08% on the validation dataset.

In this Take3 iteration, the InceptionV3 model’s performance achieved an accuracy score of 97.84% on the training dataset after 15 epochs. Furthermore, the final model achieved an accuracy score of 71.15% on the validation dataset.

CONCLUSION: In this iteration, the InceptionV3 CNN model appeared to be suitable for modeling this dataset. We should consider experimenting with more CNN architectures for further modeling.

Dataset Used: Robusta Coffee Leaf Images

Dataset ML Model: Multi-class image classification with numerical attributes

Dataset Reference: Parraga-Alava, Jorge; Cusme, Kevin; Loor, Angélica; Santander, Esneider (2019), “RoCoLe: A robusta coffee leaf images dataset”, Mendeley Data, V2, doi: 10.17632/c5yvn32dzg.2 http://dx.doi.org/10.17632/c5yvn32dzg.2

A potential source of performance benchmarks: https://data.mendeley.com/datasets/c5yvn32dzg/2

The HTML formatted report can be found here on GitHub.

Algorithmic Trading Model for Mean-Reversion with Relative Strength Indicator Using Python Take 1

NOTE: This script is for learning purposes only and does not constitute a recommendation for buying or selling any stock mentioned in this script.

SUMMARY: This project aims to construct and test an algorithmic trading model and document the end-to-end steps using a template.

INTRODUCTION: This algorithmic trading model examines a simple mean-reversion strategy for a stock. The model enters a position when the price reaches either the upper or lower Relative Strength Indicator thresholds for the last X number of days. The model will exit the trade when the stock price crosses the upper or the lower RSI line for the same window size.

In this Take1 iteration, we will set up the models using an RSI window size for long trades only. The window size will vary from 10 to 50 trading days at a 5-day increment.

ANALYSIS: In this Take1 iteration, we analyzed the stock prices for Costco Wholesale (COST) between January 1, 2016, and April 23, 2021. The top trading model produced a profit of 143.51 dollars per share. The buy-and-hold approach yielded a gain of 211.45 dollars per share.

CONCLUSION: For the stock of COST during the modeling time frame, the simple long-only trading strategy did not produce a better return than the buy-and-hold approach. We should consider modeling this stock further by experimenting with more variations of the strategy.

Dataset ML Model: Time series analysis with numerical attributes

Dataset Used: Quandl

The HTML formatted report can be found here on GitHub.

Multi-Class Image Classification Model for Robusta Coffee Leaf Images Using TensorFlow Take 2

Template Credit: Adapted from a template made available by Dr. Jason Brownlee of Machine Learning Mastery.

SUMMARY: This project aims to construct a predictive model using a TensorFlow convolutional neural network (CNN) and document the end-to-end steps using a template. The Robusta Coffee Leaf Images dataset is a multi-class classification situation where we attempt to predict one of several (more than two) possible outcomes.

INTRODUCTION: The dataset contains 1560 Robusta coffee leaf images with visible mites and spots for infection cases and images without such appearance for healthy cases. Also, the dataset includes labels regarding the health state (healthy and unhealthy) and the severity of the disease (leaf area with spots).

In iteration Take1, we constructed a CNN model using a simple three-block VGG architecture and tested the model’s performance using a validation dataset (20%) set aside from the training images.

In this Take2 iteration, we will construct a CNN model using the DenseNet121 architecture and test the model’s performance using a validation dataset (20%) set aside from the training images.

ANALYSIS: In iteration Take1, the baseline model’s performance achieved an accuracy score of 98.16% on the training dataset after 15 epochs. Furthermore, the final model achieved an accuracy score of 51.28% on the validation dataset.

In this Take2 iteration, the DenseNet121 model’s performance achieved an accuracy score of 97.61% on the training dataset after 15 epochs. Furthermore, the final model achieved an accuracy score of 73.08% on the validation dataset.

CONCLUSION: In this iteration, the DenseNet121 CNN model appeared to be suitable for modeling this dataset. We should consider experimenting with more CNN architectures for further modeling.

Dataset Used: Robusta Coffee Leaf Images

Dataset ML Model: Multi-class image classification with numerical attributes

Dataset Reference: Parraga-Alava, Jorge; Cusme, Kevin; Loor, Angélica; Santander, Esneider (2019), “RoCoLe: A robusta coffee leaf images dataset”, Mendeley Data, V2, doi: 10.17632/c5yvn32dzg.2 http://dx.doi.org/10.17632/c5yvn32dzg.2

A potential source of performance benchmarks: https://data.mendeley.com/datasets/c5yvn32dzg/2

The HTML formatted report can be found here on GitHub.