All Projects → kennedyCzar → STOCK-RETURN-PREDICTION-USING-KNN-SVM-GUASSIAN-PROCESS-ADABOOST-TREE-REGRESSION-AND-QDA

kennedyCzar / STOCK-RETURN-PREDICTION-USING-KNN-SVM-GUASSIAN-PROCESS-ADABOOST-TREE-REGRESSION-AND-QDA

Licence: MIT license
Forecast stock prices using machine learning approach. A time series analysis. Employ the Use of Predictive Modeling in Machine Learning to Forecast Stock Return. Approach Used by Hedge Funds to Select Tradeable Stocks

Programming Languages

Jupyter Notebook
11667 projects
python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to STOCK-RETURN-PREDICTION-USING-KNN-SVM-GUASSIAN-PROCESS-ADABOOST-TREE-REGRESSION-AND-QDA

Statistical-Learning-using-R
This is a Statistical Learning application which will consist of various Machine Learning algorithms and their implementation in R done by me and their in depth interpretation.Documents and reports related to the below mentioned techniques can be found on my Rpubs profile.
Stars: ✭ 27 (-71.28%)
Mutual labels:  logistic-regression, predictive-modeling, svm-classifier
Algorithmic-Trading
Algorithmic trading using machine learning.
Stars: ✭ 102 (+8.51%)
Mutual labels:  stock, algorithmic-trading, decision-tree
IBM-final-project-Machine-Learning
Final project of IBM's course https://www.coursera.org/learn/machine-learning-with-python on coursera
Stars: ✭ 33 (-64.89%)
Mutual labels:  logistic-regression, svm-classifier, knn-classifier
decision-trees-for-ml
Building Decision Trees From Scratch In Python
Stars: ✭ 61 (-35.11%)
Mutual labels:  random-forest, adaboost, decision-tree
ml
经典机器学习算法的极简实现
Stars: ✭ 130 (+38.3%)
Mutual labels:  logistic-regression, adaboost, decision-tree
Machine-Learning-Models
In This repository I made some simple to complex methods in machine learning. Here I try to build template style code.
Stars: ✭ 30 (-68.09%)
Mutual labels:  random-forest, logistic-regression, decision-tree
Machine Learning Models
Decision Trees, Random Forest, Dynamic Time Warping, Naive Bayes, KNN, Linear Regression, Logistic Regression, Mixture Of Gaussian, Neural Network, PCA, SVD, Gaussian Naive Bayes, Fitting Data to Gaussian, K-Means
Stars: ✭ 160 (+70.21%)
Mutual labels:  random-forest, logistic-regression
Machine Learning Is All You Need
🔥🌟《Machine Learning 格物志》: ML + DL + RL basic codes and notes by sklearn, PyTorch, TensorFlow, Keras & the most important, from scratch!💪 This repository is ALL You Need!
Stars: ✭ 173 (+84.04%)
Mutual labels:  random-forest, logistic-regression
Textclassification
several methods for text classification
Stars: ✭ 180 (+91.49%)
Mutual labels:  random-forest, logistic-regression
Mlj.jl
A Julia machine learning framework
Stars: ✭ 982 (+944.68%)
Mutual labels:  pipeline, predictive-modeling
25daysinmachinelearning
I will update this repository to learn Machine learning with python with statistics content and materials
Stars: ✭ 53 (-43.62%)
Mutual labels:  random-forest, logistic-regression
Credit
An example project that predicts risk of credit card default using a Logistic Regression classifier and a 30,000 sample dataset.
Stars: ✭ 18 (-80.85%)
Mutual labels:  pipeline, logistic-regression
cqr
Conformalized Quantile Regression
Stars: ✭ 152 (+61.7%)
Mutual labels:  random-forest, prediction
Awesome Decision Tree Papers
A collection of research papers on decision, classification and regression trees with implementations.
Stars: ✭ 1,908 (+1929.79%)
Mutual labels:  random-forest, decision-tree
Isl Python
Solutions to labs and excercises from An Introduction to Statistical Learning, as Jupyter Notebooks.
Stars: ✭ 108 (+14.89%)
Mutual labels:  random-forest, logistic-regression
Tensorflow Ml Nlp
텐서플로우와 머신러닝으로 시작하는 자연어처리(로지스틱회귀부터 트랜스포머 챗봇까지)
Stars: ✭ 176 (+87.23%)
Mutual labels:  random-forest, logistic-regression
Text classification
Text Classification Algorithms: A Survey
Stars: ✭ 1,276 (+1257.45%)
Mutual labels:  random-forest, logistic-regression
Serving
A flexible, high-performance carrier for machine learning models(『飞桨』服务化部署框架)
Stars: ✭ 403 (+328.72%)
Mutual labels:  pipeline, prediction
Shifu
An end-to-end machine learning and data mining framework on Hadoop
Stars: ✭ 207 (+120.21%)
Mutual labels:  pipeline, random-forest
Open Solution Toxic Comments
Open solution to the Toxic Comment Classification Challenge
Stars: ✭ 154 (+63.83%)
Mutual labels:  pipeline, prediction

