Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
2
2022-257
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
2022-257
2022-257
Commits
7892e6c4
Commit
7892e6c4
authored
Oct 11, 2022
by
Madhura Mihiranga H.N. IT19177410
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
location based ml part intregration
parent
fcfefc9f
Changes
12
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
548 additions
and
33 deletions
+548
-33
ML_Backend/app.py
ML_Backend/app.py
+94
-0
ML_Backend/model/HotelLocationSuccessPredictor.pickle
ML_Backend/model/HotelLocationSuccessPredictor.pickle
+0
-0
ML_Backend/model/RestaurantRatingSuccessPredicto.pickle
ML_Backend/model/RestaurantRatingSuccessPredicto.pickle
+0
-0
bussifinder/package-lock.json
bussifinder/package-lock.json
+18
-0
bussifinder/package.json
bussifinder/package.json
+2
-0
bussifinder/src/App.js
bussifinder/src/App.js
+2
-0
bussifinder/src/Home.js
bussifinder/src/Home.js
+1
-0
bussifinder/src/components/BusinessTypePage.js
bussifinder/src/components/BusinessTypePage.js
+7
-2
bussifinder/src/components/Hotel Input/InputDetails.js
bussifinder/src/components/Hotel Input/InputDetails.js
+55
-8
bussifinder/src/components/InputHotelDetails.js
bussifinder/src/components/InputHotelDetails.js
+1
-0
bussifinder/src/components/LocationBasedPredict.js
bussifinder/src/components/LocationBasedPredict.js
+339
-0
bussifinder/src/components/ResultsWOTypes.js
bussifinder/src/components/ResultsWOTypes.js
+29
-23
No files found.
ML_Backend/app.py
View file @
7892e6c4
...
...
@@ -61,6 +61,49 @@ def hotel():
# Location Based Hotel Prediction
def
predictionHotelLB
(
lst
):
filename
=
'model/HotelLocationSuccessPredictor.pickle'
with
open
(
filename
,
'rb'
)
as
file
:
model
=
pickle
.
load
(
file
)
pred_value
=
model
.
predict
([
lst
])
.
tolist
()
return
pred_value
@
app
.
route
(
'/hotelLocationBase'
,
methods
=
[
'POST'
,
'GET'
])
def
hotelLB
():
pred
=
0
if
request
.
method
==
'POST'
:
Attraction_Place
=
request
.
json
[
'AttractionPlace'
]
Transportation_Modes
=
request
.
json
[
'TransportationModes'
]
NearByHotelReviewCount
=
request
.
json
[
'NearByHotelReviewCount'
]
CompetitorsCount
=
request
.
json
[
'CompetitorsCount'
]
if
(
isinstance
(
Attraction_Place
,
int
)
and
isinstance
(
Transportation_Modes
,
int
)
):
feature_list
=
[]
feature_list
.
append
(
int
(
CompetitorsCount
))
feature_list
.
append
(
int
(
Transportation_Modes
))
feature_list
.
append
(
int
(
Attraction_Place
))
feature_list
.
append
(
int
(
NearByHotelReviewCount
))
pred
=
predictionHotelLB
(
feature_list
)
print
(
pred
)
return
jsonify
({
'data'
:
pred
[
0
]})
else
:
if
(
not
isinstance
(
Attraction_Place
,
int
)):
return
jsonify
({
'Error'
:
"Acttraction Places Are Missing !"
})
else
:
return
jsonify
({
'Error'
:
"Transportation Modes Are Missing!"
})
#Restaurant API
def
predictionRestaurant
(
lst
):
...
...
@@ -109,6 +152,57 @@ def restaurant():
return
jsonify
({
'Error'
:
"Distance To City Is Missing!"
})
# Location Based Restaurant API
def
predictionRestaurantLB
(
lst
):
filename
=
'model/RestaurantRatingSuccessPredicto.pickle'
with
open
(
filename
,
'rb'
)
as
file
:
model
=
pickle
.
load
(
file
)
pred_value
=
model
.
predict
([
lst
])
.
tolist
()
return
pred_value
@
app
.
route
(
'/restaurantLocationBase'
,
methods
=
[
'POST'
,
'GET'
])
def
restaurantLB
():
if
request
.
method
==
'POST'
:
ShoppingMallsCount
=
request
.
json
[
'ShoppingMallsCount'
]
EducationRelatedPlacesCount
=
request
.
json
[
'EducationRelatedPlacesCount'
]
WorkPlacesCount
=
request
.
json
[
'WorkPlacesCount'
]
CompetitorsCount
=
request
.
json
[
'CompetitorsCount'
]
DistanceToCity
=
request
.
json
[
'DistanceToCity'
]
if
(
isinstance
(
ShoppingMallsCount
,
int
)
and
(
isinstance
(
DistanceToCity
,
float
)
or
isinstance
(
DistanceToCity
,
int
)
)
):
feature_list
=
[]
feature_list
.
append
(
int
(
ShoppingMallsCount
))
feature_list
.
append
(
int
(
EducationRelatedPlacesCount
))
feature_list
.
append
(
int
(
WorkPlacesCount
))
feature_list
.
append
(
int
(
CompetitorsCount
))
feature_list
.
append
(
float
(
DistanceToCity
))
# if(isinstance(Distance_ToCity, float)):
# feature_list.append(float(Distance_ToCity))
# else:
# feature_list.append(int(Distance_ToCity))
pred
=
predictionRestaurantLB
(
feature_list
)
print
(
pred
)
return
jsonify
({
'data'
:
pred
[
0
]})
else
:
if
(
not
isinstance
(
ShoppingMallsCount
,
int
)):
return
jsonify
({
'Error'
:
"Shoping Area's Are Missing !"
})
else
:
return
jsonify
({
'Error'
:
"Distance To City Is Missing!"
})
#Pharmacy API
def
predictionPharmacy
(
lst
):
...
...
ML_Backend/model/HotelLocationSuccessPredictor.pickle
0 → 100644
View file @
7892e6c4
File added
ML_Backend/model/RestaurantRatingSuccessPredicto.pickle
0 → 100644
View file @
7892e6c4
File added
bussifinder/package-lock.json
View file @
7892e6c4
...
...
@@ -6859,6 +6859,11 @@
"slash"
:
"^3.0.0"
}
},
"goober"
:
{
"version"
:
"2.1.11"
,
"resolved"
:
"https://registry.npmjs.org/goober/-/goober-2.1.11.tgz"
,
"integrity"
:
"sha512-5SS2lmxbhqH0u9ABEWq7WPU69a4i2pYcHeCxqaNq6Cw3mnrF0ghWNM4tEGid4dKy8XNIAUbuThuozDHHKJVh3A=="
},
"google-maps-infobox"
:
{
"version"
:
"2.0.0"
,
"resolved"
:
"https://registry.npmjs.org/google-maps-infobox/-/google-maps-infobox-2.0.0.tgz"
,
...
...
@@ -11083,6 +11088,14 @@
"resolved"
:
"https://registry.npmjs.org/react-chartjs-2/-/react-chartjs-2-4.3.1.tgz"
,
"integrity"
:
"sha512-5i3mjP6tU7QSn0jvb8I4hudTzHJqS8l00ORJnVwI2sYu0ihpj83Lv2YzfxunfxTZkscKvZu2F2w9LkwNBhj6xA=="
},
"react-cssfx-loading"
:
{
"version"
:
"2.1.0"
,
"resolved"
:
"https://registry.npmjs.org/react-cssfx-loading/-/react-cssfx-loading-2.1.0.tgz"
,
"integrity"
:
"sha512-0SnS6HpaeLSaTxNuND6sAKTQmoKgjwFb9G2ltyEMmA5ARNN6TRQfiJ8PfaYM9RwVEOhDxIzGI7whb2zeI1VRxw=="
,
"requires"
:
{
"goober"
:
"^2.1.10"
}
},
"react-csv"
:
{
"version"
:
"2.2.2"
,
"resolved"
:
"https://registry.npmjs.org/react-csv/-/react-csv-2.2.2.tgz"
,
...
...
@@ -11402,6 +11415,11 @@
"prop-types"
:
"^15.6.2"
}
},
"react-type-animation"
:
{
"version"
:
"2.1.1"
,
"resolved"
:
"https://registry.npmjs.org/react-type-animation/-/react-type-animation-2.1.1.tgz"
,
"integrity"
:
"sha512-leXq9tZLsfbQWi+1PvsSc2XZYv9CqRrChvuv81M0UPECggBEQgplQzTO9LzgjYNPdnhf4UMeEtZMI4G1qPpuwA=="
},
"readable-stream"
:
{
"version"
:
"3.6.0"
,
"resolved"
:
"https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz"
,
...
...
bussifinder/package.json
View file @
7892e6c4
...
...
@@ -28,6 +28,7 @@
"react"
:
"^18.1.0"
,
"react-animated-3d-card"
:
"^1.0.2"
,
"react-chartjs-2"
:
"^4.3.1"
,
"react-cssfx-loading"
:
"^2.1.0"
,
"react-csv"
:
"^2.2.2"
,
"react-csv-reader"
:
"^3.5.0"
,
"react-dom"
:
"^18.1.0"
,
...
...
@@ -44,6 +45,7 @@
"react-router"
:
"^6.3.0"
,
"react-router-dom"
:
"^6.3.0"
,
"react-scripts"
:
"5.0.1"
,
"react-type-animation"
:
"^2.1.1"
,
"redux"
:
"^4.2.0"
,
"tsparticles"
:
"^2.3.1"
,
"typescript"
:
"^4.6.4"
,
...
...
bussifinder/src/App.js
View file @
7892e6c4
...
...
@@ -24,6 +24,7 @@ import SignIn from './components/Auth/SignIn';
import
BusinessTypePage
from
'
./components/BusinessTypePage
'
;
import
MultipleResult
from
'
./components/MultipleResult
'
;
import
ResultsWOTypes
from
'
./components/ResultsWOTypes
'
;
import
LocationBasedPredict
from
'
./components/LocationBasedPredict
'
;
const
store
=
configureStore
({
reducer
:
{
...
...
@@ -55,6 +56,7 @@ function App() {
<
Route
path
=
"
/multipleResult
"
element
=
{
<
MultipleResult
/>
}
/
>
<
Route
path
=
"
/resultWOTypes
"
element
=
{
<
ResultsWOTypes
/>
}
/
>
<
Route
path
=
"
/Service
"
element
=
{
<
BusinessTypePage
/>
}
/
>
<
Route
path
=
"
/locationBasedPredict
"
element
=
{
<
LocationBasedPredict
/>
}
/
>
<
/Route
>
<
/Routes
>
<
Footer
/>
...
...
bussifinder/src/Home.js
View file @
7892e6c4
...
...
@@ -21,6 +21,7 @@ import ContactUs from './components/ContactUs';
import
Loader
from
'
./components/Loader
'
;
//import API from '../../Backend/src/api';
const
containerStyle
=
{
width
:
'
1400px
'
,
height
:
'
500px
'
...
...
bussifinder/src/components/BusinessTypePage.js
View file @
7892e6c4
...
...
@@ -102,6 +102,11 @@ const BusinessTypePage = () => {
dispatch
(
addBusiness
({
'
type
'
:
'
restaurant
'
}))
navigate
(
`/inputHotel`
)
}
const
navigateToLocationBasedPredic
=
()
=>
{
dispatch
(
addBusiness
({
'
type
'
:
'
locationBased
'
}))
navigate
(
`/locationBasedPredict`
)
}
return
(
<
Box
sx
=
{{
...
...
@@ -256,7 +261,7 @@ return (
<
div
className
=
{
classes
.
bodyText
}
>
We
make
sure
your
website
looks
the
way
you
want
it
to
where
ever
it
is
viewed
.
In
this
day
and
age
there
smart
devices
populate
our
entire
life
,
We
strive
to
ensure
that
the
websites
we
create
are
always
up
to
standard
with
the
new
devices
releasing
all
the
time
.
We
develop
dynamic
websites
based
on
our
client
requests
such
as
Content
Management
System
(
CMS
),
E
-
commerce
websites
(
Shopping
carts
),
Online
Bookings
,
Web
Portals
,
Payment
Gateways
etc
.
There
are
many
uses
of
having
a
dynamic
site
.
<
/div
>
<
GetStarted
variant
=
"
contained
"
endIcon
=
{
<
ArrowForwardIosIcon
/>
}
>
<
GetStarted
variant
=
"
contained
"
endIcon
=
{
<
ArrowForwardIosIcon
/>
}
onClick
=
{()
=>
navigateToLocationBasedPredic
()}
>
Get
Started
<
/GetStarted
>
<
/Box
>
...
...
@@ -422,7 +427,7 @@ return (
<
div
className
=
{
classes
.
bodyText
}
>
We
make
sure
your
website
looks
the
way
you
want
it
to
where
ever
it
is
viewed
.
In
this
day
and
age
there
smart
devices
populate
our
entire
life
,
We
strive
to
ensure
that
the
websites
we
create
are
always
up
to
standard
with
the
new
devices
releasing
all
the
time
.
We
develop
dynamic
websites
based
on
our
client
requests
such
as
Content
Management
System
(
CMS
),
E
-
commerce
websites
(
Shopping
carts
),
Online
Bookings
,
Web
Portals
,
Payment
Gateways
etc
.
There
are
many
uses
of
having
a
dynamic
site
.
<
/div
>
<
GetStarted
variant
=
"
contained
"
onClick
=
{()
=>
navigateTo
H
InputForm
()}
endIcon
=
{
<
ArrowForwardIosIcon
/>
}
>
<
GetStarted
variant
=
"
contained
"
onClick
=
{()
=>
navigateTo
R
InputForm
()}
endIcon
=
{
<
ArrowForwardIosIcon
/>
}
>
Get
Started
<
/GetStarted
>
<
/Box
>
...
...
bussifinder/src/components/Hotel Input/InputDetails.js
View file @
7892e6c4
...
...
@@ -23,6 +23,8 @@ import Backdrop from '@mui/material/Backdrop';
import
CircularProgress
from
'
@mui/material/CircularProgress
'
;
import
{
useNavigate
}
from
"
react-router-dom
"
;
import
styled
from
'
@emotion/styled
'
;
import
{
FillingBottle
}
from
"
react-cssfx-loading
"
;
import
{
TypeAnimation
}
from
'
react-type-animation
'
;
const
NextBtn
=
styled
(
Button
)(()
=>
({
...
...
@@ -303,20 +305,65 @@ export default function InputDetails() {
<
/Stepper
>
<
React
.
Fragment
>
{
activeStep
===
steps
.
length
?
(
<
Backdrop
sx
=
{{
color
:
'
#fff
'
,
zIndex
:
(
theme
)
=>
theme
.
zIndex
.
drawer
+
1
}}
open
=
{
open
}
onClick
=
{
handleClose
}
>
//
<Backdrop
// sx={{ color: '#000
', zIndex: (theme) => theme.zIndex.drawer + 1 }}
//
open={open}
//
onClick={handleClose}
//
>
<
React
.
Fragment
>
<
Typography
variant
=
"
h5
"
gutterBottom
>
{
/*
<Typography variant="h5" gutterBottom>
Finalizing the Result.
</Typography>
<
CircularProgress
color
=
"
inherit
"
/>
<CircularProgress color="inherit" /> */
}
<
Box
sx
=
{{
display
:
'
flex
'
,
alignItems
:
'
center
'
,
flexDirection
:
'
column
'
,
justifyContent
:
'
center
'
,
backgroundColor
:
'
#65646e
'
,
color
:
'
black
'
,
gap
:
2
,
width
:
'
100%
'
,
height
:
'
100%
'
,
position
:
'
absolute
'
,
top
:
0
,
left
:
0
,
right
:
0
,
bottom
:
0
,
boxSizing
:
'
border-box
'
,
backgroundImage
:
'
url(https://images.unsplash.com/photo-1478860409698-8707f313ee8b?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1170&q=80)
'
,
padding
:
"
10px
"
,
backgroundRepeat
:
'
no-repeat
'
,
backgroundSize
:
'
cover
'
,
backgroundBlendMode
:
'
overlay
'
,
}}
>
<
FillingBottle
color
=
"
#101554
"
width
=
"
50px
"
height
=
"
50px
"
duration
=
"
3s
"
/>
<
TypeAnimation
sequence
=
{[
'
Loading
'
,
// Types 'One'
2000
,
// Waits 1s
'
Analyzing
'
,
// Deletes 'One' and types 'Two'
4000
,
// Waits 2s
'
Finalizing the Result.
'
,
// Types 'Three' without deleting 'Two'
()
=>
{
console
.
log
(
'
Done typing!
'
);
// Place optional callbacks anywhere in the array
}
]}
wrapper
=
"
div
"
cursor
=
{
true
}
repeat
=
{
Infinity
}
style
=
{{
fontSize
:
'
2em
'
,
color
:
"
#101554
"
}}
/
>
<
/Box
>
<
/React.Fragment
>
<
/Backdrop
>
//
</Backdrop>
)
:
(
<
React
.
Fragment
>
{
getStepContent
(
activeStep
)}
...
...
bussifinder/src/components/InputHotelDetails.js
View file @
7892e6c4
...
...
@@ -18,6 +18,7 @@ const InputHotelDetails = () => {
backgroundRepeat
:
'
no-repeat
'
,
backgroundSize
:
'
cover
'
,
backgroundAttachment
:
'
fixed
'
,
}}
>
...
...
bussifinder/src/components/LocationBasedPredict.js
0 → 100644
View file @
7892e6c4
This diff is collapsed.
Click to expand it.
bussifinder/src/components/ResultsWOTypes.js
View file @
7892e6c4
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment