Autopilotml
Automated machine learning library for analytics
Installation
Usage
Load data
from autopilotml import load_data, load_database
df = load_data(path = "dataset/titanic_train.csv", csv=True, **kwargs)
df = load_data(path = "dataset/titanic_train.xlsx", excel=True, **kwargs)
df = load_database(database_type='sqlite', sqlite_db_path = 'database.db', query='select * from employee_table')
Data Preprocessing
from autopilotml import preprocessing
df = preprocessing(dataframe=df, label_column='Survived',
missing={
'type':'impute',
'drop_columns': False,
'threshold': 0.25,
'strategy_numerical': 'knn',
'strategy_categorical': 'most_frequent',
'fill_value': None},
outlier={
'method': 'None',
'zscore_threshold': 3,
'iqr_threshold': 1.5,
'Lc': 0.05,
'Uc': 0.95,
'cap': False})
Data Transformation
from autopilotml import transformation
df, encoder = transformation(dataframe=df,
label_column='Survived',
type = 'ordinal',
target_transform = False,
cardinality = True,
Cardinality_threshold = 0.3)
Scaling
from autopilotml import scaling
df, scaler = scaling(df, label_column= 'Survived', type = 'standard', target_scaling = False)
Feature Selecction
from autopilotml import feature_selection
df, selector = feature_selection(dataframe=df, label_column='Survived',
estimator='RandomForestClassifier',
type='rfe', max_features=10,
min_features=2, scoring= 'accuracy',
cv=5)
Model Training
from autopilotml import training
model = training(dataframe=df, label_column='Survived', model_name='SVC', problem_type='Classification',
target_scaler=None, test_split =0.15, hypertune=True, n_epochs=100)
MLFlow - Track the Model Training and model Parameters
!mlflow ui