Skip to main content

simple classification algorithms

Project description

#Latte

This is a simple package for data classification

#Contents/functions

# Linear Regression

The linear(filename, cl1, cl2, predict_value) function performs linear regression on a given dataset and predicts the value for a given input. It takes the following parameters: - filename: The name of the CSV file containing the dataset. - cl1: The column index of the independent variable (x). - cl2: The column index of the dependent variable (y). - predict_value: The input value for which the prediction is to be made.

The function calculates the slope and intercept of the regression line using the least squares method. It then plots the data points, regression line, and prediction. The function returns the slope, intercept, and prediction as results.

# Logistic Regression

The logistic(filename, cl1, cl2, predict_value) function performs logistic regression on a given dataset and predicts the probability and class for a given input. It takes the following parameters: - filename: The name of the CSV file containing the dataset. - cl1: The column index of the independent variable (x). - cl2: The column index of the dependent variable (y). - predict_value: The input value for which the prediction is to be made.

The function uses scikit-learn’s LogisticRegression class to fit the logistic regression model and predict the probability and class for the input. It plots the data points, logistic regression curve, and prediction. The function returns the probability and prediction as results.

# Decision Tree Classification

The dtree(filename, cl1, cl2, predict_value) function performs decision tree classification on a given dataset and predicts the class for a given input. It takes the following parameters: - filename: The name of the CSV file containing the dataset. - cl1: The column index of the independent variable (x). - cl2: The column index of the dependent variable (y). - predict_value: The input value for which the prediction is to be made.

The function uses scikit-learn’s DecisionTreeClassifier class to fit the decision tree model and predict the class for the input. It plots the data points, decision tree boundary, and prediction. The function returns the prediction as a result.

# Matrix Operations

The matrix_ml(matrix1, matrix2) function performs matrix multiplication on two given matrices. It takes the following parameters: - matrix1: The first matrix. - matrix2: The second matrix.

The function uses numpy’s dot function to perform matrix multiplication and returns the result.

The matrix_add(matrix1, matrix2) function performs matrix addition on two given matrices. It takes the following parameters: - matrix1: The first matrix. - matrix2: The second matrix.

The function uses numpy’s add function to perform matrix addition and returns the result.

Change Log

0.0.5 (18/07/2023)

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

latteOne-0.0.5.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

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

latteOne-0.0.5-py3-none-any.whl (2.7 kB view details)

Uploaded Python 3

File details

Details for the file latteOne-0.0.5.tar.gz.

File metadata

  • Download URL: latteOne-0.0.5.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.10

File hashes

Hashes for latteOne-0.0.5.tar.gz
Algorithm Hash digest
SHA256 1a14eafcda3b2677fe9258378dbb13e205f52307a78fde0a225a4a3552e83fa0
MD5 2664cb58a8e2fcf44af35165a972f17b
BLAKE2b-256 dc1df77fbb6ed7c724d7f0ab7939a004585a96891a52c08168f2591a27d3c614

See more details on using hashes here.

File details

Details for the file latteOne-0.0.5-py3-none-any.whl.

File metadata

  • Download URL: latteOne-0.0.5-py3-none-any.whl
  • Upload date:
  • Size: 2.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.10

File hashes

Hashes for latteOne-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 3fb0a80da3ab8374400c939bd10125c7e38d5c5cdc616d2ba45a17caae19b3cf
MD5 c3aac31ee756c8cd5659189720106d1b
BLAKE2b-256 4e0b4fcbf27bd5cfd672b81fcb5ae49602189e41359490f97fe3b0075db826a6

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