Code Monkey home page Code Monkey logo

pointsorter's Introduction

A PointSorter Class

This class can sort a sequence of equally-sized float vectors in non- decreasing order. The column order by which it sorts the points is from index 0 to l -1, l the length of each vector. This ordering is identical to how alphabetical strings are sorted.

In addition to performing sorting, this class can also update the point mean and variance after each change to elements (i.e. inserting or deleting set C from the class).

Instructions

PointSorter can be used in more than one way.

In the first approach, data is loaded into the PointSorter at instantiation.

S = <s1,s2,s3>
q = PointSorter(S)

print("SORTED DATA")
print(q.newData)

In the second approach, data is inserted or deleted from PointSorter without updating the mean or variance.

ADD = <s1,s2,s3,s4,s5>
DEL = <s3,s5>

q = PointSorter(np.empty(0,len(s1)))

for p in ADD: q.insert_point(p)
for p in DEL: q.delete_point(p)

In the last approach, data is inserted or deleted from PointSorter, and PointSorter updates the mean and variance and referential extremum points (if given a reference point).

ADD = <s1,s2,s3,s4,s5>
DEL = <s3,s5>

q = PointSorter(np.empty(0,len(s1)))

for a in ADD: q.log_delta_cache(ADD,1)
for d in DEL: q.log_delta_cache(DEL,-1)

# CALL q.update_extremum HERE if have reference point
q.update_points_from_cache(referencePoint = None)

print("POINT MEAN")
print(q.pointMean)
print("POINT VARIANCE")
print(q.pointVariance)

pointsorter's People

Contributors

changissnz 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.