kaml 0.3
katonic enterprise-ready model automation
License: MIT
Requires Python: >=3.7, <4

# KAML - Katonic Auto Machine Learning 

KAML is a library in python that manages machine learning lifecycle. In comparison, packaging ML code makes it more reusable and reproducible form which makes experiments more fast and efficient. KAML is a python wrapper around several machine learning libraries and frameworks such as classification, regression etc.
It also tracks experiments to record and compare parameters and results, providing a model store for managing the whole lifetime of a model, including model versioning, stage transitions, and annotations in a collaborative manner.

* KAML classification - Supports classification models such as Random Forest ,Ada Boost ,Gradient Boosting ,XG Boost ,Support Vector classifier etc. performs the model                               fitting and model prediction task,evaluate metrics for classification problem and logs the required metrics for the model.

* KAML Regression - Support models like LinearRegression, RidgeRegression ,LassoRegression ,SupportVectorRegressor etc. Calculates various evaluation parameters like MSE                         ,RMSE ,MAE ,RMSLE for the problem,predict the model and evaluate metrics function and logs the required metrics.


* KAML Timeseries - Automatic forecasting procedure (Prophet) that predicts and evaluate MAE ,r2_score ,RMSE.

* KAML Hyperparameter Tuning - An Automatic Hyperparameter Tuning tool that makes Hyperparameter tuning easier, supported for all the available regression and classification models in KAML.

## 📜Pre-requirements

* Supported Python Versions - Python >= 3.6

* Unsupported Python Versions - Python == 2.7.

## 🛠Installation

Install this library in a virtualenv using pip. 
```
 pip install kaml
```
virtualenv is a tool to create isolated Python environments. The basic problem it addresses is one of dependencies and versions, and indirectly permissions. With virtualenv, it's possible to install this library without needing system install permissions, and without clashing with the installed system dependencies.

## 🏃‍♂️Quickstart

After splitting your dataset into train and test, you can directly import packages and call different models to compare.
- Classification
```bash
from kaml.client import *
from kaml.classification import *

clf = Classifier(X_train,X_test,y_train,y_test, exp_name)

clf.GradientBoostingClassifier()
clf.DecisionTreeClassifier(max_depth=8, criterion="gini")

# Get registered models and metrics in Mlflow
df_runs = clf.search_runs(exp_id)
print("Number of runs done : ", len(df_runs))
df_runs

```

- Regression
```bash
from kaml.client import *
from kaml.regression import *

reg = Regressor(X_train,X_test,y_train,y_test, exp_name)

reg.SupportVectorRegressor()
reg.RandomForestRegressor(n_estimators=80, min_samples_split=4)

# Get registered models and metrics in Mlflow
df_runs = reg.search_runs(exp_id)
print("Number of runs done : ", len(df_runs))
df_runs

```

- Hyperparameter Tuning
```bash
from kaml.client import *
from kaml.classification import *

clf = Classifier(X_train,X_test,y_train,y_test, exp_name)

# Setup your range of parameters to be used for tuning
params = {
'max_depth': {
    'low': 8,
    'high': 15,
    'type': 'int'
    },
'criterion':{
    'values': ['gini', 'entropy'],
    'type': 'categorical'
    },
'min_samples_split': {
    'low': 2,
    'high': 5,
    'type': 'int'
    },
'min_samples_leaf':{
    'low': 1,
    'high': 5,
    'type': 'int'
    },
'max_features':{
    'values': ['auto', 'sqrt', 'log2'],
    'type': 'categorical'
    }
}
clf.DecisionTreeClassifier(is_tune=True, n_trials=50, params=params)

# Get registered models and metrics in Mlflow
df_runs = clf.search_runs(exp_id)
print("Number of runs done : ", len(df_runs))
df_runs
```

![App Screenshot](/gif/kat.gif)


## Who should use KAML?
 * Experienced data scientists for productivity increase.
 * Data Science and Machine learning enthusiasts.

## 📑Changelog

### version 0.2 (2021.12.01)
 * Bug fixes

### version 0.1 (2021.11.29)
* Initial release

kaml is a library in python that manages machine learning lifecycle. In comparison, packaging ML code makes it more reusable and reproducible form which makes experiments more fast and efficient. Kaml is a Python wrapper around several machine learning libraries and frameworks such as classification, regression etc.
It also tracks experiments to record and compare parameters and results, providing a model store for managing the whole lifetime of a model, including model versioning, stage transitions, and annotations in a collaborative manner.


## Installation

> pip install kaml

## Example