This project is a JavaScript-based machine learning inference engine that implements a neural network for classifying the Iris dataset. Built using the stdlib library for mathematical operations, it demonstrates how to create and train a neural network entirely in JavaScript with efficient numerical computation capabilities.
The project features a simple but effective neural network architecture with one hidden layer, which achieves high accuracy on the classic Iris flower classification problem. It showcases both browser-based and Node.js execution environments.
The Enhanced Machine Learning Inference Engine consists of the following key components:
-
Neural Network Model:
- Implemented in
model/index.js
- Features a fully-connected architecture with one hidden layer
- Uses sigmoid activation for the hidden layer and softmax for output probabilities
- Includes forward propagation and backpropagation with SGD (Stochastic Gradient Descent)
- Implemented in
-
Data Processing:
- Manages the Iris dataset in
data/index.js
- Performs feature normalization using min-max scaling
- Converts categorical targets to numeric labels
- Manages the Iris dataset in
-
Utility Functions:
- Provides mathematical operations in
utils/index.js
- Implements the softmax activation function
- Includes helper functions like argMax for prediction
- Provides mathematical operations in
-
Web Interface:
- Offers an interactive browser-based demo in
index.html
- Displays model accuracy before and after training
- Shows predictions on sample data points
- Offers an interactive browser-based demo in
-
Training Script:
- Provides a standalone training process in
train/index.js
- Allows for model evaluation in a Node.js environment
- Provides a standalone training process in
-
Clone the repository:
git clone https://github.com/yourusername/enhanced-ml-inference-engine.git cd enhanced-ml-inference-engine
-
Install dependencies:
npm install
-
Build the project:
npm run build
This will use webpack to bundle the application into the
dist
directory.
-
Start the development server:
npm start
-
Access the application: Open your web browser and navigate to
http://localhost:8080
-
View the results: The interface will show the neural network's performance on the Iris dataset.
To run the training script directly (useful for development and testing):
npm run train
This will train the model on the Iris dataset and report the final accuracy in the terminal.
https://0prashantyadav0.github.io/stdlib-enhanced-ml-inference-engine


This project is licensed under the MIT License:
MIT License
Copyright (c) 2025 Enhanced Machine Learning Inference Engine
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.