2222< body >
2323 < h1 > AI-DataScience-Lab</ h1 >
2424 < h2 > Built with Pandas, scikit-learn, and OpenAI GPT-3.5 API</ h2 >
25- < h3 > < a href ="https://github.com/Hariprashad-Ravikumar/AI-DataScience-Lab " target ="_blank " style ="font-weight: normal; font-size: 16px; "> View source code and documentation on GitHub</ a > </ h3 >
25+ < h2 > (View source code on Hari's < a href ="https://github.com/Hariprashad-Ravikumar/AI-DataScience-Lab " target ="_blank " style ="font-weight: normal; font-size: 16px; "> GitHub</ a > ) </ h2 >
2626
2727 < div class ="section ">
2828 < form id ="uploadForm ">
@@ -134,26 +134,34 @@ <h3>Forecast Visualization</h3>
134134 progressFill . style . width = '100%' ;
135135 setTimeout ( ( ) => progressBar . style . display = 'none' , 500 ) ;
136136 } ) ;
137+ document . getElementById ( 'uploadForm' ) . addEventListener ( 'submit' , async function ( e ) {
138+ e . preventDefault ( ) ;
139+ const formData = new FormData ( ) ;
140+ formData . append ( 'file' , fileInput . files [ 0 ] ) ;
141+ formData . append ( 'x_column' , xColumn . value ) ;
142+ formData . append ( 'y_column' , yColumn . value ) ;
143+ formData . append ( 'model' , 'linear' ) ;
144+
145+ // Show and reset progress bar
146+ progressBar . style . display = 'block' ;
147+ progressFill . style . width = '20%' ;
148+
149+ const response = await fetch ( 'https://ai-dslab-backend-cpf2feachnetbbck.westus-01.azurewebsites.net/upload' , {
150+ method : 'POST' ,
151+ body : formData
152+ } ) ;
153+
154+ const data = await response . json ( ) ;
155+ progressFill . style . width = '100%' ;
156+ setTimeout ( ( ) => progressBar . style . display = 'none' , 500 ) ;
157+
158+ document . getElementById ( 'summary' ) . textContent = data . summary || '' ;
159+ document . getElementById ( 'log' ) . textContent = data . log || '' ;
160+ document . getElementById ( 'metrics' ) . textContent = `R² Score: ${ data . r2_score } \nMSE: ${ data . mse } ` ;
161+ document . getElementById ( 'plot' ) . src = data . plot_url ;
162+ document . getElementById ( 'plot' ) . style . display = 'block' ;
163+ } ) ;
137164
138- document . getElementById ( 'uploadForm' ) . addEventListener ( 'submit' , async function ( e ) {
139- e . preventDefault ( ) ;
140- const formData = new FormData ( ) ;
141- formData . append ( 'file' , fileInput . files [ 0 ] ) ;
142- formData . append ( 'x_column' , xColumn . value ) ;
143- formData . append ( 'y_column' , yColumn . value ) ;
144-
145- const response = await fetch ( 'https://ai-dslab-backend-cpf2feachnetbbck.westus-01.azurewebsites.net/upload' , {
146- method : 'POST' ,
147- body : formData
148- } ) ;
149-
150- const data = await response . json ( ) ;
151- document . getElementById ( 'summary' ) . textContent = data . summary || '' ;
152- document . getElementById ( 'log' ) . textContent = data . log || '' ;
153- document . getElementById ( 'metrics' ) . textContent = `R² Score: ${ data . r2_score } \nMSE: ${ data . mse } ` ;
154- document . getElementById ( 'plot' ) . src = data . plot_url ;
155- document . getElementById ( 'plot' ) . style . display = 'block' ;
156- } ) ;
157165
158166 document . getElementById ( 'predictForm' ) . addEventListener ( 'submit' , async function ( e ) {
159167 e . preventDefault ( ) ;
@@ -174,5 +182,10 @@ <h3>Forecast Visualization</h3>
174182 document . getElementById ( 'forecastPlot' ) . style . display = 'block' ;
175183 } ) ;
176184 </ script >
185+ < div class ="footer " style ="text-align: center; font-size: 14px; margin-top: 40px; color: #666; ">
186+ © 2025 Hariprashad Ravikumar · All rights reserved< br >
187+ < a href ="https://github.com/Hariprashad-Ravikumar " target ="_blank "> GitHub</ a > ·
188+ < a href ="https://hariprashad-ravikumar.github.io " target ="_blank "> Website</ a >
189+ </ div >
177190</ body >
178191</ html >
0 commit comments