Skip to content

remla24-team10/lib-ml

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

46 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

📦 lib-ml-REMLA10-2024

License: MIT

📝 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:

poetry add lib-ml-REMLA10-2024

Using pip

Alternatively, you can install the package with pip:

pip install lib-ml-REMLA10-2024

📚 Usage

Importing the Library

You can import the necessary functions in your Python modules:

from lib_ml_remla import preprocess_data, split_data

Usage examples

🔄 Preprocessing Data

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

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.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages