File size: 2,371 Bytes
ce885e8
 
 
 
 
 
 
 
 
 
 
 
 
 
e1a3c3a
ce885e8
0192cf1
ce885e8
 
 
e917f3e
ce885e8
0058695
e917f3e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
---
license: apache-2.0
tags:
- keras
- time-series
- lstm
- regression
datasets:
- output8.csv
metrics:
- mean_squared_error
model_name: my_model
---

# bhaskar1

The above  model  is a simple neural network built using TensorFlow/Keras. It is designed to perform a regression task, which means it predicts continuous numeric values based on input features.



# Keras Model for Time Series Prediction

This repository contains a Keras model trained for time series prediction. 

## Model Overview

The model is a simple neural network built using Keras. It is designed to perform regression tasks, predicting a numeric value from input features.

### Architecture

- **Input Layer**: 10 neurons, ReLU activation
- **Hidden Layer**: 10 neurons, ReLU activation
- **Output Layer**: 1 neuron (for regression)

## How to Use the Model

To use this model, follow the steps below:

### 1. Install Required Libraries

Make sure you have the necessary libraries installed:

```bash
pip install tensorflow huggingface-hub pandas matplotlib

#load the model from the Hugging Face Hub:
import tensorflow as tf
from huggingface_hub import from_pretrained_keras
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt

# Load the model from Hugging Face Hub
model = from_pretrained_keras("iiitbh18/bhaskar1")

# Prepare Dummy Data

# Create a DataFrame with dummy data
dummy_data = {
    'timestamp': [
        '2024-08-07 02:43:28.788',
        '2024-08-07 02:43:28.788',
        '2024-08-07 02:43:43.788',
        '2024-08-07 02:43:43.788',
        '2024-08-07 02:43:58.788'
    ],
    'value': [
        99.00000005960464,
        98.90000000596046,
        98.70000004768372,
        99.00000005960464,
        98.89999993145466
    ]
}

df = pd.DataFrame(dummy_data)

#Prepare Data for Prediction

X_dummy = df['value'].values.reshape(-1, 1)  # Reshape to match model's input shape








# Make Predictions

predictions = model.predict(X_dummy)
print("Predictions:", predictions)

#Visualize the Results

# Plot actual vs. predicted values
plt.figure(figsize=(10, 6))
plt.scatter(df['timestamp'], df['value'], color='blue', label='Actual Values')
plt.scatter(df['timestamp'], predictions, color='red', label='Predicted Values')
plt.xlabel('Timestamp')
plt.ylabel('Value')
plt.title('Actual vs Predicted Values')
plt.legend()
plt.xticks(rotation=45)
plt.show()