Thanks to visit codestin.com
Credit goes to github.com

Skip to content

stillwwater/pysml

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple ML

Simple implementations of some ML algorithms in Python.

Usage

>>> import pysml as sml
>>> import numpy as np

>>> X = np.array([[ 1., 2.], [ 1., 4.], [ 1., 0.],
...               [10., 2.], [10., 4.], [10., 0.]])

>>> kmeans = sml.kmeans(X, n_clusters=2, random_state=0)
>>> kmeans.labels
array([0, 0, 0, 1, 1, 1], dtype=int32)            

>>> kmeans.predict([[0., 0.], [12., 3.]])
array([0, 1], dtype=int32)

>>> kmeans.centers
array([[ 1.,  2.],
       [10.,  2.]])

About

Simple ML in python

Resources

License

Stars

Watchers

Forks

Languages