Implement Ml model for hotel site selection

parent c9441f4b
API_KEY_SECRET = 'AIzaSyDaKIG-n4pZpehuhvdbtIm4NdMM6ok5J64'
\ No newline at end of file
API_KEY_SECRET = 'AIzaSyB1ivN6aHzkc2hlBkZDYaK584jIy3i7Aac'
\ No newline at end of file
......@@ -40,7 +40,7 @@ const getTransportationModesCount = async (req, res) => {
const getBusStationCount = (latitude ,longitude) => {
var config = {
method: 'get',
url: `https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=${latitude},${longitude}&radius=3000&type=bus_station&keyword=&key=${process.env.API_KEY_SECRET}`,
url: `https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=${latitude},${longitude}&radius=1000&type=bus_station&keyword=bus_station&key=${process.env.API_KEY_SECRET}`,
headers: { }
};
......@@ -59,7 +59,7 @@ const getTrainStationCount = (latitude ,longitude) => {
var config = {
method: 'get',
url: `https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=${latitude},${longitude}&radius=1000&type=train_station&keyword=&key=${process.env.API_KEY_SECRET}`,
url: `https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=${latitude},${longitude}&radius=3000&type=train_station&keyword=&key=${process.env.API_KEY_SECRET}`,
headers: { }
};
......@@ -78,7 +78,7 @@ const getTrainStationCount = (latitude ,longitude) => {
var config = {
method: 'get',
url: `https://maps.googleapis.com/maps/api/place/nearbysearch/json?keyword=&location=${latitude},${longitude}&radius=2000&type=airport&key=${process.env.API_KEY_SECRET}`,
url: `https://maps.googleapis.com/maps/api/place/nearbysearch/json?keyword=&location=${latitude},${longitude}&radius=5000&type=airport&key=${process.env.API_KEY_SECRET}`,
headers: { }
};
......
web: gunicorn app:app
\ No newline at end of file
from flask import Flask,request,jsonify
import pickle
import numpy as np
# setup application
app = Flask(__name__)
#Hotel API
def predictionHotel(lst):
filename = 'model/RatingPredictor.pickle'
with open(filename, 'rb') as file:
model = pickle.load(file)
pred_value = model.predict([lst]).tolist()
return pred_value
@app.route('/hotel', methods=['POST', 'GET'])
def hotel():
pred=0
if request.method == 'POST':
Attraction_Place = request.json['Attraction_Place']
Transportation_Modes = request.json['Transportation_Modes']
if ( isinstance(Attraction_Place, int) and isinstance(Transportation_Modes, int) ):
feature_list = []
feature_list.append(int(Attraction_Place))
feature_list.append(int(Transportation_Modes))
pred = predictionHotel(feature_list)
print(pred)
return jsonify({'data': pred[0]})
else :
if(not isinstance(Attraction_Place, int)):
return jsonify({'Error': "Acttraction Place Missing !"})
else :
return jsonify({'Error': "Transportation Modes Missing!"})
#Temp Restaurant API
def predictionRestaurant(lst):
filename = 'model/RatingPredictor.pickle'
with open(filename, 'rb') as file:
model = pickle.load(file)
pred_value = model.predict([lst]).tolist()
return pred_value
@app.route('/res', methods=['POST', 'GET'])
def restaurant():
return jsonify({'data': "pred[0]"})
if __name__ =='__main__':
app.run(debug=True)
\ No newline at end of file
click==8.1.3
colorama==0.4.4
Flask==2.1.2
gunicorn==20.1.0
importlib-metadata==4.11.3
itsdangerous==2.1.2
Jinja2==3.1.2
joblib==1.1.0
MarkupSafe==2.1.1
numpy==1.22.3
scikit-learn==1.0.2
scipy==1.8.0
sklearn==0.0
threadpoolctl==3.1.0
Werkzeug==2.1.2
zipp==3.8.0
......@@ -18,7 +18,7 @@ Restaurant location is a key aspect in restaurant management success since it de
* *IT19177410* -
One of the most important decisions that the government must make in order to boost the Sri Lankan economy is to seek to increase foreign investment in Sri Lanka. Foreign investors, in particular, are focusing on the hotel and tourism industries in Sri Lanka. Thus, many investors are looking to start a hotel business in Sri Lanka. Finding the right place to start a hotel is a major challenge facing both local and foreign investors. The location of a hotel has a direct impact on its success. It is essential to find the right place at the beginning as it is not easy to change the location after starting the hotel.
* *IT19177410* -
* *IT19023410* -
In Sri Lankan health sector, pharmacies play an important role in delivering medicines, responsible advising and other targeted services. The geographical accessibility is a key dimension of access to medicines. And the accessibility to pharmacies is a major issue as having to travel long distances to reach them might threaten elderly access to medicines and healthcare advice. The importance, theory and principles of site selection of pharmacy were expounded and some concrete ideals about it were put forward accessibility and the availability of medicinal related places. By considering these factors, selecting a suitable place for a pharmacy increase the customer satisfaction and it increase the business profit as well.
......
......@@ -4,7 +4,6 @@ import CSVReader from 'react-csv-reader'
import API from './api';
import { CSVLink } from "react-csv";
import { ExportToCsv } from 'export-to-csv-file';
import { isBreakOrContinueStatement } from 'typescript';
function CreateRestaurantDataset() {
const options = {
......
......@@ -74,7 +74,7 @@ function Home() {
</GoogleMap>
</LoadScript>
</div>
<form onSubmit={(e) => onSubmit(e)}>
{/* <form onSubmit={(e) => onSubmit(e)}>
<label>
Latitude
<input type="text" value={latitude} onChange={e => setLatitude(e.target.value)} />
......@@ -84,7 +84,7 @@ function Home() {
<input type="text" value={longitude} onChange={e => setLongitude(e.target.value)} />
</label>
<input type="submit" value="Submit" />
</form>
</form> */}
</div>
</div>
);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment