This repository contains example projects that you can use to get started with Layer.
Layer is a collaborative MLOps platform where you can build, train, version and share your machine learning (ML) models.
The first step is to install Layer:
pip install layer
The first step is to clone this repository:
git clone https://github.com/layerai/examples
Next, select one example project and change into that folder. Let's use the Titanic example for illustration:
cd examples/titanic
Open the associated notebook or Python script and run it. Layer runs your project and places the generated entities in the appropriate Discover tabs.
Entities generated with Layer can also be accessed in a Jupyter Notebook. Layer allows you to access the datasets, feature sets, and models.
First, let's look at how to access the created datasets:
import layer
dataset = layer.get_dataset('layer/titanic/datasets/passengers')
The model can be accessed using Layer get_model
function:
import layer
model = layer.get_model('layer/titanic/models/survival_model')
The model can be used to make predictions right away:
df = layer.get_dataset("passengers").to_pandas()
passenger = df[['Pclass', 'Sex', 'Age', 'SibSp', 'Parch', 'Fare']]
survival_probability = model.get_train().predict_proba(passenger.sample())[0][1]
print(f"Survival Probability: {survival_probability:.2%}")
# > Survival Probability: 68.37%
To learn more about using layer, you can:
- Join our Slack Community
- Visit Layer Examples Repo for more examples
- Browse Trending Layer Projects on our mainpage
- Check out Layer Documentation to learn more