ŷhat Core API
Turn Analytical Projects into Products
ŷhat supports most regression and classification algorithms in popular scientific projects like scikit-learn and Statsmodels. Here's how to deploy a production-ready text classifier using about 10 lines of code.
Prerequisties
To read about the classifier and download the code click here.
- Request an an API Key
- Install Yhat
You can install Yhat using pip:
If you don't have pip installed check out one of these resources for how to install it:
Deployment Format
Here's our SMS classifier.
Five Steps to Deploy:
Here's what we'll do to deploy to ŷhat.
- Import the ŷhat library
- Create a subclass of
yhat.Basemodel - Define
transformandpredictfunctions. These tell ŷhat what to do when our API is called to make predictions. Ourtransformstep is just the code we wrote to convert to tf-idf vector representation and ourpredictstep is just the predict function from theMultinomialNBclassifier we're using. - Authenticate by passing your
UsernameandAPIKEYtoyhat.Yhat - Train your model and pass it to
yh.uploadto deploy it.
Following these steps...
That's it! Your model is now available as a RESTful API which can be used to make predictions from your other software systems. Check out our SMS Spam Predictor App using the Naive Bayes classifier deployed with the above code and read about it on our blog.
Conclusion
One of the perks of choosing Python over other scientific computing environments is its flexibility and versitility. Python is a powerful platform suitable for a variety of applications. Best of all, it's well known among both software developers and statisticians.
We're working hard to make ŷhat a natural extension of the Python environments familiar to both analysts and technologists in order to give teams the best medium in which to work effectively together. ŷhat empowers data science teams to turn isolated analytical work into predictive APIs which can be immediately consumed by other software systems.