← Open Source
TalkingData

Fregata

A light weight, super fast, large scale machine learning library on spark .

Model DevelopmentClassical MLScala
Open on GitHub
Momentum
+0stars in 24 hours0.0%
677
Stars
182
Forks
+0
This week
4
Contributors
Created 2016-09-20 · Updated 2026-09-25 · #15126 today
Top developers
takun2szhanglistaricarusion

TalkingData/Fregata is ranked 15,126 with 677 stars.

Same-category comparison

TalkingData/Fregata is ranked 15,126 among these 8 peers; christiancosgrove/pytorch-spectral-normalization-gan is ranked 15,128.

Same-category comparison
NameRankMetrics
linwhitehat/ET-BERT15,104
Language:
Python
Stars:
679
Forks:
131
Description:
The repository of ET-BERT, a network traffic classification model on encrypted traffic. The work has been accepted as The Web Conference (WWW) 2022 accepted paper.
OpenDriveLab/OpenLane-V215,105
Language:
Jupyter Notebook
Stars:
678
Forks:
78
Description:
[NeurIPS 2023 Track Datasets and Benchmarks] OpenLane-V2: The First Perception and Reasoning Benchmark for Road Driving.
skumra/robotic-grasping15,120
Language:
Python
Stars:
678
Forks:
151
Description:
Antipodal Robotic Grasping using GR-ConvNet. IROS 2020.
EmuKit/emukit15,122
Language:
Python
Stars:
677
Forks:
135
Description:
A Python-based toolbox of various methods in decision making, uncertainty quantification and statistical emulation: multi-fidelity, experimental design, Bayesian optimisation, Bayesian quadrature, etc.
christiancosgrove/pytorch-spectral-normalization-gan15,128
Language:
Python
Stars:
677
Forks:
109
Description:
Paper by Miyato et al. https://openreview.net/forum. id=B1QRgziT-.
google/yggdrasil-decision-forests15,129
Language:
C++
Stars:
677
Forks:
85
Description:
A library to train, evaluate, interpret, and productionize decision forest models such as Random Forest and Gradient Boosted Decision Trees.
lucidrains/bottleneck-transformer-pytorch15,133
Language:
Python
Stars:
677
Forks:
81
Description:
Implementation of Bottleneck Transformer in Pytorch.
understandable-machine-intelligence-lab/Quantus15,136
Language:
Jupyter Notebook
Stars:
677
Forks:
94
Description:
[JMLR 2023] Quantus is an eXplainable AI toolkit for responsible evaluation of neural network explanations.
Key parameters and specifications
Key parameters and specifications
ParameterValue
LanguageScala
CategoryModel Development
SubcategoryClassical ML
KeywordsDistributed
Stars677
Forks182
Contributors4
Created date2016-09-20
Updated date2026-09-25
Stars in 1 day0
Stars in 7 days0
Rank15,126
Previous rank14,951
Rank change-175
7-day stars rank14,820
Previous 7-day stars rank14,838
7-day stars rank change18
Total stars rank15,265
Previous total stars rank15,238
Total stars rank change-27
CountryChina
README summary

Fregata: Machine Learning ================================== Fregata is a light weight, super fast, large scale machine learning library based on Apache Spark, and it provides high-level APIs in Scala. More accurate: For various problems, Fregata can achieve higher accuracy compared to MLLib. Higher speed: For Generalized Linear Model, Fregata often converges in one data epoch. For a 1 billion X 1 billion data set, Fregata can train a Generalized Linear Model in 1 minute with memory caching or 10 minutes without it

. Usually, Fregata is 10-100 times faster than MLLib. Parameter Free: Fregata uses GSA SGD optimization, which dosen't require learning rate tuning, because we found a way to calculate appropriate learning rate in the training process. When confronted with super high-dimension problem, Fregata calculates remaining memory dynamically to determine the sparseness of the output, balancing accuracy and efficiency automatically. Both features enable Fregata to be treated as a standard module in data processing for different problems. Lighter weight: Fregata

