Skip to main content

AlchemyML API package

Project description

AlchemyML API Documentation

Version Date: 2020-03-27


Prerequisites

  • Python >= 3.6
    • requests >= 2.22.0
    • urllib3 >= 1.25.7

Module Overview

Description

AlchemyML is a multi-environment solution for data exploiation.

To maximize customer convenience, there are three ways to run it: via the AlchemyML Platform, via the API, and via ad hoc solutions. The one documented below is the second tool, AlchemyML API.

AlchemyML API is an easy way to use advanced data analysis techniques in Python, accelerating the work of the data scientist and optimizing her/his time and resources.

AlchemyML API has operations at the dataset level (upload, list, delete...), at the experiment level (create, send, add to project, view metrics and logs...) and at the project level (create, update, delete...). Moreover, it also has specific actions so that the client can perform her/his own experiment manually: pre-process the dataset, remove highly correlated columns, detect outliers, impute missings...

List of scripts and their functions

  • init
    • alchemyml()
      • get_api_token
  • _CRUD_classes
    • dataset()
      • upload
      • view
      • update
      • delete
      • statistical_descriptors
    • experiment()
      • create
      • view
      • update
      • delete
      • statistical_descriptors
      • results
      • add_to_project
      • extract_from_project
      • send
    • project()
      • create
      • view
      • update
      • delete
  • _manual_ops
    • actions()
      • list_preprocessed_dataframes
      • download_dataframe
      • prepare_dataframe
      • encode_dataframe
      • drop_highly_correlated_components
      • impute_inconsistencies
      • drop_invalid_columns
      • target_column_analysis
      • balancing_dataframe
      • initial_exp_info
      • impute_missing_values
      • merge_cols_into_dt_index
      • detect_experiment_type
      • build_model
      • operational_info
      • detect_outliers
      • impute_outliers
      • download_properties_df

init.py - Code explanations

Prerequisites - Imports

  • Python packages:
    • JSON: import json
  • Internal classes and functions from alchemyml:
    • from ._CRUD_classes import dataset, experiment, project
    • from ._manual_ops import actions
    • from ._request_handler import retry_session

class alchemyml

Main class containing all AlchemyML functionalities

method get_api_token

    def get_api_token(self, username, password):
        from ._request_handler import retry_session

        url = 'https://alchemyml.com/api/token/'
        data = json.dumps({'username':username, 'password':password})
        session = retry_session(retries = 10)
        r = session.post(url, data)

        if r.status_code == 200:
            tokenJSON = json.loads(r.text)
            self.dataset.token = tokenJSON['access']
            self.experiment.token = tokenJSON['access']
            self.project.token = tokenJSON['access']
            self.actions.token = tokenJSON['access']
            return tokenJSON['access']
        else:
            msgJSON = json.loads(r.text)
            msg = msgJSON['message']
            return msg
Description

This method returns the necessary token to be used from now on for the API requests. To be able to make use of the API before all it is necessary to sign-up.

I/O
  • Parameters:
    • username (str): Username.
    • password (str): Password.

_CRUD_classes.py - Code explanations

Prerequisites - Imports

  • Python packages:
    • JSON: import json
    • OS: import os
    • Sys: import sys
  • Functions from _request_handler:
    • from ._request_handler import retry_session, general_call

class dataset

This class unifies and condenses all the operations related to datasets in their most general sense: uploading them to the workspace, listing them, removing them...

Each and every operation (request) needs the token that is obtained through the class authentication.

method upload

def upload(self, *args, **kwargs):  
    str_meth_name = self.class_name + '.' + sys._getframe().f_code.co_name
    input_args = locals()['args']
    input_kwargs = locals()['kwargs']

    return general_call(self, str_meth_name, input_args, input_kwargs)
Description

Through the call to this method, you will be able to upload a dataset.

We recommend you to consider the next points before uploading your dataset:

  • The accepted reading formats are: .xlsx, .xls, .csv, .json, .xml, .sql.
  • Files whose name contains two extensions will not be accepted. E.g.: 'Iris.xlsx.csv'.
  • Your data set should contain at least 50 observations.
  • The file must not exceed the size limit specified by the AlchemyML team.
  • Make sure that your data are not empty. Otherwise, this file will be rejected.
I/O
  • Parameters:
    • token (str): API Token.
    • file_path (str): The path where the dataset file is located.
    • dataset_name (str): Custom name for the dataset file.
    • description (str, optional): Optional parameter to specify description if needed for the dataset. If no description is inputted, no description is added to the dataset.

