Code Monkey home page Code Monkey logo

apys's Introduction

apys

APYS processes your stuff.

Initialization

import { Apys } from "....";

const apys = new Apys({
  file: { path: "/path/to/your/file", type: "json/csv/arff" },
  props { your, props, here }
});

Example

JSON & ARFF

const apys = new Apys({
  file: { path: "./testdata/abyss.json", type: "json" },
})

CSV

CSV files require props to be explicitly passed for now.

const apys = new Apys({
  file: { path: "./testdata/abyss.csv", type: "csv" },
  props: { // Record <string, {"NUMBER" | "TEXT"}>
    balance: "NUMBER",
    sp: "NUMBER",
    vit: "NUMBER",
    def: "NUMBER",
    exp: "NUMBER",
    mdef: "NUMBER",
    requiem: "TEXT",
  },
})

Structure

Statistics

statsOf(prop: string)

apys.statsOf("balance")
/*
  High standard deviation indicates unreliable data.
  balance: {
    max: 14514820,
    min: -298553,
    mean: 43812.71920289855,
    median: 2988,
    mode: 0,
    standardDeviation: 618712.8147455562
  },
*/

Only the mode is returned for TEXT props.

stats()

apys.stats()
/*
{
  balance: {
    max: 14514820,
    min: -298553,
    mean: 43812.71920289855,
    median: 2988,
    mode: 0,
    standardDeviation: 618712.8147455562
  },
  sp: {
    max: 9002,
    min: 0,
    mean: 170,
    median: 3,
    mode: 2,
    standardDeviation: 610.6991411622698
  },
  vit: {
    max: 2000000,
    min: 0,
    mean: 4392.893115942029,
    median: 32458,
    mode: 3,
    standardDeviation: 85153.30005352046
  },
  def: {
    max: 7642,
    min: 0,
    mean: 73.41847826086956,
    median: 153,
    mode: 0,
    standardDeviation: 436.3290070767185
  },
  mdef: {
    max: 7680,
    min: 0,
    mean: 69.0126811594203,
    median: 15,
    mode: 0,
    standardDeviation: 417.1890441616115
  },
  class: { mode: "Novice" }
}
*/

apys's People

Contributors

retraigo avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.