39
loading...
This website collects cookies to deliver better user experience
Copy the model and api directory to the root of the predictive folder. Your project structure should look like this.
Open terminal one, navigate to the api directory and run the command below
python main.py
Install the axios npm package for api communications.
yarn add axios
Open a second terminal and run the below command
yarn start
Open the browser and visit localhost:3000
const handleSubmit = (e) => {
e.preventDefault()
// Parameters
const params = { gender, bsc, workex, etest_p, msc }
axios
.post('http://localhost:8080/prediction', params)
.then((res) => {
const data = res.data.data
const parameters = JSON.stringify(params)
const msg = `Prediction: ${data.prediction}\nInterpretation: ${data.interpretation}\nParameters: ${parameters}`
alert(msg)
reset()
})
.catch((error) => alert(`Error: ${error.message}`))
}
import Glass from './components/Glass'
function App() {
return (
<div className="app">
<Glass/>
</div>
);
}
export default App;