// 10वें मिनट के लिए डेटा तैयार करें
const tenMinuteActual = {
Minute: 10,
Type: 'Actual',
Price: `123035.00`,
Time: '08:39 PM',
Error: '',
Accuracy: '60.00%',
PowerResult1: ''
};
const tenMinutePredicted = {
Minute: 10,
Type: 'Predicted',
Price: `123050.62`,
Time: '08:39 PM',
Error: '15.62',
Accuracy: '60.00%',
PowerResult1: ''
};
const cols = ['Minute', 'Type', 'Price', 'Time', 'Error', 'Accuracy', 'POWER RESULT 1'];
// टेबल हेडर बनाएँ
let html = '';
for (let c of cols) {
html += `${c} `;
}
html += ' ';
// Actual Row
html += '';
for (let c of cols) {
html += `${tenMinuteActual[c] || ''} `;
}
html += ' ';
// Predicted Row
html += '';
for (let c of cols) {
html += `${tenMinutePredicted[c] || ''} `;
}
html += ' ';
html += '';
// टेबल में HTML भरें (मान लें टेबल id="predictionTable" है)
document.getElementById('predictionTable').innerHTML = html;
# app.py from flask import Flask, jsonify import numpy as np import tensorflow as tf from tensorflow.keras.models import Sequential from tensorflow.keras.layers import LSTM, Dense import requests app = Flask(__name__) # Binance se last 60 minute price data fetch karna def fetch_binance_data(): url = "https://api.binance.com/api/v3/klines?symbol=BTCUSDT&interval=1m&limit=60" data = requests.get(url).json() closes = [float(item[4]) for item in data] return closes # LSTM input prepare karna sliding window ke form me def prepare_data(series, n_steps): X, y = [], [] for i in range(len(series) - n_steps): X.append(series[i:i+n_steps]) y.append(series[i+n_steps]) return np.array(X), np.array(y) # LSTM model train karna def train_model(series): n_steps = 10 X, y = prepare_data(series, n_steps) X = X.reshape((X.shape[0], X.shape[1], 1)) model = Sequential([ LSTM(50, activation='relu', input_shape=...
Comments
Post a Comment