method get

def get(self, *args, **kwargs):  
    str_meth_name = self.class_name + '.' + sys._getframe().f_code.co_name
    input_args = locals()['args']
    input_kwargs = locals()['kwargs']

    return general_call(self, str_meth_name, input_args, input_kwargs)
Description

This method lists the datasets available in the workspace.

  • By setting the detail parameter to True or False, you can control receiving the details of each uploaded dataset or simply a list with the names of the datasets.
  • By setting the dataset_name parameter, you can control for which datasets return the details.
I/O
  • Parameters:
    • token (str): API Token.
    • dataset_name (str/list, optional): Name or list of names of the dataset(s) for which details will be returned.
    • detail (bool, optional): Optional boolean parameter to return the details for the specified dataset(s) (False/ True).

method update

def update(self, *args, **kwargs):  
    str_meth_name = self.class_name + '.' + sys._getframe().f_code.co_name
    input_args = locals()['args']
    input_kwargs = locals()['kwargs']

    return general_call(self, str_meth_name, input_args, input_kwargs)
Description

This method gives the option to rename a dataset and/ or update the datasets description. At least one of the two previous options must be selected.

I/O
  • Parameters:
    • token (str): API Token.
    • dataset_name (str, optional): Name of the dataset to update.
    • new_dataset_name (str, optional): New name of the specified dataset. If no name is inputted, the dataset won't be renamed.
    • new_description (str/list, optional): New description for the specified dataset. If no description is inputted, the description is not going to be updated.

method delete

def delete(self, *args, **kwargs):  
    str_meth_name = self.class_name + '.' + sys._getframe().f_code.co_name
    input_args = locals()['args']
    input_kwargs = locals()['kwargs']

    return general_call(self, str_meth_name, input_args, input_kwargs)
Description

Through the use of the Delete method you will be able to delete one, several or all uploaded datasets. Note that if a dataset consists of experiments associated with it, you must first remove the experiments that have been created.

AlchemyML is not responsible for any consequences that may be caused by removing one, several or all datasets.

I/O
  • Parameters:
    • token (str): API Token.
    • dataset_name (str/list): Name or list of names of the datasets to be removed from workspace. If All used, then all datasets will be removed. Datasets will be removed only if were not used in any experiment.

method statistical_descriptors

def statistical_descriptors(self, *args, **kwargs):  
    str_meth_name = self.class_name + '.' + sys._getframe().f_code.co_name
    input_args = locals()['args']
    input_kwargs = locals()['kwargs']

    return general_call(self, str_meth_name, input_args, input_kwargs)
Description

This method returns the most relevant statistical descriptors for each column of a dataset.

I/O
  • Parameters:
    • token (str): API Token
    • dataset_name (str): Name of the dataset to return statistical descriptors.

class experiment

This class unifies and condenses all the operations related to experiments in their most general sense: uploading them to the workspace, listing them, removing them... this class also contains the methods for adding experiments to projects, updating them, deleting them...

Each and every operation (request) needs the token that is obtained through the class authentication.

method create

def create(self, *args, **kwargs):
    str_meth_name = self.class_name + '.' + sys._getframe().f_code.co_name
    input_args = locals()['args']
    input_kwargs = locals()['kwargs']

    return general_call(self, str_meth_name, input_args, input_kwargs)
Description

By default, an automatic experiment will be created.

This option implies the execution of a sequence of steps that go from the dataset intake to the construction of the predictive model, including the pre-processing and cleaning of the data.

If the experiment procedure is set to manual, then the user has the possibility to control each phase of the experiment by running the available modules in the desired order.

The possible operations that can be executed are those that appear in the manual operations section.

I/O
  • Parameters:
    • token (str): API Token.
    • experiment_name (str): Name used for the creation the experiment. This name is given by the user.
    • description (str, optional): Optional parameter to specify description if needed for the experiment. If no description is inputted, no description is going to be added to the experiment.
    • dataset_name (str): Name of the dataset used in the creation of experiment.
    • target_column (str): Specifying the target column name.
    • clients_choice (str): Type of experiment. Valid options: Regression, Classification, Time Series, Auto Detect.
    • input_column_names (str, optional): Column names of the dataset to use during the experiment. If no input column is introduced, all will be taken by default.
    • experiment_procedure (str, optional): Valid options are: auto or manual.

method get

