Skip to main content

litelearn

a python library for building models without fussing over the nitty gritty details for data munging

installation

pip install litelearn

usage

once you have a pandas dataframe you can create a model for your dataset in 3 lines of code:

Regression

# load some dataset
import seaborn as sns

dataset = "penguins"
target = "body_mass_g"
df = sns.load_dataset(dataset).dropna(subset=[target])

# just 3 lines of code to create and evaluate a model
import litelearn as ll

model = ll.regress_df(df, target)
model.display_evaluation() 

Classification

# load some dataset
import seaborn as sns

dataset = "penguins"
target = "species"
df = sns.load_dataset(dataset).dropna(subset=[target])

# just 3 lines of code to create and evaluate a model
import litelearn as ll

model = ll.classify_df(df, target)
model.display_evaluation()

Prediction

prediction is easy too, it will work on any data that resembles the training data. dtypes don't have to match, and you can even have extra columns in your prediction data. missing values and unknown categories will be imputed with the training data's values.

df = ...  # load some dataframe
split = int(len(df) * 0.8)
train_df, val_df = df[:split], df[split:] 
model = ...  # build some model
pred = model.predict(val)  # predict on unseen data

features

  • does all the data munging for you, including missing data, categorical data handling
  • uses the robust catboost library for gradient boosting, which is known for generating high quality models with little tuning
  • supports shap for explainability. call model.display_shap() or model.get_shap() to get the shap values for your model
  • supports sklearn's permutation importance call model.display_permutation_importance() or model.get_permutation_importance() to get feature importances that are biased towards the model's performance on test data.
  • supports easy pickling: to save your model simply call model.save("path/to/model.pkl") and to load your model call model.load("path/to/model.pkl")
  • for regression models, you can call model.display_residuals() to see the residuals of your model
  • it also supports segmeents for your data using the model.set_segments() method. this will create a new column in your dataframe called segment which you can use to group your data. this is useful for seeing how your model performs on different segments of your data.

Metadata

Release files for litelearn 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for litelearn 0.3.0
File Size Uploaded
litelearn-0.3.0.tar.gz 12.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for litelearn 0.3.0
File Interpreter ABI Platform
litelearn-0.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 28.1 kB

Release files / litelearn-0.3.0.tar.gz

Download URL litelearn-0.3.0.tar.gz
Size 12.9 kB
Tags Source
SHA-256 checksum
How to use checksums
80f0d56c30b624c62b51c294ee05bd312d9f4ced362976fbc10a52e934f6409c
BLAKE2b-256 checksum
How to use checksums
eeb4c7e2d27a8d6fa28e39d1c4c96b17051fa5522ee26b8dba83f056fd9a6252
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.4.2 CPython/3.9.15 Windows/10

Release files / litelearn-0.3.0-py3-none-any.whl

Download URL litelearn-0.3.0-py3-none-any.whl
Size 15.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4a065fed8cd07ce8804d489361792bbb6029b15a30af1719f18744042198e9f3
BLAKE2b-256 checksum
How to use checksums
72b6dccea9ec4fda687a8eabba4eca3b42d42d86ba49327f8fe4343ec6ebb23f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.4.2 CPython/3.9.15 Windows/10

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 release files

0.2.8

2 release files

0.2.7

2 release files

0.2.6

2 release files

0.2.5

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page