just uses Spark's standard API, which allows it to be integrated into most business’ data processing flow on Spark quickly and seamlessly. Architecture This documentation is about Fregata version 0. 1 core : mainly implements stand-alone algorithms based on GSA, including **Classification** **Regression** and **Clustering** Classification: supports both binary and multiple classification Regression: will release later Clustering: will release later spark : mainly implements large scale machine learning algorithms based on **spark** by wrapping **core. jar** and supplies the corresponding algorithms

**Fregata supports spark 1. ** Algorithms Trillion LR Trillion SoftMax Logistic Regression Combine Freatures Logistic Regression SoftMax RDT Installation Two ways to get Fregata by Maven or SBT : Maven's pom. sbt If you want to manual deploy to local maven repository , as follow : Quick Start Suppose that you're familiar with Spark, the example below shows how to use Fregata's **Logistic Regression**, and experimental datas can be obtained on LIBSVM Data adding Fregata into project by Maven or SBT referring to the

**Downloading** part importing packages loading training datas by Fregata's LibSvmReader API building Logsitic Regression model by trainging datas predicting the scores of instances evaluating the quality of predictions of the model by auc or other metrics Input Data Format Fregata's training API needs *RDD[(fregata. Num)]*, predicting API needs the same or *RDD[fregata. Vector]* without label if the data format is LibSvm, then *Fregata's LibSvmReader. read() API* can be used directly else some constructions are needed MailList: yongjun. com

Contributors: Contributed by TalkingData .

Frequently asked questions

How many stars and forks are recorded?

TalkingData/Fregata has 677 stars and 182 forks.

What is the repository rank?

TalkingData/Fregata is ranked 15,126.

What language and category are recorded?

TalkingData/Fregata has 677 stars, uses Scala and belongs to Model Development.

Which repository is closest in rank?

TalkingData/Fregata is compared with christiancosgrove/pytorch-spectral-normalization-gan, ranked 15,128 with 677 stars.

README

Fregata: Machine Learning

  • Fregata is a light weight, super fast, large scale machine learning library based on Apache Spark, and it provides high-level APIs in Scala.

  • More accurate: For various problems, Fregata can achieve higher accuracy compared to MLLib.

  • Higher speed: For Generalized Linear Model, Fregata often converges in one data epoch. For a 1 billion X 1 billion data set, Fregata can train a Generalized Linear Model in 1 minute with memory caching or 10 minutes without it. Usually, Fregata is 10-100 times faster than MLLib.

  • Parameter Free: Fregata uses GSA SGD optimization, which dosen't require learning rate tuning, because we found a way to calculate appropriate learning rate in the training process. When confronted with super high-dimension problem, Fregata calculates remaining memory dynamically to determine the sparseness of the output, balancing accuracy and efficiency automatically. Both features enable Fregata to be treated as a standard module in data processing for different problems.

  • Lighter weight: Fregata just uses Spark's standard API, which allows it to be integrated into most business’ data processing flow on Spark quickly and seamlessly.

Architecture

This documentation is about Fregata version 0.1

  • core : mainly implements stand-alone algorithms based on GSA, including Classification Regression and Clustering
    • Classification: supports both binary and multiple classification
    • Regression: will release later
    • Clustering: will release later
  • spark : mainly implements large scale machine learning algorithms based on spark by wrapping core.jar and supplies the corresponding algorithms

Fregata supports spark 1.x and 2.x with scala 2.10 and scala 2.11 .

Algorithms

Installation

Two ways to get Fregata by Maven or SBT :

  • Maven's pom.xml
    
       com.talkingdata.fregata
        core
        0.0.3
    
    
        com.talkingdata.fregata
        spark
        0.0.3
    
  • SBT's build.sbt
    // if you deploy to local mvn repository please add
    // resolvers += Resolver.mavenLocal
    libraryDependencies += "com.talkingdata.fregata" % "core" % "0.0.3"
    libraryDependencies += "com.talkingdata.fregata" % "spark" % "0.0.3"

