Metadata-Version: 2.4
Name: evolveml
Version: 0.11.26
Summary: A Python ML library that evolves with your data. Batch + Real-time Learning, AutoML, XAI, NLP, RL, Anomaly Detection & more.
Author: SAPPA VAMSI
License: MIT
Project-URL: Homepage, https://pypi.org/project/evolveml
Keywords: machine learning,online learning,automl,explainable ai,reinforcement learning,nlp,anomaly detection
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Requires-Dist: numpy

#   evolveml — Machine Learning That Evolves With Your Data


<p align="center">
  <strong>A next-generation, modular Python Machine Learning library.</strong><br/>
  No sklearn. No tensorflow. No pytorch. Just pure Python and numpy.<br/>
  Designed for real-world use cases where data never stops and models must never stop learning.
</p>

<br/>

```bash
pip install evolveml
```

---

## 🌍 What is evolveml?

In the real world, data never stops arriving. Stock prices change every second. Bank transactions happen around the clock. Sensors stream data continuously. Emails pour in endlessly. Traditional machine learning libraries were built for a world where you collect data, train once, and deploy. But the real world does not work like that.

**evolveml was built for the real world.**

`evolveml` is a **modular, production-ready Machine Learning library** written entirely from scratch using only `numpy`. It is designed from the ground up to support two fundamental modes of learning:

- **Batch Learning** — Train your model on a full dataset at once, just like traditional ML
- **Online / Real-time Learning** — Update your model continuously as new data arrives, one sample at a time, without ever retraining from scratch

Beyond these core capabilities, `evolveml` is packed with the most important and **trending 2026 AI technologies** — including AutoML, Explainable AI, Reinforcement Learning, NLP Sentiment Analysis, Anomaly Detection, Concept Drift Detection, and Transfer Learning — all accessible through a clean, beginner-friendly API that anyone can use in just a few lines of code.

Whether you are a student learning machine learning for the first time, a developer building a production AI system, a data scientist looking for a lightweight sklearn alternative, or an engineer deploying models to IoT edge devices — **evolveml has everything you need in one single package.**

---

## 🚀 Why Choose evolveml Over sklearn?

Most developers reach for `scikit-learn` when they need machine learning. And while sklearn is a fantastic library, it was designed for a specific purpose — batch learning on static datasets. The moment you need your model to learn in real-time, detect when your data has changed, explain why it made a decision, or apply reinforcement learning — sklearn falls short.

`evolveml` was designed specifically to fill these gaps:

| Capability | evolveml | scikit-learn |
|---|:---:|:---:|
| Batch Learning | ✅ Full support | ✅ Full support |
| Real-time / Online Learning | ✅ Native built-in | ⚠️ Very limited |
| Concept Drift Detection | ✅ Built-in | ❌ Not available |
| Explainable AI (XAI) | ✅ Built-in | ❌ Needs SHAP/LIME |
| Reinforcement Learning | ✅ Built-in | ❌ Not available |
| Sentiment Analysis (NLP) | ✅ Built-in | ❌ Not available |
| Anomaly Detection for IoT | ✅ Built-in streamable | ⚠️ Batch only |
| Transfer Learning | ✅ Built-in | ❌ Not available |
| AutoML Feature Selection | ✅ Built-in | ⚠️ Needs extra setup |
| Dependencies | ✅ numpy only | ❌ Many dependencies |
| Beginner Friendly | ✅ 3-line API | ⚠️ Steep learning curve |
| Built from scratch | ✅ Learn internals | ❌ Black box |

---

## 🧩 Complete Module Reference

### 🧠 Core Machine Learning Models

**`DecisionTreeClassifier`** — A full Decision Tree classifier built from scratch using information gain and entropy. Supports any depth, handles multi-class classification, and works seamlessly with image data.

**`LinearRegressionModel`** — A clean implementation of Linear Regression using gradient descent optimization. Perfect for predicting continuous values like stock prices, house prices, or sensor readings.

**`LogisticRegressionModel`** — Logistic Regression with both batch training (`fit`) and real-time online updates (`partial_fit`). Ideal for binary classification tasks like spam detection and fraud detection.

**`NeuralNetwork`** — A fully connected neural network with configurable hidden layers, ReLU activations, softmax output, and backpropagation. Works for both binary and multi-class problems.

