All Projects → victor369basu → Real Time Stock Market Prediction

victor369basu / Real Time Stock Market Prediction

In this repository, I have developed the entire server-side principal architecture for real-time stock market prediction with Machine Learning. I have used Tensorflow.js for constructing ml model architecture, and Kafka for real-time data streaming and pipelining.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Real Time Stock Market Prediction

Stream Reactor
Streaming reference architecture for ETL with Kafka and Kafka-Connect. You can find more on http://lenses.io on how we provide a unified solution to manage your connectors, most advanced SQL engine for Kafka and Kafka Streams, cluster monitoring and alerting, and more.
Stars: ✭ 753 (+81.88%)
Mutual labels:  kafka, mongodb, streaming
Voik
♒︎ [WIP] An experimental ~distributed~ commit-log
Stars: ✭ 200 (-51.69%)
Mutual labels:  kafka, streaming
Firecamp
Serverless Platform for the stateful services
Stars: ✭ 194 (-53.14%)
Mutual labels:  kafka, mongodb
Dotnet New Caju
Learn Clean Architecture with .NET Core 3.0 🔥
Stars: ✭ 228 (-44.93%)
Mutual labels:  kafka, mongodb
Mongo Kafka
MongoDB Kafka Connector
Stars: ✭ 166 (-59.9%)
Mutual labels:  kafka, mongodb
Kafka Streams In Action
Source code for the Kafka Streams in Action Book
Stars: ✭ 167 (-59.66%)
Mutual labels:  kafka, streaming
Materialize
Materialize lets you ask questions of your live data, which it answers and then maintains for you as your data continue to change. The moment you need a refreshed answer, you can get it in milliseconds. Materialize is designed to help you interactively explore your streaming data, perform data warehousing analytics against live relational data, or just increase the freshness and reduce the load of your dashboard and monitoring tasks.
Stars: ✭ 3,341 (+707%)
Mutual labels:  kafka, streaming
Streamline
StreamLine - Streaming Analytics
Stars: ✭ 151 (-63.53%)
Mutual labels:  kafka, streaming
Data Accelerator
Data Accelerator for Apache Spark simplifies onboarding to Streaming of Big Data. It offers a rich, easy to use experience to help with creation, editing and management of Spark jobs on Azure HDInsights or Databricks while enabling the full power of the Spark engine.
Stars: ✭ 247 (-40.34%)
Mutual labels:  kafka, streaming
Kafka Connect Hdfs
Kafka Connect HDFS connector
Stars: ✭ 400 (-3.38%)
Mutual labels:  kafka, streaming
Zenko
Zenko is the open source multi-cloud data controller: own and keep control of your data on any cloud.
Stars: ✭ 353 (-14.73%)
Mutual labels:  kafka, mongodb
Event Sourcing Jambo
An Hexagonal Architecture with DDD + Aggregates + Event Sourcing using .NET Core, Kafka e MongoDB (Blog Engine)
Stars: ✭ 159 (-61.59%)
Mutual labels:  kafka, mongodb
Spring Boot Vue Bank
我,请始皇[打钱]是一个前后端分离的工具人系统,项目采用 SpringBoot+Go+Vue 开发,项目加入常见的企业级应用所涉及到的技术点,例如 Redis、RabbitMQ 等(主要是多用用工具多踩踩坑)。
Stars: ✭ 157 (-62.08%)
Mutual labels:  kafka, mongodb
Bigdata Playground
A complete example of a big data application using : Kubernetes (kops/aws), Apache Spark SQL/Streaming/MLib, Apache Flink, Scala, Python, Apache Kafka, Apache Hbase, Apache Parquet, Apache Avro, Apache Storm, Twitter Api, MongoDB, NodeJS, Angular, GraphQL
Stars: ✭ 177 (-57.25%)
Mutual labels:  kafka, mongodb
Redpanda
Redpanda is the real-time engine for modern apps. Kafka API Compatible; 10x faster 🚀 See more at vectorized.io/redpanda
Stars: ✭ 3,114 (+652.17%)
Mutual labels:  kafka, streaming
Hivemq Mqtt Tensorflow Kafka Realtime Iot Machine Learning Training Inference
Real Time Big Data / IoT Machine Learning (Model Training and Inference) with HiveMQ (MQTT), TensorFlow IO and Apache Kafka - no additional data store like S3, HDFS or Spark required
Stars: ✭ 204 (-50.72%)
Mutual labels:  kafka, mongodb
Spring Samples For All
spring、spring-boot、spring-cloud 常用整合用例
Stars: ✭ 401 (-3.14%)
Mutual labels:  kafka, mongodb
My Moments
Instagram Clone - Cloning Instagram for learning purpose
Stars: ✭ 140 (-66.18%)
Mutual labels:  kafka, mongodb
Supersafebank
Sample Event Sourcing implementation with .NET Core
Stars: ✭ 142 (-65.7%)
Mutual labels:  kafka, mongodb
Tributary
Streaming reactive and dataflow graphs in Python
Stars: ✭ 231 (-44.2%)
Mutual labels:  kafka, streaming

