<commit_before>'''
    python demonstration file for NMFLibrary.

    This file illustrates how to use this library. 
    This demonstrates Frobenius-norm based 
	- multiplicative updates (MU) algorithm,
     	- hierarchical alternative least squares (HALS) algorithm, and
     	- accelerated HALS algorithm.
	
    This file is part of NMFLibrary.

    Created by H.Kasai on July 21, 2022


    To execute this script, the following setup is required. 

    See more details at 
    https://jp.mathworks.com/help/matlab/matlab_external/install-the-matlab-engine-for-python.html

	
    For Windos
		cd "matlabroot\extern\engines\python"
		python setup.py install

	macOS or Linux
		cd "matlabroot/extern/engines/python"
		python setup.py instal

	Examples (R2022 case):

	    For Windows 
            cd "c:\Program Files\MATLAB\R2022a\extern\engines\python" 
            python setup.py install

        For Linux
            cd "/usr/local/MATLAB/R2022a/bin/matlab/extern/engines/python"
            python setup.py install

		For macOS
			cd "/Applications/MATLAB_R2022a.app/extern/engines/python"
 			python setup.py install 
'''

import sys
import matplotlib.pyplot as plt
import numpy as np
import scipy.io


# generate matrix
m = 500
n = 100
V = np.random.random_sample((m,n))

# define rank to be factorized
rank = 5

# set options for solvers
options = dict()
options['verbose'] = '1'
options['max_epoch'] = '100'<commit_msg>python demo file<commit_after>'''
    python demonstration file for NMFLibrary.

    This file illustrates how to use this library. 
    This demonstrates Frobenius-norm based 
	- multiplicative updates (MU) algorithm,
     	- hierarchical alternative least squares (HALS) algorithm, and
     	- accelerated HALS algorithm.
	
    This file is part of NMFLibrary.

    Created by H.Kasai on July 21, 2022


    To execute this script, the following setup is required. 

    See more details at 
    https://www.mathworks.com/help/matlab/matlab_external/install-the-matlab-engine-for-python.html

    1. Find the path to the MATLAB folder. Start MATLAB and type matlabroot in the command window. Copy the path returned by matlabroot.

    2. Install the Engine API

       To install the engine API, choose one of the following. You must call this python install command in the specified folder.
	
       - For Windows
		cd "matlabroot\extern\engines\python"
		python setup.py install

       - macOS or Linux
		cd "matlabroot/extern/engines/python"
		python setup.py instal

	- Examples (R2022 case):

	    For Windows 
 		cd "c:\Program Files\MATLAB\R2022a\extern\engines\python" 
 		python setup.py install

            For Linux
		cd "/usr/local/MATLAB/R2022a/bin/matlab/extern/engines/python"
		python setup.py install

	    For macOS
		cd "/Applications/MATLAB_R2022a.app/extern/engines/python"
 		python setup.py install 
'''

import sys
import matplotlib.pyplot as plt
import numpy as np
import scipy.io


# generate matrix
m = 500
n = 100
V = np.random.random_sample((m,n))

# define rank to be factorized
rank = 5

# set options for solvers
options = dict()
options['verbose'] = '1'
options['max_epoch'] = '100'
{'fraction_non_alphanumeric': 0.08026649746192893, 'fraction_numerical': 0.021573604060913704, 'mean_word_length': 3.001269035532995, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1123833', 'n_tokens_mistral': 1092, 'n_tokens_neox': 944, 'n_words': 322}