def get(self, *args, **kwargs):
    str_meth_name = self.class_name + '.' + sys._getframe().f_code.co_name
    input_args = locals()['args']
    input_kwargs = locals()['kwargs']

    return general_call(self, str_meth_name, input_args, input_kwargs)
Description

Such as the datasets section, this method will let you know which experiments you have in your workspace.

  • By setting the detail parameter to True or False you can control receiving details of each experiment or simply get a list with the names of the experiments.
  • By setting the experiment_name parameter, you control for which experiments return the details (one or some).
I/O
  • Parameters:
    • token (str): API Token.
    • experiment_name (str/list, optional): The name or list of experiment names to be listed.
    • detail (bool, optional): Optional boolean parameter to return the details for the specified experiment(s) (False/ True).

method update

def update(self, *args, **kwargs):
    str_meth_name = self.class_name + '.' + sys._getframe().f_code.co_name
    input_args = locals()['args']
    input_kwargs = locals()['kwargs']

    return general_call(self, str_meth_name, input_args, input_kwargs)
Description

This method gives the option to rename an experiment and/ or update the experiments description. At least one of the two previous options must be selected.

I/O
  • Parameters:
    • token (str): API Token.
    • experiment_name (str): Name of the experiment to update.
    • new_experiment_name (str, optional): New name of the specified experiment. If no name is inputted, the experiment is not going to be renamed.
    • new_description (str/list, optional): New description for the specified experiment. If no description is inputted, the description is not going to be updated.

method delete

def delete(self, *args, **kwargs):
    str_meth_name = self.class_name + '.' + sys._getframe().f_code.co_name
    input_args = locals()['args']
    input_kwargs = locals()['kwargs']

    return general_call(self, str_meth_name, input_args, input_kwargs)
Description

Through the use of the endpoint Delete you will be able to delete one, several or all the experiments created.

AlchemyML is not responsible for any consequences that may be caused by removing one, several or all experiments.

I/O
  • Parameters:
    • token (str): API Token.
    • experiment_name (str/list): Name or list of experiment names to be deleted. If All used, then all experiments will be removed.

method statistical_descriptors

def statistical_descriptors(self, *args, **kwargs):
    str_meth_name = self.class_name + '.' + sys._getframe().f_code.co_name
    input_args = locals()['args']
    input_kwargs = locals()['kwargs']

    return general_call(self, str_meth_name, input_args, input_kwargs)
Description

This method returns the most relevant statistical descriptors for each column of the preprocessed dataset used in the experiment creation.

I/O
  • Parameters:
    • token (str): API Token.
    • experiment_name (str): Name of the experiment to return statistical descriptors.
    • dataset_name (str): Name of the dataset used in the experiment creation.

method results

def results(self, *args, **kwargs):
    str_meth_name = self.class_name + '.' + sys._getframe().f_code.co_name
    input_args = locals()['args']
    input_kwargs = locals()['kwargs']

    return general_call(self, str_meth_name, input_args, input_kwargs)
Description

The creation of an experiment (previous method CREATE) returns the results of that experiment. This method gives the option to retrieve the previous results whenever these are needed.

The results are delivered in a JSON structure consisting of two keys: log, model_metrics.

  • log contains the information related to the decisions that AlchemyML has taken throughout the creation of the experiment, until finishing the construction of the predictive model.
  • On the other hand, model_metrics will include the analytical information of these results: metrics obtained, relevant variables, type of experiment, etc.
I/O
  • Parameters:
    • token (str): API Token.
    • experiment_name (str): Name of the experiment to return the results.

method add_to_project

def add_to_project(self, *args, **kwargs):
    str_meth_name = self.class_name + '.' + sys._getframe().f_code.co_name
    input_args = locals()['args']
    input_kwargs = locals()['kwargs']

    return general_call(self, str_meth_name, input_args, input_kwargs)
Description

This method gives the possibility to include an experiment or various into a specified project.

Projects are the way to order and group different experiments that are included within a general topic. For example, you could create a project under the theme of Smart Cities that includes experiments related to this topic.

I/O
  • Parameters:
    • token (str): API Token.
    • associated_experiments (str/list): Name or list of experiment names to be included into a specified project.
    • project_name (str): The name of the project in which experiment(s) will be included.
    • description (str, optional): Optional parameter to specify description if needed for the project. If no description is inputted, no description is going to be added to the experiment.

method extract_from_project