If you want to manual deploy to local maven repository , as follow :

git clone https://github.com/TalkingData/Fregata.git
cd Fregata
mvn clean package install

Quick Start

Suppose that you're familiar with Spark, the example below shows how to use Fregata's Logistic Regression, and experimental datas can be obtained on LIBSVM Data

  • adding Fregata into project by Maven or SBT referring to the Downloading part
  • importing packages
	import fregata.spark.data.LibSvmReader
	import fregata.spark.metrics.classification.{AreaUnderRoc, Accuracy}
	import fregata.spark.model.classification.LogisticRegression
	import org.apache.spark.{SparkConf, SparkContext}
  • loading training datas by Fregata's LibSvmReader API
    val (_, trainData)  = LibSvmReader.read(sc, trainPath, numFeatures.toInt)
    val (_, testData)  = LibSvmReader.read(sc, testPath, numFeatures.toInt)
  • building Logsitic Regression model by trainging datas
    val model = LogisticRegression.run(trainData)
  • predicting the scores of instances
    val pd = model.classPredict(testData)
  • evaluating the quality of predictions of the model by auc or other metrics
    val auc = AreaUnderRoc.of( pd.map{
      case ((x,l),(p,c)) =>
        p -> l
    })

Input Data Format

Fregata's training API needs RDD[(fregata.Vector, fregata.Num)], predicting API needs the same or RDD[fregata.Vector] without label

	import breeze.linalg.{Vector => BVector , SparseVector => BSparseVector , DenseVector => BDenseVector}
	import fregata.vector.{SparseVector => VSparseVector }

	package object fregata {
	  type Num = Double
	  type Vector = BVector[Num]
	  type SparseVector = BSparseVector[Num]
	  type SparseVector2 = VSparseVector[Num]
	  type DenseVector = BDenseVector[Num]
	  def zeros(n:Int) = BDenseVector.zeros[Num](n)
	  def norm(x:Vector) = breeze.linalg.norm(x,2.0)
	  def asNum(v:Double) : Num = v
	}

  • if the data format is LibSvm, then Fregata's LibSvmReader.read() API can be used directly
	// sc is Spark Context
	// path is the location of input datas on HDFS
	// numFeatures is the number of features for single instance
	// minPartitions is the minimum number of partitions for the returned RDD pointing the input datas
	read(sc:SparkContext, path:String, numFeatures:Int=-1, minPartition:Int=-1):(Int, RDD[(fregata.Vector, fregata.Num)])
  • else some constructions are needed

    • Using SparseVector
    	// indices is an 0-based Array and the index-th feature is not equal to zero
    	// values  is an Array storing the corresponding value of indices
    	// length  is the total features of each instance
    	// label   is the instance's label
    
    	// input datas with label
    	sc.textFile(input).map{
    		val indicies = ...
    		val values   = ...
    		val label    = ...
    		...
    		(new SparseVector(indices, values, length).asInstanceOf[Vector], asNum(label))
    	}
    
    	// input datas without label(just for predicting API)
    	sc.textFile(input).map{
    		val indicies = ...
    		val values   = ...
    		...
    		new SparseVector(indices, values, length).asInstanceOf[Vector]
    	}
    
    • Using DenseVector
    	// datas is the value of each feature
    	// label   is the instance's label
    
    	// input datas with label
    	sc.textFile(input).map{
    		val datas = ...
    		val label = ...
    		...
    		(new DenseVector(datas).asInstanceOf[Vector], asNum(label))
    	}
    
    	// input datas without label(just for predicting API)
    	sc.textFile(input).map{
    		val datas = ...
    		...
    		new DenseVector(indices, values, length).asInstanceOf[Vector]
    	}
    

MailList:

Contributors:

Contributed by TalkingData .

Nearby in the ranking
Similar items