Spaces:
Sleeping
Sleeping
Update README.md
Browse files
README.md
CHANGED
@@ -11,4 +11,45 @@ license: mit
|
|
11 |
short_description: To predict next number by sequence
|
12 |
---
|
13 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
11 |
short_description: To predict next number by sequence
|
12 |
---
|
13 |
|
14 |
+
# π’ Next Number Predictor using LSTM
|
15 |
+
|
16 |
+
This is a simple Gradio web app that uses a trained LSTM model to predict the **next number** in a sequence.
|
17 |
+
|
18 |
+
---
|
19 |
+
|
20 |
+
## π Features
|
21 |
+
|
22 |
+
- Predicts the next number given a fixed-length numeric sequence.
|
23 |
+
- Clean and interactive Gradio interface.
|
24 |
+
- Easy to run locally or deploy to platforms like Hugging Face Spaces.
|
25 |
+
|
26 |
+
---
|
27 |
+
|
28 |
+
## π Files Included
|
29 |
+
|
30 |
+
- `main.py` β The Gradio web app script.
|
31 |
+
- `requirements.txt` β Python dependencies.
|
32 |
+
- `next_number_model.h5` β Your trained LSTM model (not included in this repo β you must provide your own).
|
33 |
+
|
34 |
+
---
|
35 |
+
|
36 |
+
## π₯ Example Input
|
37 |
+
|
38 |
+
If your model was trained with a **window size of 3**, enter:
|
39 |
+
|
40 |
+
example code:
|
41 |
+
|
42 |
+
from tensorflow.keras.models import Sequential
|
43 |
+
from tensorflow.keras.layers import LSTM, Dense
|
44 |
+
|
45 |
+
model = Sequential([
|
46 |
+
LSTM(50, activation='relu', input_shape=(3, 1)),
|
47 |
+
Dense(1)
|
48 |
+
])
|
49 |
+
|
50 |
+
model.compile(optimizer='adam', loss='mse')
|
51 |
+
model.fit(X_train, y_train, epochs=200, verbose=1)
|
52 |
+
model.save("next_number_model.h5")
|
53 |
+
|
54 |
+
|
55 |
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|