Consecutive-Subsequence - Simple software to calculate susequence with highest sum

Overview

Simple software to calculate susequence with highest sum

This repository contains code and associated files for calculating the consecutive subsequence with the highest sum.This solution runs in the O(nLogn) which is mostly the time complexity of the sorting operation. Other operations are neglible as n approaches infinity. References: geeksforgeeks

Background/Introduction

Nowadays, IOT systems collect an enormous amount of sensory data every second. To make use of this large pool of sensory data in a pipeline, you might need to identify interesting subsequences. The project is an abstraction of this, with the list of integers representing the sensor data and the sum is the metric to evaluate if a subsequence is interesting. The goal of this project is to enable users to quickly obtain the highest sum from a list of integers.

High Level Flow

  • User Input: python find_subsequence.py source_data max_subsequence_length

    • source_data (mandatory): Specifies the file path where the data is stored. A text file containing integers is the expected format.
    • max_subsequence_length (optional): Specifies the maximum possible subsequence length that can be considered.
  • Output: Highest sum as an integer

Steps to run the code

  • git clone this repository at https://github.com/pharouhk/Consecutive-Subsequence.git to quickly get the source code and all other dependencies.
  • You will see the following file structure below:
    • pycahce
    • sensordata
      • input_1.txt
      • input_2.txt
      • input_3.txt
    • READme.md
    • find_subsequence.py
    • requirements.txt
    • unittest.py
  • Open the command line and run the following command. The run command requires a file path to be passed as an argument and an optional numeric argument.
    cd folder_name/Consecutive Subsequence
    pip3 install -r requirements.txt
    python find_subsequence.py sensordata/input_1.txt 2
    
  • Your result would be displayed in the stdout in the command line
  • The unit tests can be run using the following command
    python
    import unittest as u
    u.test_subsequence()
    
  • You should get "Tests Passed!" output
You might also like...
Fuzzification helps developers protect the released, binary-only software from attackers who are capable of applying state-of-the-art fuzzing techniques

About Fuzzification Fuzzification helps developers protect the released, binary-only software from attackers who are capable of applying state-of-the-

This is an easy python software which allows to sort images with faces by gender and after by age.

Gender-age Classifier This is an easy python software which allows to sort images with faces by gender and after by age. Usage First install Deepface

Arquitetura e Desenho de Software.
Arquitetura e Desenho de Software.

S203 Este é um repositório dedicado às aulas de Arquitetura e Desenho de Software, cuja sigla é "S203". E agora, José? Como não tenho muito a falar aq

A Python framework for developing parallelized Computational Fluid Dynamics software to solve the hyperbolic 2D Euler equations on distributed, multi-block structured grids.
A Python framework for developing parallelized Computational Fluid Dynamics software to solve the hyperbolic 2D Euler equations on distributed, multi-block structured grids.

pyHype: Computational Fluid Dynamics in Python pyHype is a Python framework for developing parallelized Computational Fluid Dynamics software to solve

A python software that can help blind people find things like laptops, phones, etc the same way a guide dog guides a blind person in finding his way.

GuidEye A python software that can help blind people find things like laptops, phones, etc the same way a guide dog guides a blind person in finding h

 Covid-19 Test AI (Deep Learning - NNs) Software. Accuracy is the %96.5, loss is the 0.09 :)
Covid-19 Test AI (Deep Learning - NNs) Software. Accuracy is the %96.5, loss is the 0.09 :)

Covid-19 Test AI (Deep Learning - NNs) Software I developed a segmentation algorithm to understand whether Covid-19 Test Photos are positive or negati

Trash Sorter Extraordinaire is a software which efficiently detects the different types of waste  in a pile of random trash through feeding it pictures or videos.
Trash Sorter Extraordinaire is a software which efficiently detects the different types of waste in a pile of random trash through feeding it pictures or videos.

Trash-Sorter-Extraordinaire Trash Sorter Extraordinaire is a software which efficiently detects the different types of waste in a pile of random trash

Open source hardware and software platform to build a small scale self driving car.

Donkeycar is minimalist and modular self driving library for Python. It is developed for hobbyists and students with a focus on allowing fast experimentation and easy community contributions.

Clinica is a software platform for clinical research studies involving patients with neurological and psychiatric diseases and the acquisition of multimodal data
Clinica is a software platform for clinical research studies involving patients with neurological and psychiatric diseases and the acquisition of multimodal data

Clinica Software platform for clinical neuroimaging studies Homepage | Documentation | Paper | Forum | See also: AD-ML, AD-DL ClinicaDL About The Proj

Owner
Gbadamosi Farouk
Data Scientist and Machine Learning Engineer.
Gbadamosi Farouk
Official code for our ICCV paper: "From Continuity to Editability: Inverting GANs with Consecutive Images"

GANInversion_with_ConsecutiveImgs Official code for our ICCV paper: "From Continuity to Editability: Inverting GANs with Consecutive Images" https://a

QingyangXu 38 Dec 7, 2022
null 190 Jan 3, 2023
Implements an infinite sum of poisson-weighted convolutions

An infinite sum of Poisson-weighted convolutions Kyle Cranmer, Aug 2018 If viewing on GitHub, this looks better with nbviewer: click here Consider a v

Kyle Cranmer 26 Dec 7, 2022
Sum-Product Probabilistic Language

Sum-Product Probabilistic Language SPPL is a probabilistic programming language that delivers exact solutions to a broad range of probabilistic infere

MIT Probabilistic Computing Project 57 Nov 17, 2022
Multiple-criteria decision-making (MCDM) with Electre, Promethee, Weighted Sum and Pareto

EasyMCDM - Quick Installation methods Install with PyPI Once you have created your Python environment (Python 3.6+) you can simply type: pip3 install

Labrak Yanis 6 Nov 22, 2022
Created as part of CS50 AI's coursework. This AI makes use of knowledge entailment to calculate the best probabilities to win Minesweeper.

Minesweeper-AI Created as part of CS50 AI's coursework. This AI makes use of knowledge entailment to calculate the best probabilities to win Minesweep

Beckham 0 Jul 20, 2022
A project which aims to protect your privacy using inexpensive hardware and easily modifiable software

Protecting your privacy using an ESP32, an IR sensor and a python script This project, which I personally call the "never-gonna-catch-me-in-the-act-ev

null 8 Oct 10, 2022
Software & Hardware to do multi color printing with Sharpies

3D Print Colorizer is a combination of 3D printed parts and a Cura plugin which allows anyone with an Ender 3 like 3D printer to produce multi colored

null 343 Jan 6, 2023
Research Artifact of USENIX Security 2022 Paper: Automated Side Channel Analysis of Media Software with Manifold Learning

Manifold-SCA Research Artifact of USENIX Security 2022 Paper: Automated Side Channel Analysis of Media Software with Manifold Learning The repo is org

Yuanyuan Yuan 172 Dec 29, 2022
HyDiff: Hybrid Differential Software Analysis

HyDiff: Hybrid Differential Software Analysis This repository provides the tool and the evaluation subjects for the paper HyDiff: Hybrid Differential

Yannic Noller 22 Oct 20, 2022