### ⚡ Real-time Online Learning

**`StreamLearner`** — The heart of `evolveml`. A real-time online learning model that updates itself with every single data point it sees. Feed it data one sample at a time from any stream — IoT sensors, financial feeds, web logs — and it learns continuously without ever needing a full retrain.

### 🎯 Ready-to-Use Task Models

**`FraudDetector`** — A real-time fraud detection model that processes bank transactions as they arrive. Feed it a transaction dictionary with amount, hour, location, and attempt count and it instantly tells you if it is fraudulent. It learns from every labeled transaction it sees, getting smarter over time.

**`ImageClassifier`** — An image classification model that supports two backends: Decision Tree for fast interpretable results and Neural Network for higher accuracy. Accepts flattened pixel arrays and automatically normalizes them.

**`SpamDetector`** — An email spam detection model that works in both batch mode and online mode. Supports real-time updates so your spam filter never goes stale.

**`StockPredictor`** — A stock price prediction model that trains on historical features and continuously updates as new market data arrives. Built on Linear Regression with a StreamLearner for real-time adaptation.

### 🔥 Latest 2026 Trending AI Modules

**`AutoFeatureSelector`** *(AutoML)* — Automatically identifies and selects the most important features from your dataset using correlation analysis. No more manual feature engineering. Tell it how many features you want and it does the rest.

**`AnomalyDetector`** *(Edge AI / IoT)* — Detects unusual patterns in streaming sensor or time-series data in real-time. Train it on normal data and it will immediately flag anything that deviates beyond your threshold. Also supports online updates to adapt to gradual shifts.

**`ConceptDriftDetector`** *(Adaptive ML)* — One of the most critical problems in production ML is concept drift — when your data distribution changes over time, making your model stale. This module monitors your model's prediction error over a sliding window and alerts you the moment it detects significant change.

**`ExplainableModel`** *(XAI)* — Wraps any `evolveml` model and adds full explainability. For any prediction it tells you exactly which features influenced the decision and by how much. Essential for regulated industries like banking and healthcare where explainability is a legal requirement.

**`ReinforcementAgent`** *(Agentic AI)* — A Q-Learning reinforcement learning agent. Define your states and actions and the agent learns the optimal policy through trial and error guided by rewards and penalties.

**`SentimentAnalyzer`** *(NLP)* — A real-time sentiment analysis engine that classifies text as POSITIVE, NEGATIVE, or NEUTRAL with no external NLP libraries needed. Ships with a built-in vocabulary and supports online learning so you can teach it new words at any time.

**`TransferLearner`** *(Transfer Learning)* — Reuse the knowledge from a pretrained `evolveml` model to solve a new but related problem with far less data and training time. Transfer learning is one of the most powerful ideas in modern AI and `evolveml` makes it accessible in three lines of code.

---

## 💻 Quick Start Examples

```python
# Install
pip install evolveml
```

```python
# Decision Tree
from evolveml import DecisionTreeClassifier, train_test_split
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2)
model = DecisionTreeClassifier(max_depth=10)
model.fit(X_train, y_train)
print(f"Accuracy: {model.score(X_test, y_test):.2%}")
```

```python
# Real-time Stream Learning
from evolveml import StreamLearner
model = StreamLearner(lr=0.01)
for x, y in live_data_stream:
    prediction = model.predict_one(x)
    model.learn_one(x, y)
```

```python
# Fraud Detection
from evolveml import FraudDetector
detector = FraudDetector()
transaction = {'amount': 9500, 'hour': 2, 'location_mismatch': 1, 'failed_attempts': 3}
print(detector.check(transaction))
# {'is_fraud': True, 'transaction': {...}}
detector.update(transaction, is_fraud=True)
```

```python
# Sentiment Analysis
from evolveml import SentimentAnalyzer
analyzer = SentimentAnalyzer()
print(analyzer.analyze("This product is absolutely amazing!"))
# {'sentiment': 'POSITIVE', 'confidence': 0.87}
analyzer.learn("brilliant", label='positive')
```

```python
# Anomaly Detection
from evolveml import AnomalyDetector
detector = AnomalyDetector(threshold=2.5)
detector.fit(normal_data)
print(detector.detect(new_reading))
# {'is_anomaly': True, 'score': 3.4, 'status': 'ANOMALY'}
```

