Pattern Recognition Package
Project description
ppyPatternRecognition
[Should read this in github]
This is a library about AI model. All the model ideas are come from inclass lecture.
You can see the class github here which is created by Aj. Ekapol.
Table of content
Provided model
How to install
- Install python
- Install library using
pippip install -U ppyPatternRecognition
K-means
code here
example
from ppyPatternRecognition import Kmeans
df = pd.read_csv(...)
k_means = Kmeans()
# fit the model
labeled_df = k_means.fit(df, k=3)
# print the label
print(labeled_df['label'])
# get the last centroid
print(k_means.last_centroid)
fitmethod will return the dataframe with label columnlast_centroidis the last centroid of the model after fitting
Linear regression
code here
example
from ppyPatternRecognition import LinearRegression
df = pd.read_csv(...)
X_train, y_train = ...
linear_regression = LinearRegression()
# fit the model
linear_regression.fit(X_train, y_train, epochs=1000, lr=0.01)
# predict
y_pred = linear_regression.predict(X_test)
fitmethod will return the model itselfpredictmethod will return the predicted value
Logistic regression
code here
example
from ppyPatternRecognition import LogisticRegression
df = pd.read_csv(...)
X_train, y_train = ...
logistic_regression = LogisticRegression()
# fit the model
logistic_regression.fit(X_train, y_train, epochs=1000, lr=0.01)
# predict
y_pred = logistic_regression.predict(X_test)
fitmethod will return the model itselfpredictmethod will return the predicted value
Simple Naïve Bayes
code here
example
from ppyPatternRecognition import SimpleBayesClassifier
df = pd.read_csv(...)
X_train, y_train = ...
simple_naive_bayes = SimpleBayesClassifier()
# fit the model
simple_naive_bayes.fit(X_train, y_train)
# predict
y_pred = simple_naive_bayes.predict(X_test)
fitmethod will return the model itselffit_gaussianmethod will return the model itselfpredictmethod will return the predicted valuepredict_gaussianmethod will return the predicted value
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ppyPatternRecognition-0.0.3.tar.gz.
File metadata
- Download URL: ppyPatternRecognition-0.0.3.tar.gz
- Upload date:
- Size: 10.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.9.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1cc9928229735c40e4793bdbdb73c6b788b6af2c362c2e479c1c4b531cf0675a
|
|
| MD5 |
1bde4c486fd5326b2adde9d2058b7d7b
|
|
| BLAKE2b-256 |
79c75ecc818d7dfa8bd4a38e470dc3635f25dabb98b3cf910e16ab85e165a4e4
|
File details
Details for the file ppyPatternRecognition-0.0.3-py3-none-any.whl.
File metadata
- Download URL: ppyPatternRecognition-0.0.3-py3-none-any.whl
- Upload date:
- Size: 11.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.9.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
86adff98b71e97725a53c943394ae54da09bc3627cfeddf994c356233c8c2d9d
|
|
| MD5 |
24eaf8e0e577e744b0d3421e6f27cdf6
|
|
| BLAKE2b-256 |
96b13c3abf01747df665d6bfec04fe8f12c2cbf1936e4dd392a369296ee90f35
|