Skip to main content

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

  1. Install python
  2. Install library using pip
    pip 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)
  • fit method will return the dataframe with label column
  • last_centroid is 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)
  • fit method will return the model itself
  • predict method 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)
  • fit method will return the model itself
  • predict method 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)
  • fit method will return the model itself
  • fit_gaussian method will return the model itself
  • predict method will return the predicted value
  • predict_gaussian method will return the predicted value

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ppyPatternRecognition-0.0.3.tar.gz (10.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ppyPatternRecognition-0.0.3-py3-none-any.whl (11.3 kB view details)

Uploaded Python 3

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

Hashes for ppyPatternRecognition-0.0.3.tar.gz
Algorithm Hash digest
SHA256 1cc9928229735c40e4793bdbdb73c6b788b6af2c362c2e479c1c4b531cf0675a
MD5 1bde4c486fd5326b2adde9d2058b7d7b
BLAKE2b-256 79c75ecc818d7dfa8bd4a38e470dc3635f25dabb98b3cf910e16ab85e165a4e4

See more details on using hashes here.

File details

Details for the file ppyPatternRecognition-0.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for ppyPatternRecognition-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 86adff98b71e97725a53c943394ae54da09bc3627cfeddf994c356233c8c2d9d
MD5 24eaf8e0e577e744b0d3421e6f27cdf6
BLAKE2b-256 96b13c3abf01747df665d6bfec04fe8f12c2cbf1936e4dd392a369296ee90f35

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page