All Projects â†’ Shopify â†’ Bevel

Shopify / Bevel

Licence: mit
Ordinal regression in Python

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Bevel

infer
🔮 Use TensorFlow models in Go to evaluate Images (and more soon!)
Stars: ✭ 65 (+58.54%)
Mutual labels:  inference, prediction
forestError
A Unified Framework for Random Forest Prediction Error Estimation
Stars: ✭ 23 (-43.9%)
Mutual labels:  inference, prediction
Python
This repository helps you understand python from the scratch.
Stars: ✭ 285 (+595.12%)
Mutual labels:  pandas-dataframe, prediction
Multi Model Server
Multi Model Server is a tool for serving neural net models for inference
Stars: ✭ 770 (+1778.05%)
Mutual labels:  inference
Xnnpack
High-efficiency floating-point neural network inference operators for mobile, server, and Web
Stars: ✭ 808 (+1870.73%)
Mutual labels:  inference
Ts Pattern
🎨 A complete Pattern Matching library for TypeScript, with smart type inference.
Stars: ✭ 854 (+1982.93%)
Mutual labels:  inference
Online Relationship Learning
Unsupervised ML algorithm for predictive modeling and time-series analysis
Stars: ✭ 34 (-17.07%)
Mutual labels:  prediction
Imageai
A python library built to empower developers to build applications and systems with self-contained Computer Vision capabilities
Stars: ✭ 6,734 (+16324.39%)
Mutual labels:  prediction
Server
Serve your Rubix ML models in production with scalable stand-alone model inference servers.
Stars: ✭ 30 (-26.83%)
Mutual labels:  inference
S3bp
Read and write Python objects to S3, caching them on your hard drive to avoid unnecessary IO.
Stars: ✭ 24 (-41.46%)
Mutual labels:  pandas-dataframe
Variational gradient matching for dynamical systems
Sample code for the NIPS paper "Scalable Variational Inference for Dynamical Systems"
Stars: ✭ 22 (-46.34%)
Mutual labels:  inference
Turbotransformers
a fast and user-friendly runtime for transformer inference (Bert, Albert, GPT2, Decoders, etc) on CPU and GPU.
Stars: ✭ 826 (+1914.63%)
Mutual labels:  inference
Pandas Profiling
Create HTML profiling reports from pandas DataFrame objects
Stars: ✭ 8,329 (+20214.63%)
Mutual labels:  pandas-dataframe
Deep Learning Time Series
List of papers, code and experiments using deep learning for time series forecasting
Stars: ✭ 796 (+1841.46%)
Mutual labels:  prediction
Typing Assistant
Typing Assistant provides the ability to autocomplete words and suggests predictions for the next word. This makes typing faster, more intelligent and reduces effort.
Stars: ✭ 32 (-21.95%)
Mutual labels:  prediction
Awesome Ml Demos With Ios
The challenge projects for Inferencing machine learning models on iOS
Stars: ✭ 741 (+1707.32%)
Mutual labels:  inference
Sparkmagic
Jupyter magics and kernels for working with remote Spark clusters
Stars: ✭ 954 (+2226.83%)
Mutual labels:  pandas-dataframe
Gpdotnetv4
C# implementation of the various algorithms based on Genetic Algorithm, Genetic Programming and Artificial Neural Networks.
Stars: ✭ 19 (-53.66%)
Mutual labels:  prediction
Quickviz
Visualize a pandas dataframe in a few clicks
Stars: ✭ 18 (-56.1%)
Mutual labels:  pandas-dataframe
Neuropod
A uniform interface to run deep learning models from multiple frameworks
Stars: ✭ 858 (+1992.68%)
Mutual labels:  inference

bevel Build Status

Ordinal regression refers to a number of techniques that are designed to classify inputs into ordered (or ordinal) categories. This type of data is common in social science research settings where the dependent variable often comes from opinion polls or evaluations. For example, ordinal regression can be used to predict the letter grades of students based on the time they spend studying, or Likert scale responses to a survey based on the annual income of the respondent.

In People Analytics at Shopify, we use ordinal regression to empower Shopify employees. Our annual engagement survey contains dozens of scale questions about wellness, team health, leadership and alignment. To better dig into this data we built bevel, a repository that contains simple, easy-to-use Python implementations of standard ordinal regression techniques.

Using bevel

Fitting

The API to bevel is very similar to scikit-learn's API. A class is instantiated that has a fit method that accepts the design matrix (also called the independent variables) and the outcome array (also called the dependent variable). For bevel, the outcome array contains values from a totally-orderable set (example: {0, 1, 2, ...}, {'A', 'B', 'C', ...}, {'01', '02', '03', ...}) representing your ordinal data. (This may require some pre-processing map, for example, encoding survey responses into integers.)

The design matrix can be a numpy array, or a pandas DataFrame. The benefit of using the latter is that the DataFrame column names are displayed in inference later.

Below is an example of fitting with the OrderedLogit model.

from bevel.linear_ordinal_regression import OrderedLogit

ol = OrderedLogit()
ol.fit(X, y)
Inference and prediction

After bevel fits the model to the data, additional methods are available to use. To see the coefficients of the fitted linear model, including their standard errors and confidence intervals, use the print_summary method. Below is the output of the UCLA dataset.

ol.print_summary()
"""
                   beta  se(beta)      p  lower 0.95  upper 0.95
attribute names
pared            1.0477    0.2658 0.0001      0.5267      1.5686  ***
public          -0.0587    0.2979 0.8439     -0.6425      0.5251
gpa              0.6157    0.2606 0.0182      0.1049      1.1266    *
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Somers' D = 0.158
"""

These values as a pandas DataFrame are available on the summary property of the fitted class. The Somers' D value is a measure of the goodness-of-fit of the model, analogous to the R² value in ordinary linear regression. However, unlike R², it can vary between -1 (totally discordant) and 1 (totally concordant).

Another goal of fitting is predicting outcomes from new datasets. For this, bevel has three prediction methods, depending on your goal.

ol.predict_probabilities(X)  # returns a array with the probabilities of being in each class.
ol.predict_class(X)  # returns the class with the highest probability
ol.predict_linear_product(X)  # returns the dot product of X and the fitted coefficients
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].