[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-victor369basu--Real-time-stock-market-prediction":3,"tool-victor369basu--Real-time-stock-market-prediction":61},[4,18,28,36,45,53],{"id":5,"name":6,"github_repo":7,"description_zh":8,"stars":9,"difficulty_score":10,"last_commit_at":11,"category_tags":12,"status":17},4358,"openclaw","openclaw\u002Fopenclaw","OpenClaw 是一款专为个人打造的本地化 AI 助手，旨在让你在自己的设备上拥有完全可控的智能伙伴。它打破了传统 AI 助手局限于特定网页或应用的束缚，能够直接接入你日常使用的各类通讯渠道，包括微信、WhatsApp、Telegram、Discord、iMessage 等数十种平台。无论你在哪个聊天软件中发送消息，OpenClaw 都能即时响应，甚至支持在 macOS、iOS 和 Android 设备上进行语音交互，并提供实时的画布渲染功能供你操控。\n\n这款工具主要解决了用户对数据隐私、响应速度以及“始终在线”体验的需求。通过将 AI 部署在本地，用户无需依赖云端服务即可享受快速、私密的智能辅助，真正实现了“你的数据，你做主”。其独特的技术亮点在于强大的网关架构，将控制平面与核心助手分离，确保跨平台通信的流畅性与扩展性。\n\nOpenClaw 非常适合希望构建个性化工作流的技术爱好者、开发者，以及注重隐私保护且不愿被单一生态绑定的普通用户。只要具备基础的终端操作能力（支持 macOS、Linux 及 Windows WSL2），即可通过简单的命令行引导完成部署。如果你渴望拥有一个懂你",349277,3,"2026-04-06T06:32:30",[13,14,15,16],"Agent","开发框架","图像","数据工具","ready",{"id":19,"name":20,"github_repo":21,"description_zh":22,"stars":23,"difficulty_score":24,"last_commit_at":25,"category_tags":26,"status":17},9989,"n8n","n8n-io\u002Fn8n","n8n 是一款面向技术团队的公平代码（fair-code）工作流自动化平台，旨在让用户在享受低代码快速构建便利的同时，保留编写自定义代码的灵活性。它主要解决了传统自动化工具要么过于封闭难以扩展、要么完全依赖手写代码效率低下的痛点，帮助用户轻松连接 400 多种应用与服务，实现复杂业务流程的自动化。\n\nn8n 特别适合开发者、工程师以及具备一定技术背景的业务人员使用。其核心亮点在于“按需编码”：既可以通过直观的可视化界面拖拽节点搭建流程，也能随时插入 JavaScript 或 Python 代码、调用 npm 包来处理复杂逻辑。此外，n8n 原生集成了基于 LangChain 的 AI 能力，支持用户利用自有数据和模型构建智能体工作流。在部署方面，n8n 提供极高的自由度，支持完全自托管以保障数据隐私和控制权，也提供云端服务选项。凭借活跃的社区生态和数百个现成模板，n8n 让构建强大且可控的自动化系统变得简单高效。",184740,2,"2026-04-19T23:22:26",[16,14,13,15,27],"插件",{"id":29,"name":30,"github_repo":31,"description_zh":32,"stars":33,"difficulty_score":10,"last_commit_at":34,"category_tags":35,"status":17},3808,"stable-diffusion-webui","AUTOMATIC1111\u002Fstable-diffusion-webui","stable-diffusion-webui 是一个基于 Gradio 构建的网页版操作界面，旨在让用户能够轻松地在本地运行和使用强大的 Stable Diffusion 图像生成模型。它解决了原始模型依赖命令行、操作门槛高且功能分散的痛点，将复杂的 AI 绘图流程整合进一个直观易用的图形化平台。\n\n无论是希望快速上手的普通创作者、需要精细控制画面细节的设计师，还是想要深入探索模型潜力的开发者与研究人员，都能从中获益。其核心亮点在于极高的功能丰富度：不仅支持文生图、图生图、局部重绘（Inpainting）和外绘（Outpainting）等基础模式，还独创了注意力机制调整、提示词矩阵、负向提示词以及“高清修复”等高级功能。此外，它内置了 GFPGAN 和 CodeFormer 等人脸修复工具，支持多种神经网络放大算法，并允许用户通过插件系统无限扩展能力。即使是显存有限的设备，stable-diffusion-webui 也提供了相应的优化选项，让高质量的 AI 艺术创作变得触手可及。",162132,"2026-04-05T11:01:52",[14,15,13],{"id":37,"name":38,"github_repo":39,"description_zh":40,"stars":41,"difficulty_score":24,"last_commit_at":42,"category_tags":43,"status":17},1381,"everything-claude-code","affaan-m\u002Feverything-claude-code","everything-claude-code 是一套专为 AI 编程助手（如 Claude Code、Codex、Cursor 等）打造的高性能优化系统。它不仅仅是一组配置文件，而是一个经过长期实战打磨的完整框架，旨在解决 AI 代理在实际开发中面临的效率低下、记忆丢失、安全隐患及缺乏持续学习能力等核心痛点。\n\n通过引入技能模块化、直觉增强、记忆持久化机制以及内置的安全扫描功能，everything-claude-code 能显著提升 AI 在复杂任务中的表现，帮助开发者构建更稳定、更智能的生产级 AI 代理。其独特的“研究优先”开发理念和针对 Token 消耗的优化策略，使得模型响应更快、成本更低，同时有效防御潜在的攻击向量。\n\n这套工具特别适合软件开发者、AI 研究人员以及希望深度定制 AI 工作流的技术团队使用。无论您是在构建大型代码库，还是需要 AI 协助进行安全审计与自动化测试，everything-claude-code 都能提供强大的底层支持。作为一个曾荣获 Anthropic 黑客大奖的开源项目，它融合了多语言支持与丰富的实战钩子（hooks），让 AI 真正成长为懂上",161147,"2026-04-19T23:31:47",[14,13,44],"语言模型",{"id":46,"name":47,"github_repo":48,"description_zh":49,"stars":50,"difficulty_score":24,"last_commit_at":51,"category_tags":52,"status":17},2271,"ComfyUI","Comfy-Org\u002FComfyUI","ComfyUI 是一款功能强大且高度模块化的视觉 AI 引擎，专为设计和执行复杂的 Stable Diffusion 图像生成流程而打造。它摒弃了传统的代码编写模式，采用直观的节点式流程图界面，让用户通过连接不同的功能模块即可构建个性化的生成管线。\n\n这一设计巧妙解决了高级 AI 绘图工作流配置复杂、灵活性不足的痛点。用户无需具备编程背景，也能自由组合模型、调整参数并实时预览效果，轻松实现从基础文生图到多步骤高清修复等各类复杂任务。ComfyUI 拥有极佳的兼容性，不仅支持 Windows、macOS 和 Linux 全平台，还广泛适配 NVIDIA、AMD、Intel 及苹果 Silicon 等多种硬件架构，并率先支持 SDXL、Flux、SD3 等前沿模型。\n\n无论是希望深入探索算法潜力的研究人员和开发者，还是追求极致创作自由度的设计师与资深 AI 绘画爱好者，ComfyUI 都能提供强大的支持。其独特的模块化架构允许社区不断扩展新功能，使其成为当前最灵活、生态最丰富的开源扩散模型工具之一，帮助用户将创意高效转化为现实。",109154,"2026-04-18T11:18:24",[14,15,13],{"id":54,"name":55,"github_repo":56,"description_zh":57,"stars":58,"difficulty_score":24,"last_commit_at":59,"category_tags":60,"status":17},6121,"gemini-cli","google-gemini\u002Fgemini-cli","gemini-cli 是一款由谷歌推出的开源 AI 命令行工具，它将强大的 Gemini 大模型能力直接集成到用户的终端环境中。对于习惯在命令行工作的开发者而言，它提供了一条从输入提示词到获取模型响应的最短路径，无需切换窗口即可享受智能辅助。\n\n这款工具主要解决了开发过程中频繁上下文切换的痛点，让用户能在熟悉的终端界面内直接完成代码理解、生成、调试以及自动化运维任务。无论是查询大型代码库、根据草图生成应用，还是执行复杂的 Git 操作，gemini-cli 都能通过自然语言指令高效处理。\n\n它特别适合广大软件工程师、DevOps 人员及技术研究人员使用。其核心亮点包括支持高达 100 万 token 的超长上下文窗口，具备出色的逻辑推理能力；内置 Google 搜索、文件操作及 Shell 命令执行等实用工具；更独特的是，它支持 MCP（模型上下文协议），允许用户灵活扩展自定义集成，连接如图像生成等外部能力。此外，个人谷歌账号即可享受免费的额度支持，且项目基于 Apache 2.0 协议完全开源，是提升终端工作效率的理想助手。",100752,"2026-04-10T01:20:03",[27,13,15,14],{"id":62,"github_repo":63,"name":64,"description_en":65,"description_zh":66,"ai_summary_zh":66,"readme_en":67,"readme_zh":68,"quickstart_zh":69,"use_case_zh":70,"hero_image_url":71,"owner_login":72,"owner_name":73,"owner_avatar_url":74,"owner_bio":75,"owner_company":76,"owner_location":77,"owner_email":78,"owner_twitter":79,"owner_website":80,"owner_url":81,"languages":82,"stars":91,"forks":92,"last_commit_at":93,"license":94,"difficulty_score":95,"env_os":96,"env_gpu":96,"env_ram":96,"env_deps":97,"category_tags":105,"github_topics":106,"view_count":24,"oss_zip_url":94,"oss_zip_packed_at":94,"status":17,"created_at":116,"updated_at":117,"faqs":118,"releases":129},9921,"victor369basu\u002FReal-time-stock-market-prediction","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.","Real-time-stock-market-prediction 是一套基于机器学习的实时股市预测服务器端架构方案。它旨在解决传统金融分析中数据处理滞后、难以兼顾模型训练与实时推断的痛点，通过流式处理技术实现了对股市时间序列数据的即时分析与走势预判。\n\n该项目非常适合后端开发者、数据工程师以及对量化交易感兴趣的研究人员使用。其核心亮点在于巧妙结合了 Kafka 与 TensorFlow.js：利用 Kafka 构建高吞吐的数据管道，将日志流并行分发至数据库存储与模型推理两端；同时直接在 Node.js 环境中运用 TensorFlow.js 构建并运行深度学习模型，无需依赖重型 Python 服务。这种设计不仅实现了数据从采集、清洗（采用 MinMax-Scalar 算法）、存储到预测的全链路实时化，还确保了模型训练与新数据预测能够同步进行，为构建低延迟的智能交易系统提供了清晰的技术参考与实践范例。","# Server architecture for Real-time Stock-market prediction with ML\n\u003Cimg align=\"center\" alt=\"architecture\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fvictor369basu_Real-time-stock-market-prediction_readme_fe93151ccede.png\" \u002F>\nIn 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.\n\n## Technologies used:\n 1. Kafka.\u003Cimg align=\"left\" alt=\"kafka\" width=\"26px\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fvictor369basu_Real-time-stock-market-prediction_readme_cac8cbbdfde0.jpg\" \u002F>\u003Cbr>\n    - Pipelining logs from source to topics.\n    - Topics are subscribed by consumer for real-time ml prediction and model training in parallel.\n 2. TensorFlow.js.\u003Cimg align=\"left\" alt=\"tf\" width=\"26px\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fvictor369basu_Real-time-stock-market-prediction_readme_3e887dcf448f.png\" \u002F>\u003Cbr>\n    - Construction of tensorflow model in node.js.\n    - Training model with time-series stock market data.\n    - Use tfjs model for real-time prediction.\n 3. MongoDB.\u003Cimg align=\"left\" alt=\"mongodb\" width=\"26px\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fvictor369basu_Real-time-stock-market-prediction_readme_60605a1a458a.png\" \u002F>\u003Cbr>\n    - Update data-base with incoming stock market logs.\n    - Use stored logs for analysis, and model training.\n    - Store performance of the ml model for monitoring purpose.\n 4. Node.js \u003Cimg align=\"left\" alt=\"node\" width=\"26px\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fvictor369basu_Real-time-stock-market-prediction_readme_85458a6717be.png\" \u002F>\u003Cbr>\n    - The entire server architecture is developed with node.js\n\n## Implementation\n\n### Start the Kafka environment\nStart the ZooKeeper service.\n```sh\n$ bin\u002Fzookeeper-server-start.sh config\u002Fzookeeper.properties\n```\nStart the Kafka broker service\n```sh\n$ bin\u002Fkafka-server-start.sh config\u002Fserver.properties\n```\n\n### Start Streaming of logs.\n\nHere, 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.\u003Cbr>\nThe 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.\u003Cbr>\nThe producer could be started from\n```sh\n$ node producer.js\n# or\n$ start.sh\n```\nStreaming producer logs.\u003Cbr>\n\u003Cimg align=\"center\" alt=\"producer\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fvictor369basu_Real-time-stock-market-prediction_readme_b58c74fb2935.png\" \u002F>\n\u003Cbr>\n```sh\n$ node consumer.js\n```\nStreaming consumer logs.\u003Cbr>\n\u003Cimg align=\"center\" alt=\"consumer\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fvictor369basu_Real-time-stock-market-prediction_readme_cd46a09dfd97.png\" \u002F>\n\u003Cbr>\nIn the __consumer__(consumer.js) the incoming logs are updated to MongoDB for further model training and analysis.\n\n### Machine Learning model.\n\nThe 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.\u003Cbr>\nTraining the ml model.\n```sh\n$ node tf_train.js\n# or\n$ server.sh\n```\n\u003Cimg align=\"center\" alt=\"train\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fvictor369basu_Real-time-stock-market-prediction_readme_89dbfecb8e24.png\" \u002F>\nValidating the model.\n\n```sh\n$ node tf_validate.js\n```\n\n\u003Cimg align=\"center\" alt=\"train\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fvictor369basu_Real-time-stock-market-prediction_readme_893e11474e40.png\" \u002F>\u003Cbr>\nAfter 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.\u003Cbr>\n### Model performance chart from MongoDB\n\u003Cimg align=\"center\" alt=\"performance\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fvictor369basu_Real-time-stock-market-prediction_readme_b65ff9ef9b1c.png\" \u002F>\n\n### Real-time prediction.\nThe 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.\n```sh\n$ node ml_consumer.js\n```\n\u003Cimg align=\"center\" alt=\"ml_consumer\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fvictor369basu_Real-time-stock-market-prediction_readme_30bfd01a312c.png\" \u002F>\n\n```\nPrediction [attribute] [predicted value].\nexample - Prediction Open 0.12453 \n```\nThis 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. \n\n\n## Future Scopes.\n\n1. I have created the server-side architecture of the model, for which the client-side also needed to be developed.\n2. 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.\n3. The code I have written could be further optimised for better architectural design and model performance.","# 基于机器学习的实时股市预测服务器架构\n\u003Cimg align=\"center\" alt=\"architecture\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fvictor369basu_Real-time-stock-market-prediction_readme_fe93151ccede.png\" \u002F>\n在这个仓库中，我开发了完整的基于机器学习的实时股市预测服务器端主架构。我使用 TensorFlow.js 构建了机器学习模型架构，并利用 Kafka 实现实时数据流和管道处理。\n\n## 使用的技术：\n1. Kafka。\u003Cimg align=\"left\" alt=\"kafka\" width=\"26px\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fvictor369basu_Real-time-stock-market-prediction_readme_cac8cbbdfde0.jpg\" \u002F>\u003Cbr>\n   - 将日志从数据源高效地传输到各个主题。\n   - 消费者订阅这些主题，以实现实时机器学习预测与模型训练的并行操作。\n2. TensorFlow.js。\u003Cimg align=\"left\" alt=\"tf\" width=\"26px\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fvictor369basu_Real-time-stock-market-prediction_readme_3e887dcf448f.png\" \u002F>\u003Cbr>\n   - 在 Node.js 环境中构建 TensorFlow 模型。\n   - 利用时间序列的股市数据对模型进行训练。\n   - 使用 TensorFlow.js 模型进行实时预测。\n3. MongoDB。\u003Cimg align=\"left\" alt=\"mongodb\" width=\"26px\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fvictor369basu_Real-time-stock-market-prediction_readme_60605a1a458a.png\" \u002F>\u003Cbr>\n   - 将传入的股市日志更新至数据库。\n   - 利用存储的日志进行分析及模型训练。\n   - 存储机器学习模型的性能指标，以便监控。\n4. Node.js \u003Cimg align=\"left\" alt=\"node\" width=\"26px\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fvictor369basu_Real-time-stock-market-prediction_readme_85458a6717be.png\" \u002F>\u003Cbr>\n   - 整个服务器架构均采用 Node.js 开发。\n\n## 实现步骤\n\n### 启动 Kafka 环境\n首先启动 ZooKeeper 服务：\n```sh\n$ bin\u002Fzookeeper-server-start.sh config\u002Fzookeeper.properties\n```\n然后启动 Kafka Broker 服务：\n```sh\n$ bin\u002Fkafka-server-start.sh config\u002Fserver.properties\n```\n\n### 开始日志流式传输\n\n在此项目中，我使用 `dataset` 文件夹下的 CSV 文件作为数据源。数据通过 Kafka 主题进行管道化处理：第一个主题将日志传输至 MongoDB，而第二个主题则将日志发送至 TensorFlow 模型，用于实时预测。\u003Cbr>\n通过生产者和消费者对数据源进行流式传输，该架构非常适合同时进行实时分析、机器学习模型训练以及模型预测。\u003Cbr>\n生产者可以通过以下命令启动：\n```sh\n$ node producer.js\n# 或\n$ start.sh\n```\n生产者正在流式传输日志。\u003Cbr>\n\u003Cimg align=\"center\" alt=\"producer\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fvictor369basu_Real-time-stock-market-prediction_readme_b58c74fb2935.png\" \u002F>\n\u003Cbr>\n```sh\n$ node consumer.js\n```\n消费者正在流式传输日志。\u003Cbr>\n\u003Cimg align=\"center\" alt=\"consumer\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fvictor369basu_Real-time-stock-market-prediction_readme_cd46a09dfd97.png\" \u002F>\n\u003Cbr>\n在消费者（`consumer.js`）中，接收到的日志会被更新到 MongoDB 数据库，以供后续的模型训练和分析使用。\n\n### 机器学习模型\n\n机器学习模型架构是使用 TensorFlow.js 开发的。模型使用 80% 的存储数据进行训练，并用剩余的 20% 数据进行验证。由于本问题属于时间序列问题，因此在训练前需要对数据进行预处理。数据预处理采用了 **MinMax-Scalar** 算法。\u003Cbr>\n训练机器学习模型：\n```sh\n$ node tf_train.js\n# 或\n$ server.sh\n```\n\u003Cimg align=\"center\" alt=\"train\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fvictor369basu_Real-time-stock-market-prediction_readme_89dbfecb8e24.png\" \u002F>\n模型验证：\n```sh\n$ node tf_validate.js\n```\n\u003Cimg align=\"center\" alt=\"validate\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fvictor369basu_Real-time-stock-market-prediction_readme_893e11474e40.png\" \u002F>\u003Cbr>\n验证完成后，模型的真实值、预测值以及对应的时间序列数据的日期和属性都会被更新到 MongoDB 数据库中。\u003Cbr>\n\n### 从 MongoDB 获取的模型性能图表\n\u003Cimg align=\"center\" alt=\"performance\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fvictor369basu_Real-time-stock-market-prediction_readme_b65ff9ef9b1c.png\" \u002F>\n\n### 实时预测\n\n训练好的模型权重会被保存并在消费者端加载。消费者订阅 Kafka 流中的第二个主题，从而能够实时预测时间序列事件的结果。由于 Kafka 管道中的两个主题可以并行工作，且日志以实时方式流经 Kafka，因此机器学习模型能够在实时环境中完成训练和预测任务。\n```sh\n$ node ml_consumer.js\n```\n\u003Cimg align=\"center\" alt=\"ml_consumer\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fvictor369basu_Real-time-stock-market-prediction_readme_30bfd01a312c.png\" \u002F>\n```\n预测 [属性] [预测值]。\n例如 - 预测开盘价 0.12453\n```\n上图中显示的这行内容即为模型的实时预测结果。模型以过去 7 个时间序列日志作为输入，预测第 8 个时间序列事件。\n\n## 未来展望\n\n1. 目前已完成模型的服务器端架构，接下来还需要开发客户端部分。\n2. 我曾尝试使用 React.js 构建客户端界面，但由于某些技术难点未能成功，因此暂时搁置了客户端的开发，留待未来完善。\n3. 当前编写的代码还可以进一步优化，以提升架构设计和模型性能。","# Real-time-stock-market-prediction 快速上手指南\n\n本指南帮助开发者快速搭建基于 Kafka、TensorFlow.js 和 MongoDB 的实时股市预测服务端架构。\n\n## 环境准备\n\n在开始之前，请确保您的开发环境满足以下要求：\n\n*   **操作系统**: Linux 或 macOS (Windows 用户建议使用 WSL2)\n*   **Node.js**: 已安装 Node.js 运行环境 (推荐 LTS 版本)\n*   **Apache Kafka**: 已下载并配置 Kafka 安装包 (包含 ZooKeeper)\n*   **MongoDB**: 已安装并启动 MongoDB 服务\n*   **依赖安装**: 在项目根目录下运行 `npm install` 安装所需节点模块\n\n## 安装与启动步骤\n\n### 1. 启动 Kafka 环境\n首先需要在终端中依次启动 ZooKeeper 和 Kafka Broker 服务。请进入 Kafka 安装目录执行以下命令：\n\n```sh\n$ bin\u002Fzookeeper-server-start.sh config\u002Fzookeeper.properties\n```\n\n```sh\n$ bin\u002Fkafka-server-start.sh config\u002Fserver.properties\n```\n\n### 2. 启动数据流 (Streaming)\n本项目使用 `dataset` 文件夹中的 `.csv` 文件作为数据源。生产者将数据推送至 Kafka Topic，消费者订阅 Topic 并将数据存入 MongoDB 或用于实时预测。\n\n**启动生产者 (Producer):**\n```sh\n$ node producer.js\n# 或\n$ start.sh\n```\n\n**启动基础消费者 (Consumer):**\n该消费者负责接收日志并更新到 MongoDB，用于后续模型训练和分析。\n```sh\n$ node consumer.js\n```\n\n### 3. 机器学习模型训练与验证\n模型基于 TensorFlow.js 构建，使用 MinMax-Scaler 算法对时间序列数据进行预处理。默认使用 80% 的数据进行训练，20% 用于验证。\n\n**训练模型:**\n```sh\n$ node tf_train.js\n# 或\n$ server.sh\n```\n\n**验证模型:**\n验证完成后，真实值、预测值及相关属性将自动更新至 MongoDB。\n```sh\n$ node tf_validate.js\n```\n\n## 基本使用\n\n完成上述步骤后，即可进行实时预测。加载已训练好的模型权重，订阅 Kafka 的第二个 Topic，系统将根据前 7 个时间序列日志实时预测第 8 个事件。\n\n**启动实时预测消费者:**\n```sh\n$ node ml_consumer.js\n```\n\n**输出示例:**\n终端将实时输出预测结果，格式如下：\n```text\nPrediction [attribute] [predicted value].\nexample - Prediction Open 0.12453 \n```\n\n此时，系统已实现数据流采集、存储、模型训练与实时推理的并行处理。您可以查看 MongoDB 中的 `MLCharts` 相关集合来监控模型性能图表。","某量化交易团队需要为高频短线策略构建一套能实时处理市场数据并即时输出预测结果的后端系统。\n\n### 没有 Real-time-stock-market-prediction 时\n- **数据延迟严重**：依赖传统的批量数据处理流程，从获取行情到完成分析往往滞后数分钟，无法捕捉瞬息万变的短线交易机会。\n- **架构耦合度高**：数据入库、模型训练与实时预测串行执行，一旦进行模型重训，实时预测服务必须暂停，导致交易信号中断。\n- **技术栈割裂**：后端主要使用 Node.js，而机器学习模型多由 Python 编写，跨语言调用增加了部署复杂度和通信开销，难以维护。\n- **缺乏监控闭环**：预测结果与历史表现分散存储，难以实时对比模型准确度，无法快速发现模型失效或市场风格漂移。\n\n### 使用 Real-time-stock-market-prediction 后\n- **毫秒级实时响应**：利用 Kafka 构建流式管道，行情数据一经产生即被推送至消费端，配合 TensorFlow.js 实现毫秒级的实时股价预测。\n- **并行处理架构**：通过 Kafka Topic 将数据流同时分发给 MongoDB 用于持久化分析和 TensorFlow 模型用于预测，实现了训练与推理的完全并行互不干扰。\n- **全栈 JavaScript 统一**：直接在 Node.js 环境中使用 TensorFlow.js 构建和运行模型，消除了跨语言调用的性能损耗，大幅简化了服务器架构。\n- **自动化性能监控**：预测值与真实值自动回写 MongoDB 并生成性能图表，团队可实时监控模型误差，确保策略始终基于最新市场状态运行。\n\nReal-time-stock-market-prediction 通过 Kafka 流式架构与 TensorFlow.js 的无缝集成，将原本滞后的离线分析转变为高并发、低延迟的实时智能决策引擎。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fvictor369basu_Real-time-stock-market-prediction_aa057dc6.png","victor369basu","Victor Basu","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002Fvictor369basu_7cd95518.jpg","Hello! I'm a passionate Data Scientist and Machine Learning Engineer with a strong background in turning data into actionable insights and building intelligent.","Lumiq.ai","India","basu369victor@gmail.com","victor_basu_360","https:\u002F\u002Flinktr.ee\u002FVictor.Basu","https:\u002F\u002Fgithub.com\u002Fvictor369basu",[83,87],{"name":84,"color":85,"percentage":86},"JavaScript","#f1e05a",100,{"name":88,"color":89,"percentage":90},"Shell","#89e051",0,648,122,"2026-04-17T10:11:53",null,4,"未说明",{"notes":98,"python":99,"dependencies":100},"该项目完全基于 Node.js 构建，不使用 Python。运行前需手动启动 ZooKeeper 和 Kafka Broker 服务。数据源为 CSV 文件，模型使用 MinMax-Scaler 进行预处理，利用过去 7 个时间序列日志预测第 8 个事件。README 中未提供具体的硬件配置要求。","不需要 (基于 Node.js)",[101,102,103,104],"Node.js","TensorFlow.js","Kafka","MongoDB",[14],[107,108,109,110,111,112,113,114,115],"kafka","streaming","tensorflow","tensorflowjs","tensorflowjs-models","nodejs","mongodb","machine-learning","deep-learning","2026-03-27T02:49:30.150509","2026-04-20T10:37:23.151231",[119,124],{"id":120,"question_zh":121,"answer_zh":122,"source_url":123},44536,"如何运行该项目？","首先安装所有依赖项，然后启动 Zookeeper 和 Kafka。如果在运行 `node producer.js` 时遇到 `package.json` 解析错误（如 Unexpected token }），请检查并修复 `package.json` 文件中的语法错误（通常是多余或缺失的大括号）。维护者已确认修复了该文件的语法错误，更新后应可正常运行。","https:\u002F\u002Fgithub.com\u002Fvictor369basu\u002FReal-time-stock-market-prediction\u002Fissues\u002F2",{"id":125,"question_zh":126,"answer_zh":127,"source_url":128},44537,"是否可以用 React 重新构建前端？","可以。维护者欢迎用户使用 React 为该项目建设前端应用，但请求在成品中注明原作者的贡献（credits）。此外，社区建议可以结合 Alpaca Paper Trading API 进行集成测试。","https:\u002F\u002Fgithub.com\u002Fvictor369basu\u002FReal-time-stock-market-prediction\u002Fissues\u002F4",[]]