def extract_from_project(self, *args, **kwargs):
    str_meth_name = self.class_name + '.' + sys._getframe().f_code.co_name
    input_args = locals()['args']
    input_kwargs = locals()['kwargs']

    return general_call(self, str_meth_name, input_args, input_kwargs)
Description

Given a project this method gives the possibility to extract specified experiments from it.

I/O
  • Parameters:
    • token (str): API Token.
    • experiment_name (str/list): Name or list of experiment names that are desired to be extracted from a given project.
    • project_name (str): The project from which will be extracted the specified experiments.

method send

def send(self, *args, **kwargs):
    str_meth_name = self.class_name + '.' + sys._getframe().f_code.co_name
    input_args = locals()['args']
    input_kwargs = locals()['kwargs']

    return general_call(self, str_meth_name, input_args, input_kwargs)
Description

This endpoint gives the possibility to send one or various experiments to another registered user.

If the user exists, a confirmation email will be sent. When the recipient confirms that he wants to receive an experiment from another user, an exact copy of the experiment will appear within his/her experiments section and will also be visible through the Workspace.

I/O
  • Parameters:
    • token (str): API Token.
    • destination_email (str): The receivers email address.
    • experiment_name (str/list): The name or list of experiment names to be sent.

class project

This class unifies and condenses all the operations related to projects in their most general sense: creating them, listing them, deleting them...

Each and every operation (request) needs the token that is obtained through the class authentication.

method create

def create(self, *args, **kwargs):
    str_meth_name = self.class_name + '.' + sys._getframe().f_code.co_name
    input_args = locals()['args']
    input_kwargs = locals()['kwargs']

    return general_call(self, str_meth_name, input_args, input_kwargs) 
Description

This method creates a new project.

Projects are the way to order and group different experiments that are included within a general topic. For example, you could create a project under the theme of Smart Cities that includes experiments related to this topic.

I/O
  • Parameters:
    • token (str): API Token.
    • project_name (str): Name of the project.
    • description (str, optional): Optional parameter to specify description if needed for the project. If no description is inputted, no description is going to be added to the project.
    • associated_experiments (str/list, optional): Name or list of experiment names to be added to the project. If no experiments are inputted, an empty project is going to be created.

method get

def get(self, *args, **kwargs):
    str_meth_name = self.class_name + '.' + sys._getframe().f_code.co_name
    input_args = locals()['args']
    input_kwargs = locals()['kwargs']

    return general_call(self, str_meth_name, input_args, input_kwargs) 
Description

Such as the datasets section, this method will let you know which projects you have in your workspace.

  • By setting the detail parameter to True or False you can control receiving details of each project or simply get a list with the names of the projects.
  • By setting the project_name parameter, you control for which projects return the details (one or some).
I/O
  • Parameters:
    • token (str): API Token.
    • project_name (str/list, optional): Name or list of names of the project(s).
    • detail (bool, optional): Optional boolean parameter to return the details for the specified project(s) (False/ True).

method update

def update(self, *args, **kwargs):
    str_meth_name = self.class_name + '.' + sys._getframe().f_code.co_name
    input_args = locals()['args']
    input_kwargs = locals()['kwargs']

    return general_call(self, str_meth_name, input_args, input_kwargs) 
Description

This method gives the option to rename a project and/ or update the projects description. At least one of the two previous options must be selected.

I/O
  • Parameters:
    • token (str): API Token.
    • project_name (str): Name of the project to be updated.
    • new_project_name (str, optional): New name of the specified project. If no name is inputted, the project is not going to be renamed.
    • new_description (str/list, optional): New description for the specified project. If no description is inputted, the description is not going to be updated.

method delete

def delete(self, *args, **kwargs):
    str_meth_name = self.class_name + '.' + sys._getframe().f_code.co_name
    input_args = locals()['args']
    input_kwargs = locals()['kwargs']

    return general_call(self, str_meth_name, input_args, input_kwargs) 
Description

Through the use of the method Delete you will be able to delete one, several or all the projects created.

AlchemyML is not responsible for any consequences that may be caused by removing one, several or all projects.

I/O
  • Parameters:
    • token (str): API Token.
    • project_name (str/list): Name or list of names of the projects to be deleted. If All used then, all projects will be removed.

_manual_ops.py - Code explanations

Prerequisites - Imports

  • Python packages:
    • Sys: import sys
  • Functions from _request_handler:
    • from ._request_handler import general_call

class actions

Class that encompasses all the operations available in a manual experiment.

