semvec/pypi-packages huggingface dataset:
mf-algorithms 0.2.2
MF Algorithms contains various matrix factorization methods utilizing different iterative update rules.
License: MIT
Requires Python: >=3.6
Keywords: mf_algorithms

# MF Algorithms

[![PyPI Version](https://img.shields.io/pypi/v/mf-algorithms.svg)](https://pypi.org/project/mf-algorithms/)
[![Supported Python Versions](https://img.shields.io/pypi/pyversions/mf-algorithms.svg)](https://pypi.org/project/mf-algorithms/)

MF Algorithms contains various matrix factorization methods utilizing different iterative update rules.

---

## Installation

To install MF Algorithms, run this command in your terminal:

```bash
$ pip install -U mf-algorithms
```

This is the preferred method to install MF Algorithms, as it will always install the most recent stable release.

If you don't have [pip](https://pip.pypa.io) installed, these [installation instructions](http://docs.python-guide.org/en/latest/starting/installation/) can guide
you through the process.

## Usage
First import `functions` from the package. `scipy.sparse` is also useful for creating toy sparse matrices to test the algorithms, thought we will manually generate factor matrices and multiply them to guarantee its rank.

```python
>>> import numpy as np
>>> from mf_algorithms import functions
```

### Matrix Factorization

```python
>>> dim1 = 1000
>>> dim2 = 1000
>>> k = 50
>>> factors = np.random.choice(4, size=(dim1,k), p=np.array([0.97, 0.01, 0.01, 0.01]))
>>> weights = np.random.choice(2, size=(k, dim2), p=np.array([0.999, 0.001]))
>>> mat = factors @ weights
>>> A, S, error = functions.mf(data = mat, k = 50, s1 = 1, s2 = 1, niter = 100, siter = 1, update = 'als', errseq = False)
```

## Citing
If you use our work in an academic setting, please cite our paper:



## Development
See [CONTRIBUTING.md](CONTRIBUTING.md) for information related to developing the code.

#### Suggested Git Branch Strategy
1. `master` is for the most up-to-date development, very rarely should you directly commit to this branch. Your day-to-day work should exist on branches separate from `master`. It is recommended to commit to development branches and make pull requests to master.4. It is recommended to use "Squash and Merge" commits when committing PR's. It makes each set of changes to `master`
atomic and as a side effect naturally encourages small well defined PR's.


#### Additional Optional Setup Steps:
* Create an initial release to test.PyPI and PyPI.
    * Follow [This PyPA tutorial](https://packaging.python.org/tutorials/packaging-projects/#generating-distribution-archives), starting from the "Generating distribution archives" section.

* Create a blank github repository (without a README or .gitignore) and push the code to it.

* Delete these setup instructions from `README.md` when you are finished with them.
letslog 0.0.5
A logger package
License: MIT

letslog
===============
This is a log module for people to log for their programs  
  
#### Required Packages
`datetime`, `logging`, `pathlib`

#### Available Levels 
INFO, DEBUG, WARNING, ERROR, CRITICAL

#### Constructor
`letslog.Letslog` constructor takes in 2 arguments with default option, one is `logPath` which states which folder that we want our log files to be put in, the other is `absolute` to indicate whether the first argument is an absolute path.  

The default value for `logPath` is `..\log` relative to the current working directory.  
The default value for `absolute` is True.  

*For example*:
If the current working directory is `~\Documents\my_program\src`, and we want to initiate a log file at an already created folder `~\Documents\my_program\log`  
The following code sample can achieve such goal:
```py
ll1 = letslog.Letslog()                                 # Uses default arguments
ll2 = letslog.Letslog('..\log', absolute=False)         # Uses relative path   
ll3 = letslog.Letslog('~\Documents\my_program\log')     # Uses absolute path  
```  

#### File Name
when we call `ll.initiateLogger('logger_id', 'INFO')`, we create a log with name `<current datetime>+<logger_id>.log`

#### Usage
```py
import letslog

ll = letslog.Letslog()                                  # Sets the log file location to default location
ll.initiateLogger('logger_id', 'INFO')                  # The created log file will be at '~\Documents\my_program\log\2020-06-24_203352logger_id.log'
ll.setLevel('WARNING')                                  # We could change the level of this logger
ll.log('This is a warning!')                            # We could write a message to the logger using current logger level
```