STOCK-RETURN-PREDICTION-USING-KNN-SVM-GUASSIAN-PROCESS-ADABOOST-TREE-REGRESSION-AND-QDA HitCount

Forecasts stock prices using classical machine learning techniques- A time series analysis & modeling. Employ the Use of Predictive Modeling in Machine Learning to Forecast Stock Return. Approach Used by Hedge Funds to Select Tradeable Stocks

Objective:

      Predict stock stock price using Technical Indicators as predictors (features).
      Use Supervised Machine Learning Approach to predict stock prices.
      Employ the use of pipeline and GridSearch to select the best model
      Use Final Model to Predict Stock Returns.
      Show plots of stock Return
      Write Deployable script.

Note:

      That Every stock has different behaviour and so at every point we may
      have different best performing algorithm. For instance, after much 
      testing Ranform Forest Algorithm perform better for predicting Apple 
      Stocks than any other algo. Guassian process classifier performed 
      better than every other algo at predicting IBM stocks etc.

Indicators/Predictors Used:

    Moving Averages(Also called Rolling mean)
    Commodity Channel Index
    Momentum
    Stochastic Oscillator(D and K)
    Force Index
    Mass Index

    # You can add ass many predictors are desired.
    # Most importantly if you have to do this, you may
    have to consider a feature selection using XGBoost.

How to Use

      >git clone https://github.com/kennedyCzar/STOCK-RETURN-PREDICTION-USING-KNN-SVM-GUASSIAN-PROCESS-ADABOOST-TREE-REGRESSION-AND-QDA
      Unpak the Files in a project folder
      
      Add File Path to Environment Variable using Spyder PythonPath
      
      Click on Synchronize with Environment.
      
      Restart Spyder.
      
      Report Issue

Output

plot of Feature Importance Image of FeatureImportance Gold Stock Retuns Image of Regression General Motors stock returns Image of Regression Apple stock returns Image of Regression Tesla Stock Returns Image of Regression

Performing optimization...

      Estimation grid_RandomForestClassifier
      Best params: {'clf__criterion': 'gini', 'clf__max_depth': 8, 
      'clf__min_samples_leaf': 8, 'clf__min_samples_split': 9}
      Best training accuracy: 0.855755894590846
      Test set accuracy score for best params: 0.8546042003231018

      Estimation grid_RandomForestClassifier_PCA
      Best params: {'clf__criterion': 'entropy', 'clf__max_depth': 7, 
      'clf__min_samples_leaf': 6, 'clf__min_samples_split': 3}
      Best training accuracy: 0.7489597780859917
      Test set accuracy score for best params: 0.691437802907916

      Estimation grid_KNN
      Best params: {'clf__n_neighbors': 10}
      Best training accuracy: 0.8037447988904299
      Test set accuracy score for best params: 0.778675282714055

      Estimation grid_KNN_PCA_
      Best params: {'clf__n_neighbors': 9}
      Best training accuracy: 0.7149791955617198
      Test set accuracy score for best params: 0.6882067851373183

      Estimation grid_SVC
      Best params: {'clf__C': 5, 'clf__gamma': 0.0001, 'clf__kernel': 'linear'}
      Best training accuracy: 0.8411927877947295
      Test set accuracy score for best params: 0.851373182552504

      Estimation grid_SVC_PCA
      Best params: {'clf__C': 1, 'clf__gamma': 1, 'clf__kernel': 'rbf'}
      Best training accuracy: 0.7323162274618585
      Test set accuracy score for best params: 0.6865912762520194

      Estimation grid_GaussianProcessClassifier
      Best params: {'clf__kernel': 1**2 * RBF(length_scale=1)}
      Best training accuracy: 0.8585298196948682
      Test set accuracy score for best params: 0.8675282714054927

      Estimation grid_GaussianProcessClassifier_PCA
      Best params: {'clf__kernel': 1**2 * RBF(length_scale=1)}
      Best training accuracy: 0.7295423023578363
      Test set accuracy score for best params: 0.7011308562197092

      Estimation grid_LogisticRegression
      Best params: {'clf__C': 0.1, 'clf__penalty': 'l1', 'clf__solver': 'liblinear'}
      Best training accuracy: 0.8349514563106796
      Test set accuracy score for best params: 0.8432956381260097

      Estimation grid_LogisticRegression_PCA
      Best params: {'clf__C': 0.1, 'clf__penalty': 'l1', 'clf__solver': 'liblinear'}
      Best training accuracy: 0.7267683772538142
      Test set accuracy score for best params: 0.7059773828756059

      Estimation grid_DecisionTreeClassifier
      Best params: {'clf__max_depth': 3}
      Best training accuracy: 0.8280166435506241
      Test set accuracy score for best params: 0.8481421647819063

      Estimation grid_DecisionTreeClassifier_PCA
      Best params: {'clf__max_depth': 6}
      Best training accuracy: 0.7246879334257975
      Test set accuracy score for best params: 0.6978998384491115

      Estimation grid_AdaBoostClassifier
      Best params: {'clf__n_estimators': 8}
      Best training accuracy: 0.8141470180305131
      Test set accuracy score for best params: 0.8222940226171244

      Estimation grid_AdaBoostClassifier_PCA
      Best params: {'clf__n_estimators': 22}
      Best training accuracy: 0.6768377253814147
      Test set accuracy score for best params: 0.6348949919224556

      Estimation grid_GaussianNB
      Best params: {'clf__priors': None}
      Best training accuracy: 0.7441054091539528
      Test set accuracy score for best params: 0.7544426494345718

      Estimation grid_GaussianNB_PCA
      Best params: {'clf__priors': None}
      Best training accuracy: 0.7205270457697642
      Test set accuracy score for best params: 0.7075928917609047

      Estimation grid_QuadraticDiscriminantAnalysis
      Best params: {'clf__priors': None}
      Best training accuracy: 0.7933425797503467
      Test set accuracy score for best params: 0.7883683360258481

      Estimation grid_QuadraticDiscriminantAnalysis_PCA
      Best params: {'clf__priors': None}
      Best training accuracy: 0.7191400832177531
      Test set accuracy score for best params: 0.7075928917609047

       Classifier with best test set accuracy: grid_GaussianProcessClassifier

Conclusion

You must note that this strategy is trading is a low frequency approach and this 
fits to make steady income over a period of time.
For high Frequency Trading the result of the return is quite high.

GOLD happens to give the most return on applied strategy(As shown in
the graphs above).
Also worthy of mention is the fact that, Random Forest Classifier + PCA 
in most cases performed better for stocks prices with both unsteady and steady rise. 
Followed Next to Adaboost, then Gradientbost Classifier.
In any case, the performance of an algorithm depends on the structure of 
the underlying prices. Its behaviour over a time series.
For different stocks different agorithm perform best.

contributions welcome

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].