method list_preprocessed_dataframes

def list_preprocessed_dataframes(self, *args, **kwargs):
    str_meth_name = sys._getframe().f_code.co_name
    input_args = locals()['args']
    input_kwargs = locals()['kwargs']

    return general_call(self, str_meth_name, input_args, input_kwargs)    
Description

Method for listing the available processed dataframes for the given experiment.

I/O
  • Parameters:
    • token (str): API Token.
    • experiment_name (str): Experiment name to which processed dataframes will be returned.
    • download (bool, optional): Optional boolean parameter to be set up if results needed to be downloaded.

method download_dataframe

def download_dataframe(self, *args, **kwargs):
    str_meth_name = sys._getframe().f_code.co_name
    input_args = locals()['args']
    input_kwargs = locals()['kwargs']

    return general_call(self, str_meth_name, input_args, input_kwargs)    
Description

As the name of the endpoint suggests, this method gives the option to download the available processed dataframes for a given experiment.

  • If keyword all in dataframe_name, all available dataframes will be downloaded.
  • If unknown the available processed dataframes, call first List preprocessed dataframes.
I/O
  • Parameters:
    • token (str): API Token.
    • experiment_name (str): Name of experiment for which dataframe(s) needed to be download.
    • dataframe_name (str): Dataframe name to be downloaded. Using the keyword all, all dataframes available for the experiment will be downloaded in a rar archive.

method prepare_dataframe

def prepare_dataframe(self, *args, **kwargs):
    str_meth_name = sys._getframe().f_code.co_name
    input_args = locals()['args']
    input_kwargs = locals()['kwargs']

    return general_call(self, str_meth_name, input_args, input_kwargs)    
Description

This module is responsible for performing a first pre-processing of the dataset loaded by the user before the data goes through the AlchemyMLs next modules.

In general terms, it seeks to remove spaces to the left and right of a string, remove quotes from cells that are of type string, convert numerical data that comes in string format to numerical format, interpret and convert data that is of type date but comes in string format.

I/O
  • Parameters:
    • token (str): API Token.
    • experiment_name (str): Name of the experiment to be prepared.
    • download (bool, optional): Optional boolean parameter to be set up if results needed to be downloaded.

method encode_dataframe

def encode_dataframe(self, *args, **kwargs):
    str_meth_name = sys._getframe().f_code.co_name
    input_args = locals()['args']
    input_kwargs = locals()['kwargs']

    return general_call(self, str_meth_name, input_args, input_kwargs)    
Description

This is the sub-module in charge of coding the variables that indicate a category and are string type in numerical codes.

This operation is carried out because the automatic learning algorithms need to understand the nature of the data converted into numbers.

I/O
  • Parameters:
    • token (str): API Token.
    • experiment_name (str): Name of the experiment to be encoded.
    • download (bool, optional): Optional boolean parameter to be set up if results needed to be downloaded.
    • target_col_name (str, optional): Specifying the target column name.
    • prepare_dataset (bool, optional): Optional boolean parameter that specifies if the dataset needs preparation or not.

method drop_highly_correlated_components

def drop_highly_correlated_components(self, *args, **kwargs):
    str_meth_name = sys._getframe().f_code.co_name
    input_args = locals()['args']
    input_kwargs = locals()['kwargs']

    return general_call(self, str_meth_name, input_args, input_kwargs)    
Description

This is the method responsible for dropping highly correlated columns and duplicate rows.

The threshold to consider a column as highly correlated with another one is 0.9999.

Highly correlated columns can be both numerical and categorical columns.

I/O
  • Parameters:
    • token (str): API Token.
    • experiment_name (str): Name of the experiment on which process will take place.
    • download (bool, optional): Optional boolean parameter to be set up if results needed to be downloaded.
    • target_col_name (str, optional): Specifying the target column name.
    • prepare_dataset (bool, optional): Optional boolean parameter that specifies if the dataset needs preparation or not.
    • component (str, optional): Specifying whether you want to drop: "rows", "columns" or "both".

method impute_inconsistencies

def impute_inconsistencies(self, *args, **kwargs):
    str_meth_name = sys._getframe().f_code.co_name
    input_args = locals()['args']
    input_kwargs = locals()['kwargs']

    return general_call(self, str_meth_name, input_args, input_kwargs)    
Description

This is the method responsible for iterating over each column of a dataset to find and correct inconsistencies. It is basically a submodule that searches for misspelled words, numbers or dates in an attempt to correct them.

