{"id":15554935,"url":"https://github.com/repetere/jsonstack-model","last_synced_at":"2026-04-25T21:01:05.297Z","repository":{"id":36959965,"uuid":"253096682","full_name":"repetere/jsonstack-model","owner":"repetere","description":"Deep Learning Classification, LSTM Time Series, Regression and Multi-Layered Perceptrons with Tensorflow","archived":false,"fork":false,"pushed_at":"2024-06-18T18:16:14.000Z","size":12029,"stargazers_count":5,"open_issues_count":6,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2026-02-26T12:58:43.987Z","etag":null,"topics":["ai","classification-model","deep-learning","machine-learning","multivariate-linear-regression","nlp-machine-learning","tensorflow"],"latest_commit_sha":null,"homepage":"https://repetere.github.io/jsonstack-model/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/repetere.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2020-04-04T20:53:24.000Z","updated_at":"2024-06-16T11:18:21.000Z","dependencies_parsed_at":"2023-07-17T18:51:38.147Z","dependency_job_id":"d936e595-2b3b-4b1a-9f31-c7b2a6eef9b7","html_url":"https://github.com/repetere/jsonstack-model","commit_stats":{"total_commits":394,"total_committers":7,"mean_commits":"56.285714285714285","dds":0.3426395939086294,"last_synced_commit":"9fc0dc1d165c3c549f0f2471d931c15cb812d179"},"previous_names":["repetere/modelx-model","repetere/jsonm-model"],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/repetere/jsonstack-model","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/repetere%2Fjsonstack-model","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/repetere%2Fjsonstack-model/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/repetere%2Fjsonstack-model/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/repetere%2Fjsonstack-model/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/repetere","download_url":"https://codeload.github.com/repetere/jsonstack-model/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/repetere%2Fjsonstack-model/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32276628,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-25T18:29:39.964Z","status":"ssl_error","status_checked_at":"2026-04-25T18:29:32.149Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","classification-model","deep-learning","machine-learning","multivariate-linear-regression","nlp-machine-learning","tensorflow"],"created_at":"2024-10-02T15:05:05.755Z","updated_at":"2026-04-25T21:01:05.259Z","avatar_url":"https://github.com/repetere.png","language":"TypeScript","readme":"# @jsonstack/Model - Machine Learning and Neural Networks with Tensorflow\n[![Coverage Status](https://coveralls.io/repos/github/repetere/jsonstack-model/badge.svg?branch=main)](https://coveralls.io/github/repetere/jsonstack-model?branch=main) ![Build, Test \u0026 Coverage](https://github.com/repetere/jsonstack-model/workflows/Build,%20Test%20\u0026%20Coverage/badge.svg)\n\n## Getting started\nClone the repo and drop your module in the src directory.\n```shell\n# Install Prerequisites\n$ npm install rollup typedoc jest sitedown --g\n```\n\n## Basic Usage\n```shell\n$ npm run build #builds type declarations, created bundled artifacts with rollup and generates documenation\n```\n\n\n## Introduction\n\nThis library is a compilation of model building modules with a consistent API for quickly implementing Tensorflow at edge(browser) or any JavaScript environment (Node JS / GPU).\n\n### [Read the manual](https://repetere.github.io/jsonstack-model/manual/overview.html)\n\n## List of Tensorflow models\n\n### Classification\n\n* Deep Learning Classification: [`DeepLearningClassification`](https://repetere.github.io/jsonstack-model/manual/usage.html#classification)\n* Logistic Regression: [`LogisticRegression`](https://repetere.github.io/jsonstack-model/manual/usage.html#classification)\n\n\n### Regression\n\n* Deep Learning Regression: [`DeepLearningRegression`](https://repetere.github.io/jsonstack-model/manual/usage.html#regression)\n* Multivariate Linear Regression: [`MultipleLinearRegression`](https://repetere.github.io/jsonstack-model/manual/usage.html#regression)\n\n### Artificial neural networks (ANN)\n\n* Multi-Layered Perceptrons: [`BaseNeuralNetwork`](https://repetere.github.io/jsonstack-model/manual/usage.html#neural-networks)\n\n### LSTM Time Series\n\n* Long Short Term Memory Time Series: [`LSTMTimeSeries`](https://repetere.github.io/jsonstack-model/manual/usage.html#timeseries)\n* Long Short Term Memory Multivariate Time Series: [`LSTMMultivariateTimeSeries`](https://repetere.github.io/jsonstack-model/manual/usage.html#timeseries)\n\n## Basic Usage\n\nTensorScript is and ECMA Script module designed to be used in an `ES2015+` environment, if you need compiled modules for older versions of node use the compiled modules in the bundle folder.\n\nPlease read more on tensorflow configuration options, specifying epochs, and using custom layers in [configuration](https://repetere.github.io/jsonstack-model/manual/overview.html#configuration).\n\n### Regression Examples\n\n```javascript\nimport * as tf from '@tensorflow/tfjs-node';\nimport { MultipleLinearRegression, DeepLearningRegression, setBackend } from '@jsonstack/model';\nimport ms from 'modelscript';\n\n//setup jsonstack model tensorflow\nsetBackend(tf);\n\nasync function main(){\n  const independentVariables = [ 'sqft', 'bedrooms',];\n  const dependentVariables = [ 'price', ];\n  const housingdataCSV = await ms.csv.loadCSV('./test/mock/data/portland_housing_data.csv');\n  const DataSet = new ms.DataSet(housingdataCSV);\n  const x_matrix = DataSet.columnMatrix(independentVariables);\n  const y_matrix = DataSet.columnMatrix(dependentVariables);\n  const MLR = new MultipleLinearRegression();\n  await MLR.train(x_matrix, y_matrix);\n  const DLR = new DeepLearningRegression();\n  await DLR.train(x_matrix, y_matrix);\n  //1600 sqft, 3 bedrooms\n  await MLR.predict([1650,3]); //=\u003e[293081.46]\n  await DLR.predict([1650,3]); //=\u003e[293081.46]\n}\nmain();\n```\n\n### Classification Examples\n\n```javascript\nimport * as tf from '@tensorflow/tfjs';\nimport { DeepLearningClassification, setBackend } from '@jsonstack/model';\nimport ms from 'modelscript';\n\n//setup jsonstack model tensorflow\nsetBackend(tf);\n\nasync function main(){\n  const independentVariables = [\n    'sepal_length_cm',\n    'sepal_width_cm',\n    'petal_length_cm',\n    'petal_width_cm',\n  ];\n  const dependentVariables = [\n    'plant_Iris-setosa',\n    'plant_Iris-versicolor',\n    'plant_Iris-virginica',\n  ];\n  const housingdataCSV = await ms.csv.loadCSV('./test/mock/data/iris_data.csv');\n  const DataSet = new ms.DataSet(housingdataCSV).fitColumns({ columns: {plant:'onehot'}, });\n  const x_matrix = DataSet.columnMatrix(independentVariables);\n  const y_matrix = DataSet.columnMatrix(dependentVariables);\n  const nnClassification = new DeepLearningClassification();\n  await nnClassification.train(x_matrix, y_matrix);\n  const input_x = [\n    [5.1, 3.5, 1.4, 0.2, ],\n    [6.3, 3.3, 6.0, 2.5, ],\n    [5.6, 3.0, 4.5, 1.5, ],\n    [5.0, 3.2, 1.2, 0.2, ],\n    [4.5, 2.3, 1.3, 0.3, ],\n  ];\n  const predictions = await nnClassification.predict(input_x); \n  const answers = await nnClassification.predict(input_x, { probability:false, });\n  /*\n    predictions = [\n      [ 0.989512026309967, 0.010471616871654987, 0.00001649192017794121, ],\n      [ 0.0000016141033256644732, 0.054614484310150146, 0.9453839063644409, ],\n      [ 0.001930746017023921, 0.6456733345985413, 0.3523959517478943, ],\n      [ 0.9875779747962952, 0.01239941269159317, 0.00002274810685776174, ],\n      [ 0.9545140862464905, 0.04520365223288536, 0.0002823179238475859, ],\n    ];\n    answers = [\n      [ 1, 0, 0, ], //setosa\n      [ 0, 0, 1, ], //virginica\n      [ 0, 1, 0, ], //versicolor\n      [ 1, 0, 0, ], //setosa\n      [ 1, 0, 0, ], //setosa\n    ];\n   */\n}\nmain();\n```\n\n```javascript\nimport * as tf from '@tensorflow/tfjs';\nimport { LogisticRegression, setBackend } from '@jsonstack/model';\nimport ms from 'modelscript';\n\n//setup jsonstack model tensorflow\nsetBackend(tf);\n\nasync function main(){\n  const independentVariables = [\n    'Age',\n    'EstimatedSalary',\n  ];\n  const dependentVariables = [\n    'Purchased',\n  ];\n  const housingdataCSV = await ms.csv.loadCSV('./test/mock/data/social_network_ads.csv');\n  const DataSet = new ms.DataSet(housingdataCSV).fitColumns({ columns: {Age:['scale','standard'],\n  EstimatedSalary:['scale','standard'],}, });\n  const x_matrix = DataSet.columnMatrix(independentVariables);\n  const y_matrix = DataSet.columnMatrix(dependentVariables);\n  const LR = new LogisticRegression();\n  await LR.train(x_matrix, y_matrix);\n  const input_x = [\n    [-0.062482849427819266, 0.30083326827486173,], //0\n    [0.7960601198093905, -1.1069168538010206,], //1\n    [0.7960601198093905, 0.12486450301537644,], //0\n    [0.4144854668150751, -0.49102617539282206,], //0\n    [0.3190918035664962, 0.5061301610775946,], //1\n  ];\n  const predictions = await LR.predict(input_x); // =\u003e [ [ 0 ], [ 0 ], [ 1 ], [ 0 ], [ 1 ] ];\n}\nmain();\n```\n\n### Time Series Example\n\n```javascript\nimport * as tf from '@tensorflow/tfjs';\nimport { LSTMTimeSeries, setBackend } from '@jsonstack/model';\nimport ms from 'modelscript';\n\n//setup jsonstack model tensorflow\nsetBackend(tf);\n\nasync function main(){\n  const dependentVariables = [\n    'Passengers',\n  ];\n  const airlineCSV = await ms.csv.loadCSV('./test/mock/data/airline-sales.csv');\n  const DataSet = new ms.DataSet(airlineCSV);\n  const x_matrix = DataSet.columnMatrix(independentVariables);\n  const TS = new LSTMTimeSeries();\n  await TS.train(x_matrix);\n  const forecastData = TS.getTimeseriesDataSet([ [100 ], [200], [300], ])\n  await TS.predict(forecastData.x_matrix); //=\u003e[200,300,400]\n}\nmain();\n```\n\n ### Special Thanks\n - [Machine Learning Mastery](https://machinelearningmastery.com/)\n - [Super Data Science](https://www.superdatascience.com/)\n - [Python Programming](https://pythonprogramming.net/)\n - [Towards Data Science](https://towardsdatascience.com/)\n - [ml.js](https://github.com/mljs/ml)\n\nLicense\n----\n\nMIT","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frepetere%2Fjsonstack-model","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frepetere%2Fjsonstack-model","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frepetere%2Fjsonstack-model/lists"}