Hacarus.SpectroSdk.AlgorithmsApi
All URIs are relative to https://sdd-api-staging.hacarus.com
Method | HTTP request | Description |
---|---|---|
get_algorithm_by_id | GET /api/v1/algorithms/{algorithm_id} | Get Algorithm by ID |
get_algorithms | GET /api/v1/algorithms/ | Get List of Algorithms |
train | POST /api/v1/algorithms/{algorithm_id}/train | Train |
get_algorithm_by_id
AlgorithmWithParameterWrapper get_algorithm_by_id(algorithm_id)
Get Algorithm by ID
Get a single algorithm by ID
Example
- Bearer (JWT) Authentication (jwt):
- OAuth Authentication (oauth2):
import time
import Hacarus.SpectroSdk
from Hacarus.SpectroSdk.api import algorithms_api
from Hacarus.SpectroSdk.model.base_error import BaseError
from Hacarus.SpectroSdk.model.algorithm_with_parameter_wrapper import AlgorithmWithParameterWrapper
from pprint import pprint
# Defining the host is optional and defaults to https://sdd-api-staging.hacarus.com
# See configuration.py for a list of all supported configuration parameters.
configuration = Hacarus.SpectroSdk.Configuration(
host = "https://sdd-api-staging.hacarus.com"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure Bearer authorization (JWT): jwt
configuration = Hacarus.SpectroSdk.Configuration(
access_token = 'YOUR_BEARER_TOKEN'
)
# Configure OAuth2 access token for authorization: oauth2
configuration = Hacarus.SpectroSdk.Configuration(
host = "https://sdd-api-staging.hacarus.com"
)
configuration.access_token = 'YOUR_ACCESS_TOKEN'
# Enter a context with an instance of the API client
with Hacarus.SpectroSdk.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = algorithms_api.AlgorithmsApi(api_client)
algorithm_id = "algorithm_id_example" # str |
# example passing only required values which don't have defaults set
try:
# Get Algorithm by ID
api_response = api_instance.get_algorithm_by_id(algorithm_id)
pprint(api_response)
except Hacarus.SpectroSdk.ApiException as e:
print("Exception when calling AlgorithmsApi->get_algorithm_by_id: %s\n" % e)
Parameters
Name | Type | Description | Notes |
---|---|---|---|
algorithm_id | str |
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
HTTP response details
Status code | Description | Response headers |
---|---|---|
200 | OK | - |
0 | Default error response | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
get_algorithms
AlgorithmWithParameterListWrapper get_algorithms()
Get List of Algorithms
- Returns list of available algorithms including parameters that can be used to create a model
- Algorithm documentation available here
Example
- Bearer (JWT) Authentication (jwt):
- OAuth Authentication (oauth2):
import time
import Hacarus.SpectroSdk
from Hacarus.SpectroSdk.api import algorithms_api
from Hacarus.SpectroSdk.model.algorithm_with_parameter_list_wrapper import AlgorithmWithParameterListWrapper
from Hacarus.SpectroSdk.model.base_error import BaseError
from pprint import pprint
# Defining the host is optional and defaults to https://sdd-api-staging.hacarus.com
# See configuration.py for a list of all supported configuration parameters.
configuration = Hacarus.SpectroSdk.Configuration(
host = "https://sdd-api-staging.hacarus.com"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure Bearer authorization (JWT): jwt
configuration = Hacarus.SpectroSdk.Configuration(
access_token = 'YOUR_BEARER_TOKEN'
)
# Configure OAuth2 access token for authorization: oauth2
configuration = Hacarus.SpectroSdk.Configuration(
host = "https://sdd-api-staging.hacarus.com"
)
configuration.access_token = 'YOUR_ACCESS_TOKEN'
# Enter a context with an instance of the API client
with Hacarus.SpectroSdk.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = algorithms_api.AlgorithmsApi(api_client)
# example, this endpoint has no required or optional parameters
try:
# Get List of Algorithms
api_response = api_instance.get_algorithms()
pprint(api_response)
except Hacarus.SpectroSdk.ApiException as e:
print("Exception when calling AlgorithmsApi->get_algorithms: %s\n" % e)
Parameters
This endpoint does not need any parameter.
Return type
AlgorithmWithParameterListWrapper
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
HTTP response details
Status code | Description | Response headers |
---|---|---|
200 | OK | - |
0 | Default error response | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
train
HModelWrapper train(algorithm_id, train_request)
Train
Train a model
Example
- Bearer (JWT) Authentication (jwt):
- OAuth Authentication (oauth2):
import time
import Hacarus.SpectroSdk
from Hacarus.SpectroSdk.api import algorithms_api
from Hacarus.SpectroSdk.model.train_request import TrainRequest
from Hacarus.SpectroSdk.model.base_error import BaseError
from Hacarus.SpectroSdk.model.h_model_wrapper import HModelWrapper
from pprint import pprint
# Defining the host is optional and defaults to https://sdd-api-staging.hacarus.com
# See configuration.py for a list of all supported configuration parameters.
configuration = Hacarus.SpectroSdk.Configuration(
host = "https://sdd-api-staging.hacarus.com"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure Bearer authorization (JWT): jwt
configuration = Hacarus.SpectroSdk.Configuration(
access_token = 'YOUR_BEARER_TOKEN'
)
# Configure OAuth2 access token for authorization: oauth2
configuration = Hacarus.SpectroSdk.Configuration(
host = "https://sdd-api-staging.hacarus.com"
)
configuration.access_token = 'YOUR_ACCESS_TOKEN'
# Enter a context with an instance of the API client
with Hacarus.SpectroSdk.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = algorithms_api.AlgorithmsApi(api_client)
algorithm_id = "algorithm_id_example" # str |
train_request = TrainRequest(
name="name_example",
item_ids=[
"item_ids_example",
],
override_params=[
OverrideParam(
algorithm_parameter_id=1,
value="value_example",
),
],
) # TrainRequest |
# example passing only required values which don't have defaults set
try:
# Train
api_response = api_instance.train(algorithm_id, train_request)
pprint(api_response)
except Hacarus.SpectroSdk.ApiException as e:
print("Exception when calling AlgorithmsApi->train: %s\n" % e)
Parameters
Name | Type | Description | Notes |
---|---|---|---|
algorithm_id | str | ||
train_request | TrainRequest |
Return type
Authorization
HTTP request headers
- Content-Type: application/json
- Accept: application/json
HTTP response details
Status code | Description | Response headers |
---|---|---|
422 | Unprocessable Entity | - |
200 | OK | - |
0 | Default error response | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]