You can choose between applying the operations to the entire dataset or just to the target column.

I/O
  • Parameters:
    • token (str): API Token.
    • experiment_name (str): Name of the experiment on which process will take place.
    • download (bool, optional): Optional boolean parameter to be set up if results needed to be downloaded.
    • target_col_name (str, optional): Specifying the target column name.
    • prepare_dataset (bool, optional): Optional boolean parameter that specifies if the dataset needs preparation or not.
    • just_target (bool, optional): Specifying whether you want to treat existing inconsistencies on the target or on the whole dataset (True/False).

method drop_invalid_columns

def drop_invalid_columns(self, *args, **kwargs):
    str_meth_name = sys._getframe().f_code.co_name
    input_args = locals()['args']
    input_kwargs = locals()['kwargs']

    return general_call(self, str_meth_name, input_args, input_kwargs)    
Description

Method to drop invalid columns in a experiment.

I/O
  • Parameters:
    • token (str): API Token.
    • experiment_name (str): Name of the experiment on which process will take place.
    • download (bool, optional): Optional boolean parameter to be set up if results needed to be downloaded.
    • target_col_name (str, optional): Specifying the target column name.
    • prepare_dataset (bool, optional): Optional boolean parameter that specifies if the dataset needs preparation or not.

method target_column_analysis

def target_column_analysis(self, *args, **kwargs):
    str_meth_name = sys._getframe().f_code.co_name
    input_args = locals()['args']
    input_kwargs = locals()['kwargs']

    return general_call(self, str_meth_name, input_args, input_kwargs)    
Description

This is the method responsible for telling the user wether the dataset is balanced or not by inspecting the target column.

I/O
  • Parameters:
    • token (str): API Token.
    • experiment_name (str): Name of the experiment on which process will take place.
    • target_col_name (str, optional): Specifying the target column name.
    • prepare_dataset (bool, optional): Optional boolean parameter that specifies if the dataset needs preparation or not.

method balancing_dataframe

def balancing_dataframe(self, *args, **kwargs):
    str_meth_name = sys._getframe().f_code.co_name
    input_args = locals()['args']
    input_kwargs = locals()['kwargs']

    return general_call(self, str_meth_name, input_args, input_kwargs)    
Description

This is the method that deals with unbalanced classification datasets.

It detects unbalanced data, decides whether the data can be balanced (extreme cases are rejected), collects information on unbalance indicators and determines the method to be applied at the classification stage in order to adjust a balanced classifier.

I/O
  • Parameters:
    • token (str): API Token.
    • experiment_name (str): Name of the experiment on which process will take place.
    • download (bool, optional): Optional boolean parameter to be set up if results needed to be downloaded.
    • target_col_name (str, optional): Specifying the target column name.
    • prepare_dataset (bool, optional): Optional boolean parameter that specifies if the dataset needs preparation or not.
    • auto_strategy (bool, optional): Determines wether to force the generation of a balanced dataset or not. If auto_strategy is set to False, a balanced dataset will always be generated.

method initial_exp_info

def initial_exp_info(self, *args, **kwargs):
    str_meth_name = sys._getframe().f_code.co_name
    input_args = locals()['args']
    input_kwargs = locals()['kwargs']

    return general_call(self, str_meth_name, input_args, input_kwargs)    
Description

This method returns initial information for the specified experiment.

I/O
  • Parameters:
    • token (str): API Token.
    • experiment_name (str): Name of the experiment on which process will take place.

method impute_missing_values

def impute_missing_values(self, *args, **kwargs):
    str_meth_name = sys._getframe().f_code.co_name
    input_args = locals()['args']
    input_kwargs = locals()['kwargs']

    return general_call(self, str_meth_name, input_args, input_kwargs)    
Description

Method to use for missing values imputation.

I/O
  • Parameters:
    • token (str): API Token.
    • experiment_name (str): Name of the experiment on which process will take place.
    • download (bool, optional): Optional boolean parameter to be set up if results needed to be downloaded.
    • target_col_name (str, optional): Specifying the target column name.
    • prepare_dataset (bool, optional): Optional boolean parameter that specifies if the dataset needs preparation or not.

method merge_cols_into_dt_index

def merge_cols_into_dt_index(self, *args, **kwargs):
    str_meth_name = sys._getframe().f_code.co_name
    input_args = locals()['args']
    input_kwargs = locals()['kwargs']

    return general_call(self, str_meth_name, input_args, input_kwargs)    
