Pre-processing logic for some ML work.
Project description
📦 lib-ml-REMLA10-2024
📝 Overview
lib-ml-REMLA10-2024
provides essential functions for preprocessing and postprocessing data in machine learning projects. It includes utilities for data splitting, preprocessing, and evaluation.
🛠️ Installation
Note: Python 3.11 is required for this library!
Using Poetry
Inside your Python 3.11 virtual environment, run:
bashCopy code
poetry add lib-ml-REMLA10-2024
Using pip
Alternatively, you can install the package with pip:
bashCopy code
pip install lib-ml-REMLA10-2024
📚 Usage
Importing the Library
You can import the necessary functions in your Python modules:
pythonCopy code
from lib_ml_remla import preprocess_data, split_data
Usage examples
🔄 Preprocessing Data
pythonCopy code
from lib_ml_remla import preprocess_data, split_data
# Example data
train_data = ["1\tThis is a sample training sentence.", "0\tAnother training example."]
test_data = ["1\tThis is a sample test sentence."]
val_data = ["0\tThis is a sample validation sentence."]
# Split data
raw_X_train, raw_y_train, raw_X_val, raw_y_val, raw_X_test, raw_y_test = split_data(train_data, test_data, val_data)
# Preprocess data
X_train, y_train, X_val, y_val, X_test, y_test, char_index, tokenizer, encoder = preprocess_data(
raw_X_train, raw_y_train, raw_X_val, raw_y_val, raw_X_test, raw_y_test
)
📈 Evaluating Results
pythonCopy code
from lib_ml_remla import predict_classes, evaluate_results
from keras.models import load_model
from sklearn.preprocessing import LabelEncoder
# Load your trained model
model = load_model('path_to_your_model')
# Predict classes
labels, probabilities = predict_classes(model, encoder, X_test)
# Evaluate results
results = evaluate_results(y_test, labels)
print(results)
🛡 License
This project is licensed under the terms of the MIT
license. See LICENSE for more details.
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
Built Distribution
File details
Details for the file lib_ml_remla10_2024-1.0.2.tar.gz
.
File metadata
- Download URL: lib_ml_remla10_2024-1.0.2.tar.gz
- Upload date:
- Size: 5.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.10.12 Linux/6.5.0-1022-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d7e729c26d513749ad00fd54203fc06cfd47ecabaf9ca2545064ff550f25b3c6 |
|
MD5 | d3822cfcc214a4f3c0cfa561faafa1fa |
|
BLAKE2b-256 | 4ec8b7161d1e490a60f46cdae7473381e3831d713393a7dc18e5fe499faad45b |
File details
Details for the file lib_ml_remla10_2024-1.0.2-py3-none-any.whl
.
File metadata
- Download URL: lib_ml_remla10_2024-1.0.2-py3-none-any.whl
- Upload date:
- Size: 5.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.10.12 Linux/6.5.0-1022-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 03ac26c83e090346b8e2a26411572091c825cdfe85b57ee1f751d1b23d1f5561 |
|
MD5 | edfd6587e9fb0326f207ec559f567ffe |
|
BLAKE2b-256 | d8ea54fcbe9c7bed0bf0ee768ef11d6036eaf025f1b6c4ffb94a2350e90be3ed |