```python
# Explainable AI
from evolveml import ExplainableModel, DecisionTreeClassifier
model = DecisionTreeClassifier()
model.fit(X_train, y_train)
xai = ExplainableModel(model, feature_names=['age', 'amount', 'hour'])
xai.fit(X_train, y_train)
xai.explain(X_test[0])
# → amount = 0.950 | Impact: 62.3%
# → hour   = 0.083 | Impact: 21.1%
```

```python
# Concept Drift Detection
from evolveml import ConceptDriftDetector
drift = ConceptDriftDetector()
for pred, actual in prediction_stream:
    result = drift.update(pred, actual)
    if result['drift_detected']:
        print("Model is stale — retrain now!")
```

```python
# AutoML Feature Selection
from evolveml import AutoFeatureSelector
selector = AutoFeatureSelector(top_k=5)
X_best = selector.fit_transform(X_train, y_train)
selector.report()
```

```python
# Reinforcement Learning
from evolveml import ReinforcementAgent
agent = ReinforcementAgent(n_states=100, n_actions=4)
action = agent.act(state)
agent.learn(state, action, reward=+1, next_state=next_state)
```

```python
# Transfer Learning
from evolveml import TransferLearner, DecisionTreeClassifier
source = DecisionTreeClassifier()
source.fit(X_source, y_source)
transfer = TransferLearner(source)
transfer.fit(X_target, y_target)
print(transfer.score(X_test, y_test))
```

---

## 👥 Who Is evolveml For?

**🎓 Students** — Learning machine learning? `evolveml` is built from scratch which means you can read the source code and understand exactly how Decision Trees, Neural Networks, and Gradient Descent work under the hood. No black boxes. No mystery. Just clean, readable Python.

**👨‍💻 Developers** — Building a real-time ML application? `evolveml` gives you online learning, stream processing, and anomaly detection out of the box with no extra infrastructure needed.

**🔬 Researchers** — Working on continual learning, concept drift, or adaptive systems? `evolveml` provides clean, hackable implementations of online learning algorithms that you can extend and experiment with freely.

**🏭 IoT / Edge Engineers** — Deploying ML to resource-constrained devices? `evolveml` depends only on `numpy`, has zero bloat, and its `AnomalyDetector` and `StreamLearner` are designed specifically for streaming sensor data on edge hardware.

**📊 Data Scientists** — Want a lightweight alternative to sklearn without sacrificing capability? `evolveml` covers everything from preprocessing to model evaluation in one simple package.

**🚀 Startups and Builders** — Shipping fast and need a complete ML toolkit that just works? `pip install evolveml` and you have Decision Trees, Neural Networks, NLP, Fraud Detection, and more — all ready to go immediately.

---

## 🗺️ Roadmap

- [x] v0.1.0 — Core models: Decision Tree, Linear Regression, Logistic Regression, Neural Network
- [x] v0.2.0 — StreamLearner, FraudDetector, ImageClassifier, SpamDetector, StockPredictor
- [x] v0.26.0 — AutoML, AnomalyDetector, ConceptDriftDetector, XAI, RL Agent, NLP, Transfer Learning
- [ ] v0.3.0 — TimeSeriesPredictor, KMeans Clustering from scratch
- [ ] v0.4.0 — FederatedLearner for privacy-preserving ML
- [ ] v0.5.0 — Web dashboard for real-time model monitoring
- [ ] v1.0.0 — Full stable release with complete documentation website

---

## 📄 License

MIT License — Free to use for personal and commercial projects.

---

## 👨‍💻 Author

**SAPPA VAMSI** — Python ML Library Developer

- 📦 PyPI Profile: [pypi.org/user/SAPPA_VAMSI_53](https://pypi.org/user/SAPPA_VAMSI_53/)
- 🚀 evolveml: [pypi.org/project/evolveml](https://pypi.org/project/evolveml/)
- 🔄 realtimeml: [pypi.org/project/realtimeml](https://pypi.org/project/realtimeml/)

---

<p align="center">
  <strong>Built with ❤️ by SAPPA VAMSI</strong><br/>
  <em>If evolveml helped you, give it a ⭐ and share it with others!</em>
</p>