Description

This is the method in charge of finding candidate columns with which to try to build a single datetime column.

I/O
  • Parameters:
    • token (str): API Token.
    • experiment_name (str): Name of the experiment on which process will take place.
    • download (bool, optional): Optional boolean parameter to be set up if results needed to be downloaded.
    • target_col_name (str, optional): Specifying the target column name.
    • prepare_dataset (bool, optional): Optional boolean parameter that specifies if the dataset needs preparation or not.

method detect_experiment_type

def detect_experiment_type(self, *args, **kwargs):
    str_meth_name = sys._getframe().f_code.co_name
    input_args = locals()['args']
    input_kwargs = locals()['kwargs']

    return general_call(self, str_meth_name, input_args, input_kwargs)    
Description

Method that gives the option to detect experiment type.

I/O
  • Parameters:
    • token (str): API Token.
    • experiment_name (str): Name of the experiment on which process will take place.
    • target_col_name (str, optional): Specifying the target column name.
    • prepare_dataset (bool, optional): Optional boolean parameter that specifies if the dataset needs preparation or not.
    • selected_option (str, optional): For detect experiment type, the options available are: Regression, Classification, Time Series, Auto Detect.

method build_model

def build_model(self, *args, **kwargs):
    str_meth_name = sys._getframe().f_code.co_name
    input_args = locals()['args']
    input_kwargs = locals()['kwargs']

    return general_call(self, str_meth_name, input_args, input_kwargs)    
Description

Method to build the model for a given experiment.

I/O
  • Parameters:
    • token (str): API Token.
    • experiment_name (str): Name of the experiment on which process will take place.
    • target_col_name (str, optional): Specifying the target column name.
    • selected_option (str, optional): For build the model the options available are: Regression, Classification, Time Series, Auto Detect.

method operational_info

def operational_info(self, *args, **kwargs):
    str_meth_name = sys._getframe().f_code.co_name
    input_args = locals()['args']
    input_kwargs = locals()['kwargs']

    return general_call(self, str_meth_name, input_args, input_kwargs)    
Description

Through this method you can enter operational information related to each column: in this way you can specify what are the operating limits of a column and its tolerances.

You can also indicate some values that you know and that occur within the values of the column so that the impute_outliers module does not take them into account.

In addition, you can group the time-dependent columns by intervals (morning/evening/night) and you can detail whether the behavior of a column depends on the categories of another categorical column.

I/O
  • Parameters:
    • token (str): API Token.
    • experiment_name (str): Name of the experiment on which process will take place.
    • columns_info (str/list/dict): Information on columns.

method detect_outliers

def detect_outliers(self, *args, **kwargs):
    str_meth_name = sys._getframe().f_code.co_name
    input_args = locals()['args']
    input_kwargs = locals()['kwargs']

    return general_call(self, str_meth_name, input_args, input_kwargs)    
Description

This method gives the option of detect outliers. Different strategies are available, as univariate, bivariate, multivariate, complete.

I/O
  • Parameters:
    • token (str): API Token.
    • experiment_name (str): Name of the experiment to be used for outlier detection.
    • detection_strategy (str, optional): Strategies available to employ for detection: univariate, bivariate, multivariate, complete.
    • columns (str/list/tuple, optional): Defines to columns on which outliers detection is going to take place.
    • prepare_dataset (bool, optional): Optional boolean parameter that specifies if the dataset needs preparation or not.

method impute_outliers

def impute_outliers(self, *args, **kwargs):
    str_meth_name = sys._getframe().f_code.co_name
    input_args = locals()['args']
    input_kwargs = locals()['kwargs']

    return general_call(self, str_meth_name, input_args, input_kwargs)    
Description

Through this method outliers may be imputed using one of the available strategies.

I/O
  • Parameters:
    • token (str): API Token.
    • experiment_name (str): Experiment name on which outliers imputation is going to take place.
    • cols_to_impute (str/list/float): Defines to columns on which outliers imputation is going to take place.
    • handling_strategy (str/dict): Available options: 'auto', 'mean', 'median', 'mode', 'random_values', 'clipping', 'n_neighbors', 'quartile'.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for alchemyml, version 0.1.27
Filename, size File type Python version Upload date Hashes
Filename, size alchemyml-0.1.27-py3-none-any.whl (17.6 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size alchemyml-0.1.27.tar.gz (26.0 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page