FELT Labs
  • What is FELT Labs?
  • Roles
  • History
  • Guides
    • Complete Getting Started
    • Single or Multi Dataset Training
    • Start Training
    • Data Provider
    • Using FELT Algorithms
    • Creating Custom Algorithms
  • Fundamentals
    • Federated Learning
    • FELT Architecture
  • Use Cases
    • For Bussines
    • For Researches
  • Extras
    • FAQ
    • Helpful links
    • FELT Labs
Powered by GitBook
On this page
  • Supported models
  • Scikit-learn models
  • Data analytics
  • TensorFlow models
  • Using Final Models
  • Converting FELT format to Python Pickle format

Was this helpful?

  1. Guides

Using FELT Algorithms

PreviousData ProviderNextCreating Custom Algorithms

Last updated 2 years ago

Was this helpful?

We provide algorithms that you can use to train scikit-learn models and perform data analytics on CSV data. The general workflow of using the FELT application is described in the following:

If you need an algorithm for your specific use case, see the following section:

Supported models

We are extending the list of supported models. If you request a certain model, we will try to prioritize adding it to our application.

Scikit-learn models

  • Regression:

  • Classification:

  • Clustering:

  • Neural Networks:

Data analytics

  • Mean

  • Sum

  • Variance

  • Standard deviation

TensorFlow models

Coming soon

Using Final Models

FELT is using custom format (based on JSON) for storing and exchanging the models. When you finish the training, you will download your final model file (e.g. final-model-House Prices.json).

pip install feltlabs

Then you can load the model using feltlabs.model.load_model(model_path) function. This function will take the path of the model file as an argument and return the model object. Right now, we support two types of models: federated learning and federated analytics. The behaviour of each is slightly different.

Federated Learning - Scikit-learn Model

Federated Analytics Models

Similarly to federated learning models, these models can be loaded using load_model(...) a function. This time you don't have to pass any data to the model, and you can obtain calculated value (of sum, mean, variance, or std) using the model.predict(None) function. See the example below:

from feltlabs.model import load_model

# Load model
model = load_model("final-model-mean.json")
# Call predict function without any input
mean = model.predict(None)
print(mean)
# This will print the value of mean calculated by the model

Converting FELT format to Python Pickle format

You can convert the FELT model format into a standard pickle file. This file will then contain a pickled object of scikit-learn model. FELT library provides an easy command for that. After installing feltlabs.py library, you can run:

felt-export --input "final-model-House Prices.json" --output "model.pkl"

Then you can use the created file as follows:

import pickle

with open('model.pkl', 'rb') as f:
    model = pickle.load(object, f)
    
# See the above code example for data definition
model.predict(data)

In order to use it, you have to install the using pip (it requires Python 3.9 or newer, the Python 3.9 is recommended):

When using the federated learning option and importing the model using load_model(...) function, the function returns the model, which can be used as a standard object. The model can then be used for prediction using the function model.predict(data). You can check the following code for sample usage:

Linear Regression
Ridge Regression
Lasso Regression
Elastic-Net
LARS Lasso
SGD Classifier
Logistic Regression
Nearest Centroid Classifier
MLP Classifier
MLP Regressor
FELT python library
scikit-learn model
Complete Getting Started
Creating Custom Algorithms
Issues · FELT-Labs/feltlabs.pyGitHub
Here you can create issue - requesting model type
Logo