Categories

Marketing E-commerce

Developer

Image Description
Daniel Morales

Predict New Restaurant Rating In Yelp Image Description Pro

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!
  • 0.68
    Regression: R2= Coefficient of determination
  • Image Description
    Shape (188593, 25)
  • Image Description
    Verified

Data Source

In this API we work with a set of actual data provided by Yelp. We have six files, which are listed below with a brief description:

* `yelp_business.json`: data regarding the location and attributes of all businesses in the data set
* `yelp_review.json`: ratings metadata by company
* `yelp_user.json`: user profile metadata by company
* `yelp_checkin.json`: online billing metadata by company
* `yelp_tip.json`: metadata of tips per company
* `yelp_photo.json`: photo metadata by company

Use Cases

If you are launching a new restaurant, or have a set of restaurants you want to predict your rating on Yelp, this endpoint will be very helpful in getting an accurate approximation of that rating.

0 Comments


Endpoints (2)

Title:
Endpoint #1 Current Details

Description:
Get coefficients and intercepts from the created model

Response
coefficients and interceptions of all data points

Base URL:
https://dataendpoint.co/machine-learning-apis/predict-new-restaurant-rating-in-yelp/get-api
Requests:
# GET /yelp-rating-prediction/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://dataendpoint.co/machine-learning-apis/predict-new-restaurant-rating-in-yelp/get-api/yelp-rating-prediction/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://dataendpoint.co/machine-learning-apis/predict-new-restaurant-rating-in-yelp/get-api/yelp-rating-prediction/current-details/<token>"
headers = {
"content-type": "application/json"
}
response = requests.request("GET", url, headers=headers)
print (response.text)
require 'httparty'
url = "https://dataendpoint.co/machine-learning-apis/predict-new-restaurant-rating-in-yelp/get-api/yelp-rating-prediction/current-details/<token>",
response = HTTParty.get(url,
headers: { "Content-Type" => "application/json" })
puts response.parsed_response
<?php
$curl = curl_init();
$url = "https://dataendpoint.co/machine-learning-apis/predict-new-restaurant-rating-in-yelp/get-api/yelp-rating-prediction/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;

Title:
Endpoint #2 Predict New Restaurant Rating

Description:
Hero you can predict the rating of a new restaurant in Yelp

Response
rating prediction in stars

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

Body parameters:
25

Body parameter name Body parameter type Example Requirement
alcohol BOOLEAN 0 [Required]
has_bike_parking BOOLEAN 1 [Required]
takes_credit_cards BOOLEAN 1 [Required]
good_for_kids BOOLEAN 1 [Required]
take_reservations BOOLEAN 1 [Required]
has_wifi BOOLEAN 1 [Required]
review_count NUMBER 10 [Required]
price_range NUMBER 2 [Required]
average_caption_length NUMBER 3 [Required]
number_pics NUMBER 10 [Required]
average_review_age NUMBER 10 [Required]
average_review_length NUMBER 1200 [Required]
average_review_sentiment NUMBER 0.9 [Required]
number_funny_votes NUMBER 3 [Required]
number_cool_votes NUMBER 6 [Required]
number_useful_votes NUMBER 5 [Required]
average_tip_length NUMBER 50 [Required]
number_tips NUMBER 3 [Required]
average_number_friends NUMBER 50 [Required]
average_days_on_yelp NUMBER 1800 [Required]
average_number_fans NUMBER 12 [Required]
average_review_count NUMBER 123 [Required]
average_number_years_elite NUMBER 0.5 [Required]
weekday_checkins NUMBER 0 [Required]
weekend_checkins NUMBER 0 [Required]


Code Examples:

