{"id":19267007,"url":"https://github.com/mljs/dataset-metadata","last_synced_at":"2026-06-12T01:31:00.274Z","repository":{"id":42933284,"uuid":"238064089","full_name":"mljs/dataset-metadata","owner":"mljs","description":"a class to manipulate metadata for statistical analysis","archived":false,"fork":false,"pushed_at":"2023-01-05T06:26:02.000Z","size":2426,"stargazers_count":1,"open_issues_count":11,"forks_count":0,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-02-06T02:02:58.675Z","etag":null,"topics":["metadata","multivariate-analysis"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/mljs.png","metadata":{"files":{"readme":"README.md","changelog":"History.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-02-03T21:18:10.000Z","updated_at":"2020-08-13T21:54:24.000Z","dependencies_parsed_at":"2023-02-03T15:30:45.120Z","dependency_job_id":null,"html_url":"https://github.com/mljs/dataset-metadata","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mljs%2Fdataset-metadata","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mljs%2Fdataset-metadata/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mljs%2Fdataset-metadata/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mljs%2Fdataset-metadata/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mljs","download_url":"https://codeload.github.com/mljs/dataset-metadata/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240367667,"owners_count":19790293,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["metadata","multivariate-analysis"],"created_at":"2024-11-09T20:09:14.708Z","updated_at":"2026-06-12T01:31:00.226Z","avatar_url":"https://github.com/mljs.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# dataset-metadata\n\n[![NPM version][npm-image]][npm-url]\n[![build status][travis-image]][travis-url]\n[![Test coverage][codecov-image]][codecov-url]\n[![David deps][david-image]][david-url]\n[![npm download][download-image]][download-url]\n\na class to manipulate metadata for statistical analysis\n\n## Installation\n\n`$ npm i dataset-metadata`\n\n## [API Documentation](https://mljs.github.io/dataset-metadata/)\n\n## Examples\n\nto import the package use\n```js\nconst METADATA = require('dataset-metadata');\n```\n\nor \n```js\nimport { METADATA } from 'ml-dataset-metadata';\n```\n\nto create a metadata object use\n```js\nimport { getClasses } from 'ml-dataset-iris';\nconst metadata = getClasses();\nlet L = new METADATA([metadata], { headers: ['iris'] });\n```\nthis will create an array with the class of the famous iris dataset and create a METADATA object L.\n\nList all the available metadata\n```js\nL.list()\n```\nreturns an array with all the metadata headers.\n\nRetrieve information (number of classes, counts for each classes) about a particular metadata using\n```js\nL.get('iris');\n```\n\nRetrieve values of a particular metadata as a Matrix object. This will coerce any string class into a Matrix of number with first class being \"0\", second being \"1\", etc.\n```js\nL.get('iris', { format: 'matrix' }).values\n```\n\nFor supervised method it is usual to sample a class to get a training set and a test set.\n```js\nL.sample('iris')\n```\nreturns an object with four arrays: trainIndex, testIndex, mask (a boolean filter), and classVector (the original class). \n\nTo append another metadata.\n```js\nlet newMetadata = metadata;\nL.append(NewMetadata, 'column', { header: 'duplicated' });\n``` \n\nTo remove the duplicated metadata.\n```js\nL.remove('duplicated', 'column');\n```\n\nImport and export METADATA object.\n```js\nlet L = new METADATA([metadata], { headers: ['iris'] });\n    L = JSON.stringify(L.toJSON());\n    let newL = METADATA.load(JSON.parse(L));\n```\n\n## License\n\n[MIT](./LICENSE)\n\n[npm-image]: https://img.shields.io/npm/v/dataset-metadata.svg?style=flat-square\n[npm-url]: https://www.npmjs.com/package/dataset-metadata\n[travis-image]: https://img.shields.io/travis/com/mljs/dataset-metadata/master.svg?style=flat-square\n[travis-url]: https://travis-ci.com/mljs/dataset-metadata\n[codecov-image]: https://img.shields.io/codecov/c/github/mljs/dataset-metadata.svg?style=flat-square\n[codecov-url]: https://codecov.io/gh/mljs/dataset-metadata\n[david-image]: https://img.shields.io/david/mljs/dataset-metadata.svg?style=flat-square\n[david-url]: https://david-dm.org/mljs/dataset-metadata\n[download-image]: https://img.shields.io/npm/dm/dataset-metadata.svg?style=flat-square\n[download-url]: https://www.npmjs.com/package/dataset-metadata\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmljs%2Fdataset-metadata","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmljs%2Fdataset-metadata","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmljs%2Fdataset-metadata/lists"}