• Stars
    star
    280
  • Rank 147,492 (Top 3 %)
  • Language
    Python
  • License
    MIT License
  • Created almost 9 years ago
  • Updated over 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Simple machine learning library / 簡單易用的機器學習套件

FukuML

https://travis-ci.org/fukuball/fuku-ml.svg?branch=master https://codecov.io/github/fukuball/fuku-ml/coverage.svg?branch=master https://api.codacy.com/project/badge/grade/afc87eff27ab47d6b960ea7b3088c469

Simple machine learning library / 簡單易用的機器學習套件

Installation

$ pip install FukuML

Tutorial

Algorithm

  • Perceptron
    • Perceptron Binary Classification Learning Algorithm
    • Perceptron Multi Classification Learning Algorithm
    • Pocket Perceptron Binary Classification Learning Algorithm
    • Pocket Perceptron Multi Classification Learning Algorithm
  • Regression
    • Linear Regression Learning Algorithm
    • Linear Regression Binary Classification Learning Algorithm
    • Linear Regression Multi Classification Learning Algorithm
    • Ridge Regression Learning Algorithm
    • Ridge Regression Binary Classification Learning Algorithm
    • Ridge Regression Multi Classification Learning Algorithm
    • Kernel Ridge Regression Learning Algorithm
    • Kernel Ridge Regression Binary Classification Learning Algorithm
    • Kernel Ridge Regression Multi Classification Learning Algorithm
  • Logistic Regression
    • Logistic Regression Learning Algorithm
    • Logistic Regression Binary Classification Learning Algorithm
    • Logistic Regression One vs All Multi Classification Learning Algorithm
    • Logistic Regression One vs One Multi Classification Learning Algorithm
    • L2 Regularized Logistic Regression Learning Algorithm
    • L2 Regularized Logistic Regression Binary Classification Learning Algorithm
    • Kernel Logistic Regression Learning Algorithm
  • Support Vector Machine
    • Primal Hard Margin Support Vector Machine Binary Classification Learning Algorithm
    • Dual Hard Margin Support Vector Machine Binary Classification Learning Algorithm
    • Polynomial Kernel Support Vector Machine Binary Classification Learning Algorithm
    • Gaussian Kernel Support Vector Machine Binary Classification Learning Algorithm
    • Soft Polynomial Kernel Support Vector Machine Binary Classification Learning Algorithm
    • Soft Gaussian Kernel Support Vector Machine Binary Classification Learning Algorithm
    • Polynomial Kernel Support Vector Machine Multi Classification Learning Algorithm
    • Gaussian Kernel Support Vector Machine Multi Classification Learning Algorithm
    • Soft Polynomial Kernel Support Vector Machine Multi Classification Learning Algorithm
    • Soft Gaussian Kernel Support Vector Machine Multi Classification Learning Algorithm
    • Probabilistic Support Vector Machine Learning Algorithm
    • Least Squares Support Vector Machine Binary Classification Learning Algorithm
    • Least Squares Support Vector Machine Multi Classification Learning Algorithm
    • Support Vector Regression Learning Algorithm
  • Decision Tree
    • Decision Stump Binary Classification Learning Algorithm
    • AdaBoost Stump Binary Classification Learning Algorithm
    • AdaBoost Decision Tree Classification Learning Algorithm
    • Gradient Boost Decision Tree Regression Learning Algorithm
    • Decision Tree Classification Learning Algorithm
    • Decision Tree Regression Learning Algorithm
    • Random Forest Classification Learning Algorithm
    • Random Forest Regression Learning Algorithm
  • Neural Network
    • Neural Network Learning Algorithm
    • Neural Network Binary Classification Learning Algorithm
  • Accelerator
    • Linear Regression Accelerator
  • Feature Transform
    • Polynomial Feature Transform
    • Legendre Feature Transform
  • Validation
    • 10 Fold Cross Validation
  • Blending
    • Uniform Blending for Classification
    • Linear Blending for Classification
    • Uniform Blending for Regression
    • Linear Blending for Regression

Usage

>>> import numpy as np
# we need numpy as a base libray

>>> import FukuML.PLA as pla
# import FukuML.PLA to do Perceptron Learning

>>> your_input_data_file = '/path/to/your/data/file'
# assign your input data file, please check the data format: https://github.com/fukuball/fuku-ml/blob/master/FukuML/dataset/pla_binary_train.dat

