musk12 commited on
Commit
6162089
·
verified ·
1 Parent(s): cc4526e

Upload 4 files

Browse files
Files changed (4) hide show
  1. add.csv +23 -0
  2. add_app.py +51 -0
  3. model.pkl +3 -0
  4. requirements.txt +5 -0
add.csv ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ x,y,sum
2
+ 1,1,2
3
+ 4,4,8
4
+ 6,6,12
5
+ 10,10,20
6
+ 30,30,60
7
+ 23,43,66
8
+ 55,80,135
9
+ 100,22,122
10
+ 23,45,68
11
+ 56,78,134
12
+ 13,78,91
13
+ 300,34,334
14
+ 12.5,56.7,69.2
15
+ 23.6,89.3,112.9
16
+ 67.8,87.9,155.7
17
+ 200,700,900
18
+ 203.6,67.9,271.5
19
+ 400,45.7,445.7
20
+ 34.6,56.9,91.5
21
+ 400.5,356,756.5
22
+ 45.7,123.7,169.4
23
+ 1000,3456,4456
add_app.py ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import numpy as np
2
+ import pandas as pd
3
+ import matplotlib.pyplot as plt
4
+ import streamlit as st
5
+ import pickle
6
+
7
+ from sklearn.linear_model import LinearRegression
8
+ from sklearn.metrics import r2_score
9
+ from sklearn.model_selection import train_test_split
10
+
11
+ #st.title("ML Two Number Addition Web App")
12
+ st.markdown('<p style="color: red; font-size: 45px; font-weight: bold;">ML Two Number Addition Web App</p>', unsafe_allow_html=True)
13
+ col1, col2, col3 = st.columns(3)
14
+ with col2:
15
+ st.markdown('<p style="color: cyan; font-size: 20px; font-weight: bold;">Using Linear Regression</p>', unsafe_allow_html=True)
16
+
17
+ # Load the trained model from the pickle file
18
+ with open("model.pkl", "rb") as file:
19
+ model = pickle.load(file)
20
+
21
+ df = pd.read_csv("add.csv")
22
+
23
+ st.markdown("****")
24
+
25
+ col1, col2 = st.columns(2)
26
+
27
+ with col1:
28
+ st.header(":green[Number 1]")
29
+ num1 = st.number_input('Enter First number here')
30
+
31
+ with col2:
32
+ st.header(":green[Number 2]")
33
+ num2 = st.number_input("Enter Second number here")
34
+
35
+ st.markdown("****")
36
+
37
+ col1, col2, col3, col4, col5 = st.columns(5)
38
+
39
+ with col3:
40
+
41
+ if st.button('Predict'):
42
+ features = np.array([num1, num2])
43
+ prediction = model.predict([features])
44
+
45
+ col1, col2, col3, col4, col5 = st.columns(5)
46
+ with col1:
47
+ st.header(":blue[SUM] ")
48
+ with col5:
49
+ st.header(np.round(prediction[0],4))
50
+
51
+ st.markdown("****")
model.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:87658bd81f9fea4628c853ecb38609f5e29e75b12bd9e4e04bfb5901899e4342
3
+ size 530
requirements.txt ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ numpy==1.26.3
2
+ pandas==2.1.4
3
+ matplotlib==3.8.2
4
+ streamlit==1.29.0
5
+ scikit-learn==1.4.0