Categories

Marketing Real Estate

Developer

Image Description
Incubalabs Technologies Inc

Predict New Restaurant Rating In Yelp Image Description

Details

The restaurant industry is tougher than ever, with reviews on the Internet from the first day a restaurant opens. But as a food lover, you and your friend decide to enter the industry and open your own restaurant. Because a restaurant's success is highly correlated to its reputation, you want to make sure that your restaurant gets the best reviews on the most popular restaurant review site: Yelp!
  • Image Description
    Verified

Use Cases

If you 're launching a new fancy restaurant and want to predict the review you'll get in Yelp, this endpoint is for you!

0 Comments


Endpoints (2)

Title:
Endpoint #1 Model Details

Description:
Endpoint to see the coefficients, intercepts of the trained model

Base URL:
https://www.dataendpoint.co/machine-learning-apis/predict-new-restaurant-rating-in-yelp/get-api
Requests:
# GET /current-details/<token>
Token:
every API have unique token. You'll get one once you activate the endpoint

Example responses
Press button to test this endpoint response

 


Code Examples:

const axios = require('axios');
axios({
"method": "GET",
"url": https://www.dataendpoint.co/machine-learning-apis/predict-new-restaurant-rating-in-yelp/get-api/current-details/<token>
"headers": {
"content-type": "application/json"
}
}).then((response) => {
// handle sucess
console.log(response)
}).catch((error) => {
// handle error
console.log(error)
})
import requests
url = https://www.dataendpoint.co/machine-learning-apis/predict-new-restaurant-rating-in-yelp/get-api/current-details/<token>
headers = {
"content-type": "application/json"
}
response = requests.request("GET", url, headers=headers)
print (response.text)
require 'httparty'
url = https://www.dataendpoint.co/machine-learning-apis/predict-new-restaurant-rating-in-yelp/get-api/current-details/<token>
response = HTTParty.get(url,
headers: { "Content-Type" => "application/json" })
puts response.parsed_response
<?php
$curl = curl_init();
$url = https://www.dataendpoint.co/machine-learning-apis/predict-new-restaurant-rating-in-yelp/get-api/current-details/<token>
curl_setopt_array($curl, array(
CURLOPT_URL => $url,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => array(
"Content-Type: application/json"
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;

Expected Response


Title:
Endpoint #2 Predict Rating

Description:
Endpoint receiving prediction parameters from the model

Base URL:
https://www.dataendpoint.co/machine-learning-apis/predict-new-restaurant-rating-in-yelp/post-api
Requests:
# POST /predict/<token>
Token:
every API have unique token. You'll get one once you activate the endpoint

Body params:

Body param name Body param type Example Requirement Params Has Constraint Params Constraint Value Description
alcohol BOOLEAN false [Required] [no constraint]
has_bike_parking BOOLEAN true [Required] [no constraint]
takes_credit_cards BOOLEAN true [Required] [no constraint]
good_for_kids BOOLEAN true [Required] [no constraint]
take_reservations BOOLEAN true [Required] [no constraint]
has_wifi BOOLEAN true [Required] [no constraint]
review_count NUMBER 10 [Required] [no constraint]
price_range NUMBER 2 [Required] [no constraint]
average_caption_length NUMBER 3 [Required] [no constraint]
number_pics NUMBER 4 [Required] [no constraint]
average_review_age NUMBER 0.5 [Required] [no constraint]
average_review_length NUMBER 3 [Required] [no constraint]
average_review_sentiment NUMBER 0.55 [Required] [no constraint]
number_funny_votes NUMBER 2 [Required] [no constraint]
number_cool_votes NUMBER 2 [Required] [no constraint]
number_useful_votes NUMBER 2 [Required] [no constraint]
average_tip_length NUMBER 3 [Required] [no constraint]
number_tips NUMBER 2 [Required] [no constraint]
average_number_friends NUMBER 2 [Required] [no constraint]
average_days_on_yelp NUMBER 10 [Required] [no constraint]
average_number_fans NUMBER 11 [Required] [no constraint]
average_review_count NUMBER 3 [Required] [no constraint]
average_number_years_elite NUMBER 0.5 [Required] [no constraint]
weekday_checkins NUMBER 2 [Required] [no constraint]
weekend_checkins NUMBER 2 [Required] [no constraint]


Code Examples:

const axios = require('axios');
axios({
"method": "POST",
"url": https://www.dataendpoint.co/machine-learning-apis/predict-new-restaurant-rating-in-yelp/post-api/predict/<token>
"data": { "alcohol": false , "has_bike_parking": true , "takes_credit_cards": true , "good_for_kids": true , "take_reservations": true , "has_wifi": true , "review_count": 10 , "price_range": 2 , "average_caption_length": 3 , "number_pics": 4 , "average_review_age": 0.5 , "average_review_length": 3 , "average_review_sentiment": 0.55 , "number_funny_votes": 2 , "number_cool_votes": 2 , "number_useful_votes": 2 , "average_tip_length": 3 , "number_tips": 2 , "average_number_friends": 2 , "average_days_on_yelp": 10 , "average_number_fans": 11 , "average_review_count": 3 , "average_number_years_elite": 0.5 , "weekday_checkins": 2 , "weekend_checkins": 2 }
"headers": {
"content-type": "application/json"
}
}).then((response) => {
// handle sucess
console.log(response)
}).catch((error) => {
// handle error
console.log(error)
})
import requests
url = https://www.dataendpoint.co/machine-learning-apis/predict-new-restaurant-rating-in-yelp/post-api/predict/<token>
data = { "alcohol": false , "has_bike_parking": true , "takes_credit_cards": true , "good_for_kids": true , "take_reservations": true , "has_wifi": true , "review_count": 10 , "price_range": 2 , "average_caption_length": 3 , "number_pics": 4 , "average_review_age": 0.5 , "average_review_length": 3 , "average_review_sentiment": 0.55 , "number_funny_votes": 2 , "number_cool_votes": 2 , "number_useful_votes": 2 , "average_tip_length": 3 , "number_tips": 2 , "average_number_friends": 2 , "average_days_on_yelp": 10 , "average_number_fans": 11 , "average_review_count": 3 , "average_number_years_elite": 0.5 , "weekday_checkins": 2 , "weekend_checkins": 2 }
headers = {
"content-type": "application/json"
}
response = requests.request("POST", url, data=data, headers=headers)
print (response.text)
require 'httparty'
url = https://www.dataendpoint.co/machine-learning-apis/predict-new-restaurant-rating-in-yelp/post-api/predict/<token>
data = { "alcohol" => false , "has_bike_parking" => true , "takes_credit_cards" => true , "good_for_kids" => true , "take_reservations" => true , "has_wifi" => true , "review_count" => 10 , "price_range" => 2 , "average_caption_length" => 3 , "number_pics" => 4 , "average_review_age" => 0.5 , "average_review_length" => 3 , "average_review_sentiment" => 0.55 , "number_funny_votes" => 2 , "number_cool_votes" => 2 , "number_useful_votes" => 2 , "average_tip_length" => 3 , "number_tips" => 2 , "average_number_friends" => 2 , "average_days_on_yelp" => 10 , "average_number_fans" => 11 , "average_review_count" => 3 , "average_number_years_elite" => 0.5 , "weekday_checkins" => 2 , "weekend_checkins" => 2 }
response = HTTParty.post(url,
body: data.to_json,
headers: { "Content-Type" => "application/json" })
puts response.parsed_response
<?php
$curl = curl_init();
$url = https://www.dataendpoint.co/machine-learning-apis/predict-new-restaurant-rating-in-yelp/post-api/predict/<token>
curl_setopt_array($curl, array(
CURLOPT_URL => $url,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "
{ "alcohol": false , "has_bike_parking": true , "takes_credit_cards": true , "good_for_kids": true , "take_reservations": true , "has_wifi": true , "review_count": 10 , "price_range": 2 , "average_caption_length": 3 , "number_pics": 4 , "average_review_age": 0.5 , "average_review_length": 3 , "average_review_sentiment": 0.55 , "number_funny_votes": 2 , "number_cool_votes": 2 , "number_useful_votes": 2 , "average_tip_length": 3 , "number_tips": 2 , "average_number_friends": 2 , "average_days_on_yelp": 10 , "average_number_fans": 11 , "average_review_count": 3 , "average_number_years_elite": 0.5 , "weekday_checkins": 2 , "weekend_checkins": 2 }
",
CURLOPT_HTTPHEADER => array(
"Content-Type: application/json"
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
Example responses
Enter next parameters to test endpoint response

Enter parameters

 

Expected Response


Related Real Estate APIs

View More