Server architecture for Real-time Stock-market prediction with ML

architecture In this repository, I have developed the entire server-side principal architecture for real-time stock market prediction with Machine Learning. I have used TensorFlow.js for constructing ml model architecture, and Kafka for real-time data streaming and pipelining.

Technologies used:

  1. Kafka.kafka
    • Pipelining logs from source to topics.
    • Topics are subscribed by consumer for real-time ml prediction and model training in parallel.
  2. TensorFlow.js.tf
    • Construction of tensorflow model in node.js.
    • Training model with time-series stock market data.
    • Use tfjs model for real-time prediction.
  3. MongoDB.mongodb
    • Update data-base with incoming stock market logs.
    • Use stored logs for analysis, and model training.
    • Store performance of the ml model for monitoring purpose.
  4. Node.js node
    • The entire server architecture is developed with node.js

Implementation

Start the Kafka environment

Start the ZooKeeper service.

$ bin/zookeeper-server-start.sh config/zookeeper.properties

Start the Kafka broker service

$ bin/kafka-server-start.sh config/server.properties

Start Streaming of logs.

Here, I have used .csv files in the dataset folder as the source of data. The data-source is pipelined with Kafka Topics. The first topic pipelines logs to MongoDB and the second topic pipelines logs to Tensorflow model for real-time prediction.
The streaming of logs from data-source through producer and consumer makes this architecture suitable for real-time analysis, ML model training and model prediction in parallel.
The producer could be started from

$ node producer.js
# or
$ start.sh

Streaming producer logs.
producer

$ node consumer.js

Streaming consumer logs.
consumer
In the consumer(consumer.js) the incoming logs are updated to MongoDB for further model training and analysis.

Machine Learning model.

The machine learning model architecture has been developed with TensorFlow.js. The model is trained with 80% of the stored data and validated against 20% of them. As the problem statement focuses over a time-series problem so we need to pre-process the data before training. Data have been pre-processed with MinMax-Scalar algorithm.
Training the ml model.

$ node tf_train.js
# or
$ server.sh
train Validating the model.
$ node tf_validate.js

train
After validation the real and predicted values along with date and attribute of the stock-market time-series data that the model is trained against are updated to the MongoDB.

Model performance chart from MongoDB

performance

Real-time prediction.

The weights of the trained model are saved and loaded at the consumer side that subscribes to the second topic of the Kafka stream and predicts the output of the time-series event in real-time. As both topics of the Kafka pipeline are working in parallel, parallelism is achieved and logs are streamed by Kafka is real-time, which indeed implies the machine learning model could train and predict target in real-time.

$ node ml_consumer.js
ml_consumer
Prediction [attribute] [predicted value].
example - Prediction Open 0.12453 

This line in the above image(ml_consumer.js output) indicates the prediction of the model in real-time. The model utilizes 7 prior time-series logs as input and predicts the 8th time-series event.

Future Scopes.

  1. I have created the server-side architecture of the model, for which the client-side also needed to be developed.
  2. I was researching on react.js for construction of the client-side, but I failed at some aspects due to which I left the client-side for future development.
  3. The code I have written could be further optimised for better architectural design and model performance.
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].