semvec/pypi-packages huggingface dataset:
or-datasets 0.0.3
OR Datasets
Requires Python: >=3.6
Keywords: Optimization,Nework Optimization,Combinatorial Optimization,Linear Programming,Integer Programming,Operations Research,Mathematical Programming

# OR Datasets

A client to fetch datasets across. The package is inspired by the datasets module of Scikit-learn https://scikit-learn.org/stable/datasets/

## Installation

For Python do

```
pip install or-datasets
```

## Usage

For Python the example pattern is

```
from or_datasets import fetch_vrp_rep
bunch = vrp_rep.fetch_vrp_rep(name="solomon-1987-r1", instance="R101_025")
name, n, E, c, d, Q, t, a, b, x, y = bunch["instance"]
```

This imports the `vrp_rep` module and fetches the instance named `R101_025` from the dataset denoted `solomon-1987-r1`. The `bunch` is a dictionary-like object that can contains a single dataset instances or a list of instances. For this particular case it is an instance of the vehicle routing problem with time windows and is unpacked to the instance name, number of nodes, an array of edge tuples, an arry of edge costs, an arry of node demands, a vehicle capacity, an array of travel times per edge, arrays of start and end time for customers time windows, and the x and y coordinates of the nodes.

## Data Sources

- Knapsack instances http://hjemmesider.diku.dk/~pisinger/codes.html (small coefficients, large coefficients, hard instances)
- VRP-REP http://vrp-rep.org (supports only VRPTW instances for now)
- LinerLib http://www.linerlib.org
xevo 0.52
A simple polymorph evolutionary class system
Requires Python: >=3.6

# xevo
This is a simple set of classes to use for evolutionary coding in a polymorphic way. The central classes are given by "eobj", which implements the basic structure for an object that will be optimized by the second one "evo", which handles the optimization.

#eobj
Each eobj needs to at least implement:
def __add__(a,b):
  how to combine objects a and b
def randomize(s):
  return a new completely random version of this class
def mutate(s):
  return a sligthly mutated version of this object
def calcstrength(s)->float:
  how strong is this objects version
def _copy(s):
  copy the specifics of this object

you can also override shallmaximize->bool to chance if the strength should be maximized

Finally __init__(s) should not contain any nonoptional parameters and call s.initial()

There are two simple examples of this object. pion.py tries to find a fixed value (aka np.pi) and bitflip.py tries to maximize the sum of a list of booleans. This is very simple and implements a simple counter, that counts how often any state is evaluated. You can also take a look at the deep learning example below.

#evo
This object only needs to implement two functions
def generation(s)->None:
  update the objects (stored in s.q)
def _copy(s) -> "subclass of evo":
  copy the specifics of this object

Here there is a simple example implemented in crossevo (which is also given in the package), of a batch of object, in which 2 random objects figth against each other and the weaker one is replaced by either a combination of both objects, or by a mutation of the winning one.

#erun
Runs an experiment given an evo object and an eobj object. You can also specify the size population in the initializer.
To run the experiment call run(s,maxsteps=1000000,goalstrength=1000000.0), where maxsteps is the maximum number of generation calls that can be called. And by beating goalstrength the run is stopped before.
After the run, you can call show_history(s,log=False) to show a strength history (with an optional logarithmic y axis (if log=True))

#machine learning
If you take a look at the eobj deep (deep.py and deeptools.py), you find a simple optimizer object, which tries to find the perfect network setup for a keras dense network setup. So using it requires keras and tensorflow.
customtimsort 1.1.2
Timsort sorting algorithm with custom minrun

# CustomTimSort
CustomTimSort is a library where you can sort python objects using custom minruns.

## Github: https://github.com/lehatrutenb/CustomTimSort

How to use:
```
from customtimsort import timsort, get_minrun

minrun = get_minrun(len(yours_object))
timsort(yours_object, minrun)
```

## *get_minrun(array_size: int, path_to_data: string, model_name: string)* -> int
Returns array of predicted minruns for given sizes

:param array_size: array with sizes of arrays we want to predict minrun to

:param path_to_data: name of json file with keys mean, std, standard: "data.json" - you can get it from my gihub reposiroty (dirictory models)

:param model_name: name of model that will predict minrun, standard: "standard_model" - you can get it from my github repository (dirictory models)


## *timsort(yours_object: some iterable obj, minrun: int)* -> int
Sorts yours_object using given minrun

:param yours_object: something that you want to sort (but you can't use timsort(yours_object=[...]))

:param minrun: timsort parameter for sorting (but you can't use timsort(minrun=[...]))
stahp 0.1.5
Decision support system with AHP
Requires Python: >=3
Keywords: algorithm,dss,AHP

## Project Description

Decision support systems are used in industry, to assist users in making decisions.
Many methods are used in decision making, one of which is the Analytical Hierarchy Process (AHP). In this method, several layers can be used in decision making. This package has been designed to solve the AHP method with several layers.

### Depedencies
* Python >= 3
* numpy

### How to use
* run(layers)

### Parameters
**layers** : iterable, array, np.array

> The structure of your AHP model (single layer or multi layer).

### Example structure
* Goal
* Layer 1
  * Node 1
  * Node 2
  * Node 3
 * Layer 2
   * Node 1
   * Node 2
 * Alternatives Layer
	 * Alternative 1
	 * Alternative 2
	 * Alternative 3
	 * Alternative 4
### Example of code
```
from stahp import stahp

print(stahp.run(
[
    [
        [1, .3, 5],
        [3, 1, 5],
        [.2, .2, 1]
    ],
    [
        [
            [1, .2],
            [5, 1]
        ],
        [
            [1, 3],
            [.3, 1]
        ],
        [
            [1, 4],
            [.25, 1]
        ]
    ],
    [
        [
            [1, 3, .25, 7],
            [.3, 1, .25, 7],
            [4, 4, 1, 9],
            [.14, .14, .11, 1]
        ],


        [
            [1, 3, .25, 7],
            [.3, 1, .25, 7],
            [4, 4, 1, 9],
            [.14, .14, .11, 1]
        ]
    ]
]
))
```

## Example of output
```
[0.2502 0.1562 0.5556 0.038 ] #alternative 3 is the best choice
```