AI-Aquatica

๐Ÿ“˜ Usage โ€“ AI Models (AI-Aquatica)

This guide shows how to use the AI/ML functionalities in the ml_analysis module of the AI-Aquatica library.


1. ๐Ÿ”ง Importing

from ai_aquatica.ml_analysis import (
    train_linear_regression,
    train_logistic_regression,
    train_classification_model,
    evaluate_classification_model,
    perform_clustering,
    plot_clusters,
    detect_anomalies,
    generate_synthetic_data
)

2. ๐Ÿ“Š Dataset preparation

import pandas as pd
import numpy as np

data = pd.DataFrame({
    'feature1': np.random.randn(100),
    'feature2': np.random.randn(100),
    'target': np.random.randint(0, 2, 100)
})

X = data[['feature1', 'feature2']]
y = data['target']

3. ๐Ÿ“ˆ Linear regression

model = train_linear_regression(X, y)
print("Coefficients:", model.coef_)

4. โœ… Classification (Decision Tree, SVM, KNN, Random Forest)

model = train_classification_model(X, y, model_type='random_forest')
from sklearn.model_selection import train_test_split
X_train, X_test, y_train, y_test = train_test_split(X, y)
metrics = evaluate_classification_model(model, X_test, y_test)
print(metrics)

5. ๐Ÿงฌ Clustering (KMeans/DBSCAN)

cluster_model, labels = perform_clustering(X, algorithm='kmeans', n_clusters=3)
plot_clusters(X, labels)

6. ๐Ÿ” Anomaly detection (Isolation Forest / LOF)

anomalies = detect_anomalies(X, method='isolation_forest')
print("Detected:", anomalies)

7. ๐Ÿงช Generate synthetic data with GAN

synthetic = generate_synthetic_data(X, model_type='gan', epochs=100)
synthetic.head()

๐Ÿ“˜ Notes


๐Ÿง  Tip

Use these tools in combination with preprocessing utilities such as ai_aquatica.data_cleaning or ai_aquatica.data_standardization, along with ai_aquatica.visualization, for full pipelines!