text stringlengths 81 112k |
|---|
r""" Kronecker product followed by dot product.
Let :math:`\mathrm A`, :math:`\mathrm B`, and :math:`\mathrm C` be matrices of
dimensions :math:`p\times p`, :math:`n\times d`, and :math:`d\times p`.
It computes
.. math::
\text{unvec}((\mathrm A\otimes\mathrm B)\text{vec}(\mathrm C))
... |
Check if ``A`` is a semi-definite positive matrix.
Args:
A (array_like): Matrix.
Returns:
bool: ``True`` if ``A`` is definite positive; ``False`` otherwise.
def check_semidefinite_positiveness(A):
"""Check if ``A`` is a semi-definite positive matrix.
Args:
A (array_like): Mat... |
Check if ``A`` is a symmetric matrix.
Args:
A (array_like): Matrix.
Returns:
bool: ``True`` if ``A`` is symmetric; ``False`` otherwise.
def check_symmetry(A):
"""Check if ``A`` is a symmetric matrix.
Args:
A (array_like): Matrix.
Returns:
bool: ``True`` if ``A`` ... |
r"""Solve for Cholesky decomposition.
Solve the linear equations :math:`\mathrm A \mathbf x = \mathbf b`,
given the Cholesky factorization of :math:`\mathrm A`.
Args:
L (array_like): Lower triangular matrix.
b (array_like): Right-hand side.
Returns:
:class:`numpy.ndarray`: The... |
get filename and check if in getcwd then get from
the package resources folder
def file_or_resource(fname=None):
'''get filename and check if in getcwd then get from
the package resources folder
'''
if fname is not None:
filename = os.path.expanduser(fname)
resource_package = o... |
r"""Shortcut to ``solve_triangular(A, b, lower=True, check_finite=False)``.
Solve linear systems :math:`\mathrm A \mathbf x = \mathbf b` when
:math:`\mathrm A` is a lower-triangular matrix.
Args:
A (array_like): A lower-triangular matrix.
b (array_like): Ordinate values.
Returns:
... |
Try and find the full path and file extension of the executable to run.
This is so that e.g. calls to 'somescript' will point at 'somescript.cmd'
without the need to set shell=True in the subprocess.
If the executable contains periods it is a special case. Here the
win32api call will fail to resolve the... |
Run an external process.
File system path objects (PEP-519) are accepted in the command, environment,
and working directory arguments.
:param array command: Command line to be run, specified as array.
:param timeout: Terminate program execution after this many seconds.
:param boolean debug: Enable... |
A stand-in function that returns a valid result dictionary indicating a
successful execution. The external process is not run.
def run_process_dummy(command, **kwargs):
"""
A stand-in function that returns a valid result dictionary indicating a
successful execution. The external process is not run.
... |
API used up to version 0.2.0.
def run_process(*args, **kwargs):
"""API used up to version 0.2.0."""
warnings.warn(
"procrunner.run_process() is deprecated and has been renamed to run()",
DeprecationWarning,
stacklevel=2,
)
return run(*args, **kwargs) |
Add a single character to buffer. If one or more full lines are found,
print them (if desired) and pass to callback function.
def add(self, data):
"""
Add a single character to buffer. If one or more full lines are found,
print them (if desired) and pass to callback function.
""... |
Print/send any remaining data to callback function.
def flush(self):
"""Print/send any remaining data to callback function."""
self._buffer += self._decoder.decode(b"", final=True)
if self._buffer:
if self._print:
print(self._buffer)
if self._callback:
... |
Retrieve the stored data in full.
This call may block if the reading thread has not yet terminated.
def get_output(self):
"""
Retrieve the stored data in full.
This call may block if the reading thread has not yet terminated.
"""
self._closing = True
if not self.... |
r"""Trace of :math:`\mathrm A \mathrm B^\intercal`.
Args:
A (array_like): Left-hand side.
B (array_like): Right-hand side.
Returns:
float: Trace of :math:`\mathrm A \mathrm B^\intercal`.
def trace2(A, B):
r"""Trace of :math:`\mathrm A \mathrm B^\intercal`.
Args:
A (ar... |
r"""Add values ``D`` to the diagonal of matrix ``A``.
Args:
A (array_like): Left-hand side.
D (array_like or float): Values to add.
out (:class:`numpy.ndarray`, optional): copy result to.
Returns:
:class:`numpy.ndarray`: Resulting matrix.
def sum2diag(A, D, out=None):
r"""... |
Convert Hiragana to Full-width (Zenkaku) Katakana.
Parameters
----------
text : str
Hiragana string.
ignore : str
Characters to be ignored in converting.
Return
------
str
Katakana string.
Examples
--------
>>> print(jaconv.hira2kata('ともえまみ'))
トモエマミ... |
Convert Hiragana to Half-width (Hankaku) Katakana
Parameters
----------
text : str
Hiragana string.
ignore : str
Characters to be ignored in converting.
Return
------
str
Half-width Katakana string.
Examples
--------
>>> print(jaconv.hira2hkata('ともえまみ')... |
Convert Full-width Katakana to Hiragana
Parameters
----------
text : str
Full-width Katakana string.
ignore : str
Characters to be ignored in converting.
Return
------
str
Hiragana string.
Examples
--------
>>> print(jaconv.kata2hira('巴マミ'))
巴まみ
... |
Convert Half-width (Hankaku) Katakana to Full-width (Zenkaku) Katakana
Parameters
----------
text : str
Half-width Katakana string.
ignore : str
Characters to be ignored in converting.
kana : bool
Either converting Kana or not.
ascii : bool
Either converting asci... |
Convert Full-width (Zenkaku) Katakana to Half-width (Hankaku) Katakana
Parameters
----------
text : str
Full-width Katakana string.
ignore : str
Characters to be ignored in converting.
kana : bool
Either converting Kana or not.
ascii : bool
Either converting asci... |
Convert Half-width (Hankaku) Katakana to Full-width (Zenkaku) Katakana,
Full-width (Zenkaku) ASCII and DIGIT to Half-width (Hankaku) ASCII
and DIGIT.
Additionally, Full-width wave dash (〜) etc. are normalized
Parameters
----------
text : str
Source string.
mode : str
Unicode... |
Convert Hiragana to hepburn-style alphabets
Parameters
----------
text : str
Hiragana string.
Return
------
str
Hepburn-style alphabets string.
Examples
--------
>>> print(jaconv.kana2alphabet('まみさん'))
mamisan
def kana2alphabet(text):
"""Convert Hiragana t... |
Convert alphabets to Hiragana
Parameters
----------
text : str
Alphabets string.
Return
------
str
Hiragana string.
Examples
--------
>>> print(jaconv.alphabet2kana('mamisan'))
まみさん
def alphabet2kana(text):
"""Convert alphabets to Hiragana
Parameters
... |
Plot a histogram as a series of data points.
Compute and draw the histogram of *x* using individual (x,y) points
for the bin contents.
By default, vertical poisson error bars are calculated using the
gamma distribution.
Horizontal error bars are omitted by default.
These can be enabled using ... |
Get an eventlet pool used to dispatch requests.
def pool(self):
"""Get an eventlet pool used to dispatch requests."""
self._pool = self._pool or eventlet.GreenPool(size=self.pool_size)
return self._pool |
Start the process with daemonization.
If the process is already started this call should exit with code
ALREADY_RUNNING. Otherwise it must call the 'daemonize' method and then
call 'run'.
def start(self):
"""Start the process with daemonization.
If the process is already start... |
Stop the daemonized process.
If the process is already stopped this call should exit successfully.
If the process cannot be stopped this call should exit with code
STOP_FAILED.
def stop(self):
"""Stop the daemonized process.
If the process is already stopped this call should e... |
Set a function to run when the given signal is recieved.
Multiple handlers may be assigned to a single signal. The order of
handlers does not need to be preserved.
'signum' must be an integer representing a signal.
'handler' must be a callable.
def handle(self, signum, handler):
... |
Send the given signal to the running process.
If the process is not running a RuntimeError with a message of "No such
process" should be emitted.
def send(self, signum):
"""Send the given signal to the running process.
If the process is not running a RuntimeError with a message of "No... |
Handler for all signals.
This method must be used to handle all signals for the process. It is
responsible for runnin the appropriate signal handlers registered with
the 'handle' method unless they are shutdown signals. Shutdown signals
must trigger the 'shutdown' method.
def _handle_s... |
Handle all signals which trigger a process stop.
This method should run all appropriate signal handlers registered
through the 'handle' method. At the end it should cause the process
to exit with a status code. If any of the handlers raise an exception
the exit code should be SHUTDOWN_F... |
Given a dataset path, the following structure is to be expected:
- path/
- files/
- S_00000.gdm
- S_00000.gdm.meta
- S_00001.gdm
- S_00001.gdm.meta
- ...
- schema.xml
- [profile.xml]
... |
A GDM dataset has the form:
- S_00000.gdm
- S_00000.gdm.meta
- S_00001.gdm
- S_00001.gdm.meta
- ...
- schema.xml
- [profile.xml]
- [web_profile.xml]
:param files: path of the dataset
:return: True if the path contains a gdm dataset
def check_for_d... |
Loads the data from a local path into a GMQLDataset.
The loading of the files is "lazy", which means that the files are loaded only when the
user does a materialization (see :func:`~gmql.dataset.GMQLDataset.GMQLDataset.materialize` ).
The user can force the materialization of the data (maybe for an initial ... |
Loads the data from a remote repository.
:param remote_name: The name of the dataset in the remote repository
:param owner: (optional) The owner of the dataset. If nothing is provided, the current user
is used. For public datasets use 'public'.
:return: A new GMQLDataset or a GDataframe
... |
Perform a scan for access points in the area.
Arguments:
interface - device to use for scanning (e.g. eth1, wlan0).
def scan(interface):
"""Perform a scan for access points in the area.
Arguments:
interface - device to use for scanning (e.g. eth1, wlan0).
"""
interface = _get_byte... |
Before doing any remote operation, the user has to login to the GMQL serivice.
This can be done in the two following ways:
* Guest mode: the user has no credentials and uses the system only as a temporary guest
* Authenticated mode: the users has credentials and a stable remote account
... |
Logout from the remote account
:return: None
def logout(self):
""" Logout from the remote account
:return: None
"""
url = self.address + "/logout"
header = self.__check_authentication()
response = requests.get(url, headers=header)
if response.status_cod... |
Returns the list of available datasets for the current user.
:return: a pandas Dataframe
def get_dataset_list(self):
""" Returns the list of available datasets for the current user.
:return: a pandas Dataframe
"""
url = self.address + "/datasets"
header = self.__check_... |
Get the list of samples of a specific remote dataset.
:param dataset_name: the dataset name
:param owner: (optional) who owns the dataset. If it is not specified, the current user
is used. For public dataset use 'public'.
:return: a pandas Dataframe
def get_dataset_samples(self,... |
Given a dataset name, it returns a BedParser coherent with the schema of it
:param dataset_name: a dataset name on the repository
:param owner: (optional) who owns the dataset. If it is not specified, the current user
is used. For public dataset use 'public'.
:return: a BedParser... |
Upload to the repository an entire dataset from a local path
:param dataset: the local path of the dataset
:param dataset_name: the name you want to assign to the dataset remotely
:return: None
def upload_dataset(self, dataset, dataset_name, schema_path=None):
""" Upload to the reposit... |
Deletes the dataset having the specified name
:param dataset_name: the name that the dataset has on the repository
:return: None
def delete_dataset(self, dataset_name):
""" Deletes the dataset having the specified name
:param dataset_name: the name that the dataset has on the reposito... |
It downloads from the repository the specified dataset and puts it
in the specified local folder
:param dataset_name: the name the dataset has in the repository
:param local_path: where you want to save the dataset
:param how: 'zip' downloads the whole dataset as a zip file and decompre... |
Execute a GMQL textual query on the remote server.
:param query: the string containing the query
:param output_path (optional): where to store the results locally. If specified
the results are downloaded locally
:param file_name (optional): the name of the query
:param ou... |
Get information about the specified remote job
:param jobId: the job identifier
:return: a dictionary with the information
def trace_job(self, jobId):
""" Get information about the specified remote job
:param jobId: the job identifier
:return: a dictionary with the information... |
Sets the behavior of the API
:param how: if 'remote' all the execution is performed on the remote server; if 'local' all
it is executed locally. Default = 'local'
:return: None
def set_mode(how):
""" Sets the behavior of the API
:param how: if 'remote' all the execution is performed on the... |
Enables or disables the progress bars for the loading, writing and downloading
of datasets
:param how: True if you want the progress bar, False otherwise
:return: None
Example::
import gmql as gl
gl.set_progress(True) # abilitates progress bars
# ....do something...
... |
Enables or disables the profiling of metadata at the loading of a GMQLDataset
:param how: True if you want to analyze the metadata when a GMQLDataset is created
by a load_from_*. False otherwise. (Default=True)
:return: None
def set_meta_profiling(how):
""" Enables or disables the profilin... |
Given a file path, it loads it into memory as a Pandas dataframe
:param path: file path
:return: a Pandas Dataframe
def parse_regions(self, path):
""" Given a file path, it loads it into memory as a Pandas dataframe
:param path: file path
:return: a Pandas Dataframe
""... |
Returns the unordered list of attributes
:return: list of strings
def get_attributes(self):
""" Returns the unordered list of attributes
:return: list of strings
"""
attr = ['chr', 'start', 'stop']
if self.strandPos is not None:
attr.append('strand')
... |
Returns the ordered list of attributes
:return: list of strings
def get_ordered_attributes(self):
""" Returns the ordered list of attributes
:return: list of strings
"""
attrs = self.get_attributes()
attr_arr = np.array(attrs)
poss = [self.chrPos, self.startPos... |
Returns the unordered list of data types
:return: list of data types
def get_types(self):
""" Returns the unordered list of data types
:return: list of data types
"""
types = [str, int, int]
if self.strandPos is not None:
types.append(str)
if self.o... |
Returns a dictionary of the type
{'column_name': data_type, ...}
:return: dict
def get_name_type_dict(self):
""" Returns a dictionary of the type
{'column_name': data_type, ...}
:return: dict
"""
attrs = self.get_attributes()
types = self.get_types()
... |
Returns the ordered list of data types
:return: list of data types
def get_ordered_types(self):
""" Returns the ordered list of data types
:return: list of data types
"""
types = self.get_types()
types_arr = np.array(types)
poss = [self.chrPos, self.startPos, s... |
Constructor of the x-means clustering.rst algorithm
:param initial_centers: Initial coordinates of centers of clusters that are represented by list: [center1, center2, ...]
Note: The dimensions of the initial centers should be same as of the dataset.
:param kmax: Maximum number of clusters that... |
Constructor of the CLARANS clustering.rst algorithm
:param number_clusters: the number of clusters to be allocated
:param num_local: the number of local minima obtained (amount of iterations for solving the problem).
:param max_neighbour: the number of local minima obtained (amount of iteration... |
Constructor of the ROCK cluster analysis algorithm
:param eps: Connectivity radius (similarity threshold), points are neighbors if distance between them is less than connectivity radius
:param number_clusters: Defines number of clusters that should be allocated from the input data set
:param th... |
Constructor of OPTICS clustering.rst algorithm
:param data: Input data that is presented as a list of points (objects), where each point is represented by list or tuple
:param eps: Connectivity radius between points, points may be connected if distance between them less than the radius
:param m... |
Checks if the clustering.rst algorithm belongs to pyclustering
:param model: the clustering.rst algorithm model
:return: the truth value (Boolean)
def is_pyclustering_instance(model):
"""
Checks if the clustering.rst algorithm belongs to pyclustering
:param model: the clusteri... |
Performs clustering.rst
:param data: Data to be fit
:return: the clustering.rst object
def fit(self, data=None):
"""
Performs clustering.rst
:param data: Data to be fit
:return: the clustering.rst object
"""
if self.is_pyclustering_instance(self.model):... |
Computes and returns the list of labels indicating the data points and the corresponding cluster ids.
:return: The list of labels
def _labels_from_pyclusters(self):
"""
Computes and returns the list of labels indicating the data points and the corresponding cluster ids.
:return: The l... |
Extracts the cluster at the given index from the input dataframe
:param df: the dataframe that contains the clusters
:param cluster_no: the cluster number
:return: returns the extracted cluster
def retrieve_cluster(self, df, cluster_no):
"""
Extracts the cluster at the given in... |
Retrieve the labels of a clustering.rst object
:param obj: the clustering.rst object
:return: the resulting labels
def get_labels(obj):
"""
Retrieve the labels of a clustering.rst object
:param obj: the clustering.rst object
:return: the resulting labels
"""
... |
Computes and plot the silhouette score vs number of clusters graph to help selecting the number of clusters visually
:param data: The data object
:param k_min: lowerbound of the cluster range
:param k_max: upperbound of the cluster range
:param distance: the distance metric, 'euclidean'... |
Calculates and plots the plot of variance explained - number of clusters
Implementation reference: https://github.com/sarguido/k-means-clustering.rst
:param data: The dataset
:param k_min: lowerbound of the cluster range
:param k_max: upperbound of the cluster range
:param dista... |
Calculates the adjusted mutual information score w.r.t. the reference clusters (explicit evaluation)
:param reference_clusters: Clusters that are to be used as reference
:return: returns the value of the adjusted mutual information score
def adjusted_mutual_info(self, reference_clusters):
"""
... |
Calculates the adjusted rand score w.r.t. the reference clusters (explicit evaluation)
:param reference_clusters: Clusters that are to be used as reference
:return: returns the value of the adjusted rand score
def adjusted_rand_score(self, reference_clusters):
"""
Calculates the adjust... |
Calculates the completeness score w.r.t. the reference clusters (explicit evaluation)
:param reference_clusters: Clusters that are to be used as reference
:return: the resulting completeness score
def completeness_score(self, reference_clusters):
"""
Calculates the completeness score w... |
Calculates the Fowlkes-Mallows index (FMI) w.r.t. the reference clusters (explicit evaluation)
:param reference_clusters: Clusters that are to be used as reference
:return: The resulting Fowlkes-Mallows score.
def fowlkes_mallows(self, reference_clusters):
"""
Calculates the Fowlkes-Ma... |
Calculates the homogeneity score w.r.t. the reference clusters (explicit evaluation)
:param reference_clusters: Clusters that are to be used as reference
:return: The resulting homogeneity score.
def homogeneity_score(self, reference_clusters):
"""
Calculates the homogeneity score w.r.... |
Calculates the MI (mutual information) w.r.t. the reference clusters (explicit evaluation)
:param reference_clusters: Clusters that are to be used as reference
:return: The resulting MI score.
def mutual_info_score(self, reference_clusters):
"""
Calculates the MI (mutual information) w... |
Calculates the normalized mutual information w.r.t. the reference clusters (explicit evaluation)
:param reference_clusters: Clusters that are to be used as reference
:return: The resulting normalized mutual information score.
def normalized_mutual_info_score(self, reference_clusters):
"""
... |
Computes the mean Silhouette Coefficient of all samples (implicit evaluation)
:param data: The data that the clusters are generated from
:param metric: the pairwise distance metric
:param sample_size: the size of the sample to use computing the Silhouette Coefficient
:param random_state... |
Multiple materializations. Enables the user to specify a set of GMQLDataset to be materialized.
The engine will perform all the materializations at the same time, if an output path is provided,
while will perform each operation separately if the output_path is not specified.
:param datasets: it can be a li... |
Extracts the bicluster at the given row bicluster number and the column bicluster number from the input dataframe.
:param df: the input dataframe whose values were biclustered
:param row_no: the number of the row bicluster
:param column_no: the number of the column bicluster
:return: th... |
Calculates the similarity between the current model of biclusters and the reference model of biclusters
:param reference_model: The reference model of biclusters
:return: Returns the consensus score(Hochreiter et. al., 2010), i.e. the similarity of two sets of biclusters.
def bicluster_similarity(self... |
Loads the multi referenced mapped data from the file system
:param path: The path to the files
:param genes_uuid: The unique identifier metadata column name to separate the data by the number of references
:param regs: The region data that are to be analyzed
:param meta: The met... |
The method to merge the datamodels belonging to different references
:param samples_uuid: The unique identifier metadata column name to identify the identical samples having different references
:return: Returns the merged dataframe
def merge(self, samples_uuid):
"""
The method to merg... |
Creates and returns the compact view where the index of the dataframe is a multi index of the selected metadata.
Side effect: Alters the merged_data parameter
:param merged_data: The merged data that is to be used to create the compact view
:param selected_meta: The selected metadata to create ... |
The method to remove the attributes (genes) with more than a percentage of missing values
:param df: the dataframe containing the attributes to be pruned
:param percentage: the percentage threshold (0.4 by default)
:return: the pruned dataframe
def prune_by_missing_percent(df, percentage=0.4):... |
Imputes the missing values by the selected statistical property of each column
:param df: The input dataframe that contains missing values
:param method: The imputation method (min by default)
"zero": fill missing entries with zeros
"mean": fill with column means
"me... |
Nearest neighbour imputations which weights samples using the mean squared difference on features for which two rows both have observed data.
:param df: The input dataframe that contains missing values
:param k: The number of neighbours
:return: the imputed dataframe
def impute_knn(df, k=3):
... |
Imputes the missing values by using SVD decomposition
Based on the following publication: 'Missing value estimation methods for DNA microarrays' by Troyanskaya et. al.
:param df:The input dataframe that contains missing values
:param rank: Rank value of the truncated SVD
:param converge... |
Reduces the number of features in the imput dataframe.
Ex: labels = gs.meta['biospecimen_sample__sample_type_id'].apply(int).apply(lambda x: 0 if x < 10 else 1)
chi2_fs(gs.data, labels, 50)
:param df: The input dataframe
:param labels: Labels for each row in the df. Type: Pandas.Ser... |
Sets a spark property as a ('key', 'value') pair of using a dictionary
{'key': 'value', ...}
:param key: string
:param value: string
:param d: dictionary
:return: None
def set_spark_conf(self, key=None, value=None, d=None):
""" Sets a spark property as a ('key', 'value'... |
Sets a java system property as a ('key', 'value') pair of using a dictionary
{'key': 'value', ...}
:param key: string
:param value: string
:param d: dictionary
:return: None
def set_system_conf(self, key=None, value=None, d=None):
""" Sets a java system property as a ('... |
Selects the samples having the metadata attribute between the values provided
as input
:param values: a list of elements
:return a new complex condition
def isin(self, values):
""" Selects the samples having the metadata attribute between the values provided
as input
:... |
Retrieves all flatpage objects available for the current site and
visible to the specific user (or visible to all users if no user is
specified). Populates the template context with them in a variable
whose name is defined by the ``as`` clause.
An optional ``for`` clause can be used to control the user... |
Double fork and set the pid.
def daemonize(self):
"""Double fork and set the pid."""
self._double_fork()
# Write pidfile.
self.pid = os.getpid()
LOG.info(
"Succesfully daemonized process {0}.".format(self.pid)
) |
Do the UNIX double-fork magic.
See Stevens' "Advanced Programming in the UNIX Environment" for details
(ISBN 0201563177)
http://www.erlenstar.demon.co.uk/unix/faq_2.html#SEC16
def _double_fork(self):
"""Do the UNIX double-fork magic.
See Stevens' "Advanced Programming in the U... |
Overloaded constructor to create the GenometricSpace object from memory data and meta variables.
The indexes of the data and meta dataframes should be the same.
:param data: The data model
:param meta: The metadata
:return: A GenometricSpace object
def from_memory(cls, data, meta):
... |
Parses and loads the data into instance attributes.
The indexes of the data and meta dataframes should be the same.
:param path: The path to the dataset on the filesystem
:param regs: the regions that are to be analyzed
:param meta: the meta-data that are to be analyzed
:param v... |
Sets one axis of the 2D multi-indexed dataframe
index to the selected meta data.
:param selected_meta: The list of the metadata users want to index with.
def set_meta(self, selected_meta):
"""Sets one axis of the 2D multi-indexed dataframe
index to the selected meta data.
... |
Creates a 2D multi-indexed matrix representation of the data.
This representation allows the data to be sent to the machine learning algorithms.
Args:
:param values: The value or values that are going to fill the matrix.
:param selected_regions: The index to one axis of the ... |
Retrieves the selected metadata values of the given set
:param set: cluster that contains the data
:param selected_meta: the values of the selected_meta
:return: the values of the selected meta of the cluster
def get_values(self, set, selected_meta):
"""
Retrieves the selected ... |
Provides statistics of a group based on the meta data selected.
:param group:The result of a classification or clustering.rst or biclustering algorithm
:param selected_meta: The metadata that we are interested in
:param stat_code: 'mean' for mean or 'variance' for variance or 'std' for standard... |
Creates a bag of genomes representation for data mining purposes
Each document (genome) in the representation is a set of metadata key and value pairs belonging to the same cluster.
The bag of genomes are saved under ./bag_of_genomes/ directory
:param clustering_object: The clustering.rst objec... |
Creates a term-document matrix which is a mathematical matrix that describes the frequency of terms
that occur in a collection of documents (in our case a collection of genomes).
:param path_to_bag_of_genomes: Path to the documents (genomes)
:param max_df: To prune the terms that are existing i... |
Computes the term frequency and stores it as a dictionary
:param cluster: the cluster that contains the metadata
:return: tf dictionary
def tf(cluster):
"""
Computes the term frequency and stores it as a dictionary
:param cluster: the cluster that contains the metadata
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.