Engineer Salary Prediction Example
Details
This endpoint tries to predict the salary of a software engineer given the number of years of experience. In the first endpoint to get the details, the coefficient of determination is shown, and in the prediction endpoint the number of years of experience must be entered as an integer value.
This endpoint seeks to explain in a simple way how our platform works. It is a simple linear regression model, where the dataset is very small, but it allows to assimilate the basic concepts of a Machine Learning Model API. For example, how GET and POST endpoints are exposed, and how the data is serialized to access it.
This endpoint seeks to explain in a simple way how our platform works. It is a simple linear regression model, where the dataset is very small, but it allows to assimilate the basic concepts of a Machine Learning Model API. For example, how GET and POST endpoints are exposed, and how the data is serialized to access it.
-
Verified
Use Cases
If you have a service where you want to forecast the salary of an engineer, this endpoint will allow you to make such a forecast.
Note: This endpoint has no real use, it is merely explanatory of the platform functionality.
Note: This endpoint has no real use, it is merely explanatory of the platform functionality.
0 Comments
Endpoints (2)
Title:
Endpoint #1 Model Details
Description:
Base URL:
Requests:
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:
Expected Response
Endpoint #1 Model Details
Description:
With this endpoint you will see the Machine Learning model details as coefficients, intercepts and score
Base URL:
https://www.dataendpoint.co/machine-learning-apis/engineer-salary-prediction/get-api
# GET
/current-details/<token>
every API have unique token. You'll get one once you activate the endpoint
Press button to test this endpoint response
Code Examples:
const
axios = require('axios');
axios({
"method":
"GET",
"url":
https://www.dataendpoint.co/machine-learning-apis/engineer-salary-prediction/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/engineer-salary-prediction/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/engineer-salary-prediction/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/engineer-salary-prediction/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 Salary
Description:
Base URL:
Requests:
Token:
every API have unique token. You'll get one once you activate the endpoint
Body params:
Code Examples:
Example responses
Enter next parameters to test endpoint response
Expected Response
Endpoint #2 Predict Salary
Description:
This endpoint will allow you to predict the salary of an engineer given the years of experience.
Base URL:
https://www.dataendpoint.co/machine-learning-apis/engineer-salary-prediction/post-api
# POST
/predict/<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 |
---|---|---|---|---|---|---|
years_of_experience | NUMBER | 4 | [Required] | [no constraint] |
Code Examples:
const
axios = require('axios');
axios({
"method":
"POST",
"url":
https://www.dataendpoint.co/machine-learning-apis/engineer-salary-prediction/post-api/predict/<token>
"data":
{
"years_of_experience":
4
}
"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/engineer-salary-prediction/post-api/predict/<token>
data =
{
"years_of_experience":
4
}
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/engineer-salary-prediction/post-api/predict/<token>
data =
{
"years_of_experience" =>
4
}
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/engineer-salary-prediction/post-api/predict/<token>
curl_setopt_array($curl, array(
CURLOPT_URL => $url,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "
{
"years_of_experience":
4
}
",
CURLOPT_HTTPHEADER => array(
"Content-Type: application/json"
),
));
$response =
curl_exec($curl);
curl_close($curl);
echo
$response;
Enter next parameters to test endpoint response
Enter parameters
Expected Response
Related Insurance APIs
View More
Try with this categories:
Marketing (4) Healthcare (0) Insurance (1) E-commerce (2) Real Estate (2) Fintech (1)
Marketing (4) Healthcare (0) Insurance (1) E-commerce (2) Real Estate (2) Fintech (1)