Code Monkey home page Code Monkey logo

yascikit-learn's Introduction

yascikit-learn

Yet another scikit-learn

Installation

pip install yascikit-learn

USAGE

Naive Bayes

Negation Naive Bayes

from yasklearn.naive_bayes import NegationNB
from sklearn import datasets

dataset = datasets.load_iris()
X = dataset.data
y = dataset.target
nnb = NegationNB().fit(X, y)
nnb.predict(X)

Selective Naive Bayes

from yasklearn.naive_bayes import SelectiveNB
from sklearn import datasets

dataset = datasets.load_iris()
X = dataset.data
y = dataset.target
snb = SelectiveNB().fit(X, y)
snb.predict(X)

Universal Set Naive Bayes

from yasklearn.naive_bayes import UniversalSetNB
from sklearn import datasets

dataset = datasets.load_iris()
X = dataset.data
y = dataset.target
unb = UniversalSetNB().fit(X, y)
unb.predict(X)

FTRLProximal

FTRLProximalClassifier

from yasklearn.ftrl_proximal import FTRLProximalClassifier
from sklearn import datasets

dataset = datasets.load_iris()
X = dataset.data
y = dataset.target
ftrlc = FTRLProximalClassifier().fit(X, y)
ftrlc.predict(X)

FTRLProximalRegressor

from yasklearn.ftrl_proximal import FTRLProximalRegressor

regr = FTRLProximalRegressor()

Topic modeling

PLSA

from yasklearn.decomposition import PLSA
from sklearn import datasets

dataset = datasets.load_iris()
X = dataset.data
plsa = PLSA(n_components=3, random_state=1).fit(X)
plsa.predict(X)

PLSV

Note that PLSV has not implemented predict method.

from yasklearn.decomposition import PLSV
from sklearn.datasets import fetch_20newsgroups

newsgroups = fetch_20newsgroups(subset='train')
X = list(map(lambda x: x.split(), newsgroups.data))
plsv = PLSV(n_components=20, n_dimension=2, random_state=1)
plsv.fit_transform(X)

Clustering

XMeans

from yasklearn.cluster import XMeans
from sklearn import datasets

dataset = datasets.load_iris()
X = dataset.data
xm = XMeans(n_clusters=3, random_state=1)
xm.fit_predict(X)

KMedoids

from yasklearn.cluster import KMedoids
from sklearn import datasets

dataset = datasets.load_iris()
X = dataset.data
km = KMedoids(n_clusters=3, random_state=1)
km.fit_predict(X)

XMedoids

from yasklearn.cluster import XMedoids
from sklearn import datasets

dataset = datasets.load_iris()
X = dataset.data
xm = XMedoids(n_clusters=3, random_state=1)
xm.fit_predict(X)

Utility

from yasklearn.model_selection import train_dev_test_split
import numpy as np

X = np.arange(10).reshape((5, 2))
y = range(5)
X_train, X_dev, X_test, y_train, y_dev, y_test = train_dev_test_split(
    X, y, dev_size=0.33, random_state=1)

yascikit-learn's People

Contributors

ikegami-yukino avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.