2.3.8 Client

The Client() client is the entry point for connecting to APIs.

  1. Connect to the MPLAB ML Model Builder by loading the client through the Client() class.

from mplabml import Client
client = Client()

client.list_projects()
client.project = "<Your Project>"

client.list_captures()
class mplabml.client. Client(server='https://dev.mplabml.microchip.com/', path='connect.cfg', use_jedi=False, insecure=False, skip_validate=False, **kwargs)
account_info()

Get information about your account Usage

account_subscription()

Get information about your account Subscription

capture_configurations()

Returns the capture set object

create_query(name: str, columns: list = [], metadata_columns: list = [], metadata_filter: str = '', =None, label_column: str = '', combine_labels=None, force: bool = False, renderer=None, capture_configurations: str = '')
segmenter

Create a query to use as input data in a pipeline.

Parameters
  • name (str) – Name of the query

  • columns (list , optional) – Columns to add to the query result

  • metadata_filter (str , optional) – Filter to apply to the query

  • metadata_columns (list , optional) – Metadata to add to the query result

  • segmenter (int , optional) – Segmenter to filter query by

  • force (bool , False) – If True, overwrite the query on kb cloud

Returns

Returns a query object that was created

Return type

object

delete_knowledgepack(uuid)

Delete Knowledge Pack by uuid from the server associated with current project

Parameters

uuid (str) – Unique identifier for Knowledge Pack

Returns

a Knowledge Pack object

Return type

TYPE

delete_project()

Deletes a project

function_description(name)

Gets a description of a pipeline function

function_help(name)

Prints a shortened description of a function

get_datafile(uuid)

Get a datafile by uuid

Parameters

get_objects (bool , False) – Also return the datafile objects

get_featurefile(uuid)

Get a FeatureFile by uuid

Parameters

get_objects (bool , False) – Also return the FeatureFile objects

get_function(name)

Gets a function method call

get_knowledgepack(uuid)

Retrieve a Knowledge Pack by uuid from the server associated with current project

Parameters

uuid (str) – unique identifier for Knowledge Pack

Returns

a Knowledge Pack object

Return type

TYPE

list_functions(functype=None, subtype=None, kp_functions=False, qgrid=False)

Lists all of the functions available on MPLABML Cloud

Returns

Dataframe

Parameters
  • functype (str , None) – Return only functions with the specified type, i.e., “Segmenter”

  • subtype (str , None) – Return only functions with the specified subtype, i.e., “Sensor”

  • kp_functions (boolean , True) – Return only functions that run on the loaded device

  • Functions such as feature selection and model training. (Excludes) –

logout(name=None)

Logs out of the current connection

property pipeline

The active pipeline

property project

The active project

setup_jedi_false()

This is a temporary bug fix in ipython autocomplete

upload_data_file(name: str, path: str, force: bool = False, is_features: bool = False)

Upload a .CSV file as either a FeatureFile or DataFile to the server.

FeatureFiles are a collection of feature vectors and can be used in any step after the feature generation step. DataFiles include sensor data and metadata and are used in any step prior to feature generation.

Parameters
  • name (str) – Name of the file when it is uploaded

  • path (str) – The path to the file to upload

  • force (bool , optional) – Will overwrite if already exists. Defaults to False.

  • is_features (bool , optional) – If True, will upload as a feature file; if False, will upload as a DataFile. Defaults to False.

Returns

The response as a request object

Return type

response

upload_dataframe(name: str, dataframe: pandas.core.frame.DataFrame, force: bool = False, is_features: bool = False)

Upload a pandas DataFrame as either a FeatureFile or DataFile to the server.

FeatureFiles are a collection of feature vectors and can be used in any step after the feature generation step. DataFiles include sensor data and metadata and are used in any step prior to feature generation.

Parameters
  • name (str) – Name of the file when it is uploaded

  • dataframe (DatFrame) – Pandas DataFrame

  • force (bool , optional) – Will overwrite if already exists. Defaults to False.

  • is_features (bool , optional) – If True, will upload as a feature file; if False, will upload as a DataFile. Defaults to False.

Returns

The response as a request object

Return type

response

upload_feature_dataframe(name: str, dataframe: pandas.core.frame.DataFrame, force: bool = False)

Upload a pandas DataFrame as a FeatureFile to the server.

FeatureFiles are a collection of feature vectors and can be used in any step after the feature generation step.

Parameters
  • name (str) – Name of the file when it is uploaded

  • dataframe (DatFrame) – Pandas DataFrame

  • force (bool , optional) – Will overwrite if already exists. Defaults to False.

Returns

The response as a request object

Return type

response

upload_project(name: str, dclproj_path: str)

Upload a .dclproj file to the server.

Parameters
  • name (str) – Name of the project to create

  • dclproj_path (str) – Path to the .dclproj file

upload_project_dcli(name: str, dcli_path: str)

Upload a .dcli project to the server.

Parameters
  • name (str) – Name of the project to create

  • dcli_path (str) – Path to the .dclproj file

upload_sensor_dataframe(name: str, dataframe: pandas.core.frame.DataFrame, force: bool = False)

Upload a pandas DataFrame as a DataFile to the server.

DataFiles include sensor data and metadata and can be used in any step prior to feature generation.

Parameters
  • name (str) – Name of the file when it is uploaded

  • dataframe (DatFrame) – Pandas DataFrame

  • force (bool , optional) – Will overwrite if already exists. Defaults to False.

Returns

The response as a request object

Return type

response

validate_client_version()

Perform a Validation check to see if this version of MPLABML is up to date with the latest.