const axios = require('axios');
axios({
"method": "POST",
"url": "https://dataendpoint.co/machine-learning-apis/predict-new-restaurant-rating-in-yelp/post-api/yelp-rating-prediction/predict/<token>",
"data": { "alcohol": 0 , "has_bike_parking": 1 , "takes_credit_cards": 1 , "good_for_kids": 1 , "take_reservations": 1 , "has_wifi": 1 , "review_count": 10 , "price_range": 2 , "average_caption_length": 3 , "number_pics": 10 , "average_review_age": 10 , "average_review_length": 1200 , "average_review_sentiment": 0.9 , "number_funny_votes": 3 , "number_cool_votes": 6 , "number_useful_votes": 5 , "average_tip_length": 50 "number_tips": 3 , "average_number_friends": 50 , "average_days_on_yelp": 1800 , "average_number_fans": 12 , "average_review_count": 123 , "average_number_years_elite": 0.5 , "weekday_checkins": 0 , "weekend_checkins": 0 , }
"headers": {
"content-type": "application/json"
}
}).then((response) => {
// handle sucess
console.log(response)
}).catch((error) => {
// handle error
console.log(error)
})
import requests
url = "https://dataendpoint.co/machine-learning-apis/predict-new-restaurant-rating-in-yelp/post-api/yelp-rating-prediction/predict/<token>"
data = { "alcohol": 0 , "has_bike_parking": 1 , "takes_credit_cards": 1 , "good_for_kids": 1 , "take_reservations": 1 , "has_wifi": 1 , "review_count": 10 , "price_range": 2 , "average_caption_length": 3 , "number_pics": 10 , "average_review_age": 10 , "average_review_length": 1200 , "average_review_sentiment": 0.9 , "number_funny_votes": 3 , "number_cool_votes": 6 , "number_useful_votes": 5 , "average_tip_length": 50 "number_tips": 3 , "average_number_friends": 50 , "average_days_on_yelp": 1800 , "average_number_fans": 12 , "average_review_count": 123 , "average_number_years_elite": 0.5 , "weekday_checkins": 0 , "weekend_checkins": 0 , }
headers = {
"content-type": "application/json"
}
response = requests.request("POST", url, data=data, headers=headers)
print (response.text)
require 'httparty'
url = "https://dataendpoint.co/machine-learning-apis/predict-new-restaurant-rating-in-yelp/post-api/yelp-rating-prediction/predict/<token>",
data = { "alcohol" => 0 , "has_bike_parking" => 1 , "takes_credit_cards" => 1 , "good_for_kids" => 1 , "take_reservations" => 1 , "has_wifi" => 1 , "review_count" => 10 , "price_range" => 2 , "average_caption_length" => 3 , "number_pics" => 10 , "average_review_age" => 10 , "average_review_length" => 1200 , "average_review_sentiment" => 0.9 , "number_funny_votes" => 3 , "number_cool_votes" => 6 , "number_useful_votes" => 5 , "average_tip_length" => 50 "number_tips" => 3 , "average_number_friends" => 50 , "average_days_on_yelp" => 1800 , "average_number_fans" => 12 , "average_review_count" => 123 , "average_number_years_elite" => 0.5 , "weekday_checkins" => 0 , "weekend_checkins" => 0 , }
response = HTTParty.post(url,
body: data.to_json,
headers: { "Content-Type" => "application/json" })
puts response.parsed_response
<?php
$curl = curl_init();
$url = "https://dataendpoint.co/machine-learning-apis/predict-new-restaurant-rating-in-yelp/post-api/yelp-rating-prediction/predict/<token>";
curl_setopt_array($curl, array(
CURLOPT_URL => $url,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "
{ "alcohol": 0 , "has_bike_parking": 1 , "takes_credit_cards": 1 , "good_for_kids": 1 , "take_reservations": 1 , "has_wifi": 1 , "review_count": 10 , "price_range": 2 , "average_caption_length": 3 , "number_pics": 10 , "average_review_age": 10 , "average_review_length": 1200 , "average_review_sentiment": 0.9 , "number_funny_votes": 3 , "number_cool_votes": 6 , "number_useful_votes": 5 , "average_tip_length": 50 "number_tips": 3 , "average_number_friends": 50 , "average_days_on_yelp": 1800 , "average_number_fans": 12 , "average_review_count": 123 , "average_number_years_elite": 0.5 , "weekday_checkins": 0 , "weekend_checkins": 0 , }
",
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

 

Pricing plans in USD

Related E-commerce APIs

View More