>>> pla_bc = pla.BinaryClassifier()
# new a PLA binary classifier

>>> pla_bc.load_train_data(your_input_data_file)
# load train data

>>> pla_bc.set_param()
# set parameter

>>> pla_bc.init_W()
# init the W

>>> W = pla_bc.train()
# train by Perceptron Learning Algorithm to find best W

>>> test_data = 'Each feature of data x separated with spaces. And the ground truth y put in the end of line separated by a space'
# assign test data, format like this '0.97681 0.10723 0.64385 ........ 0.29556 1'

>>> prediction = pla_bc.prediction(test_data)
# prediction by trained W

>>> print prediction['input_data_x']
# print test data x

>>> print prediction['input_data_y']
# print test data y

>>> print prediction['prediction']
# print the prediction, will find out prediction is the same as pla_bc.test_data_y

For detail, please check https://github.com/fukuball/fuku-ml/blob/master/doc/sample_code.rst

Tests

python test_fuku_ml.py

PEP8

pep8 FukuML/*.py --ignore=E501

Donate

If you find fuku-ml useful, please consider a donation. Thank you!

  • bitcoin: 1BbihQU3CzSdyLSP9bvQq7Pi1z1jTdAaq9
  • eth: 0x92DA3F837bf2F79D422bb8CEAC632208F94cdE33

License

The MIT License (MIT)

Copyright (c) 2016 fukuball

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

More Repositories

1

jieba-php

"結巴"中文分詞:做最好的 PHP 中文分詞、中文斷詞組件。 / "Jieba" (Chinese for "to stutter") Chinese text segmentation: built to be the best PHP Chinese word segmentation module.
PHP
1,322
star
2

Awesome-Laravel-Education

A curated list of resources for learning about the Laravel PHP Framework
PHP
391
star
3

Tom-Chang-Deep-Lyrics

基於 LSTM 深度學習方法研發而成的張雨生歌詞產生模型,致敬張雨生
Python
86
star
4

rarity-analyser

Cool Rarity is an open source package for easy rarity score calculation with ERC721 NFT metadata collection. It was born in punkscape 01 rarity analyser hackathon.
JavaScript
85
star
5

CKIPClient-PHP

中研院斷詞系統的 Client 端程式,讓有中文斷詞需求的研究者或程式人員可以專注於開發自己的核心演算法。
PHP
65
star
6

FukuML-Tutorial

Tutorial of FukuML, Simple machine learning library / 簡單易用的機器學習套件 FukuML 教學手冊
Jupyter Notebook
34
star
7

Curator-New-Tab-Chrome-Extension

小海嚴選正妹分頁
CSS
26
star
8

Head-first-Chinese-text-segmentation

Head first Chinese text segmentation
Python
25
star
9

Hands-on-AI-Tools

Hands-on AI tools.
Jupyter Notebook
22
star
10

lyrics-match

本系統「再三推詞」是一個以曲找詞的舊曲新詞推薦系統,本系統提供使用者以輸入的歌曲,查詢適合搭配的歌詞。系統將根據詞曲搭配性,推薦適合搭配的歌詞,並以歌聲模擬軟體試唱。
PHP
19
star
11

Trump-Driven-Development

A curated list of Trump Driven Development
15
star
12

jieba-php.fukuball.com

jieba-php 線上展示網站
PHP
14
star
13

ec2-laravel-evn-installer

在 EC2 上快速架好符合 Laravel 運行的環境
Shell
10
star
14

react-native-orientation-loading-overlay

Orientation supported loading overlay for React Native.
JavaScript
10
star
15

iloveck101

我愛卡提諾 PHP 版本
PHP
9
star
16

Curator-Clock-Chrome-Extension

小海嚴選正妹報時
JavaScript
7
star
17

An-Introduce-to-iNDIEVOX-Open-Data-API-and-the-intelligent-music-application

An Introduce to iNDIEVOX Open Data/API and the intelligent music application
Python
6
star
18

FukuPHP

Another php web framework
PHP
5
star
19

LeetCode

My practice on LeetCode.
Python
3
star
20

remittance-project

Remittance Project
JavaScript
1
star
21

storybook

Storybook
Vue
1
star
22

fukuball.github.io

Fukuball official personal web site.
HTML
1
star