Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ikegami-yukino/yascikit-learn
Yet another scikit-learn
https://github.com/ikegami-yukino/yascikit-learn
ftrl k-medoids machine-learning naive-bayes-classifier python scikit-learn x-means
Last synced: 25 days ago
JSON representation
Yet another scikit-learn
- Host: GitHub
- URL: https://github.com/ikegami-yukino/yascikit-learn
- Owner: ikegami-yukino
- License: mit
- Created: 2019-01-31T15:09:15.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2023-04-19T15:02:16.000Z (over 1 year ago)
- Last Synced: 2024-09-13T11:14:36.869Z (about 2 months ago)
- Topics: ftrl, k-medoids, machine-learning, naive-bayes-classifier, python, scikit-learn, x-means
- Language: Python
- Homepage:
- Size: 31.3 KB
- Stars: 1
- Watchers: 4
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# yascikit-learn
Yet another scikit-learn## Installation
```
pip install yascikit-learn
```## USAGE
### Naive Bayes
#### Negation Naive Bayes
```python
from yasklearn.naive_bayes import NegationNB
from sklearn import datasetsdataset = datasets.load_iris()
X = dataset.data
y = dataset.target
nnb = NegationNB().fit(X, y)
nnb.predict(X)
```
#### Selective Naive Bayes
```python
from yasklearn.naive_bayes import SelectiveNB
from sklearn import datasetsdataset = datasets.load_iris()
X = dataset.data
y = dataset.target
snb = SelectiveNB().fit(X, y)
snb.predict(X)
```
#### Universal Set Naive Bayes
```python
from yasklearn.naive_bayes import UniversalSetNB
from sklearn import datasetsdataset = datasets.load_iris()
X = dataset.data
y = dataset.target
unb = UniversalSetNB().fit(X, y)
unb.predict(X)
```### FTRLProximal
#### FTRLProximalClassifier
```python
from yasklearn.ftrl_proximal import FTRLProximalClassifier
from sklearn import datasetsdataset = datasets.load_iris()
X = dataset.data
y = dataset.target
ftrlc = FTRLProximalClassifier().fit(X, y)
ftrlc.predict(X)
```#### FTRLProximalRegressor
```python
from yasklearn.ftrl_proximal import FTRLProximalRegressorregr = FTRLProximalRegressor()
```### Topic modeling
#### PLSA
```python
from yasklearn.decomposition import PLSA
from sklearn import datasetsdataset = 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.
```python
from yasklearn.decomposition import PLSV
from sklearn.datasets import fetch_20newsgroupsnewsgroups = 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
```python
from yasklearn.cluster import XMeans
from sklearn import datasetsdataset = datasets.load_iris()
X = dataset.data
xm = XMeans(n_clusters=3, random_state=1)
xm.fit_predict(X)
```#### KMedoids
```python
from yasklearn.cluster import KMedoids
from sklearn import datasetsdataset = datasets.load_iris()
X = dataset.data
km = KMedoids(n_clusters=3, random_state=1)
km.fit_predict(X)
```#### XMedoids
```python
from yasklearn.cluster import XMedoids
from sklearn import datasetsdataset = datasets.load_iris()
X = dataset.data
xm = XMedoids(n_clusters=3, random_state=1)
xm.fit_predict(X)
```### Utility
```python
from yasklearn.model_selection import train_dev_test_split
import numpy as npX = 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)
```