<commit_before># ------------------------------------------------------------
# Imports
# ------------------------------------------------------------

import numpy as np
from sklearn.linear_model import LinearRegression

# ------------------------------------------------------------
# seqspace imports
# ------------------------------------------------------------

from seqspace.utils import list_binary, enumerate_space, encode_mutations, construct_genotypes

# ------------------------------------------------------------
# Local imports
# ------------------------------------------------------------

from epistasis.decomposition import generate_dv_matrix
from epistasis.models.base import BaseModel
from epistasis.utils import (epistatic_order_indices,
                                build_model_params)

# ------------------------------------------------------------
# Unique Epistasis Functions
# ------------------------------------------------------------

class EpistasisRegression(BaseModel):

    def __init__(self, wildtype, genotypes, phenotypes, 
                order=None, 
                parameters=None, 
                variances=None, 
                stdeviations=stdeviations, 
                log_transform=False, 
                mutations=None, 
                n_replicates=1, 
                model_type="local"):
                
        """ Create a map from local epistasis model projected into lower order
            order epistasis interactions. Requires regression to estimate values.

            __Arguments__:

            `wildtype` [str] : Wildtype genotype. Wildtype phenotype will be used as reference state.

            `genotypes` [array-like, dtype=str] : Genotypes in map. Can be binary strings, or not.

            `phenotypes` [array-like] : Quantitative phenotype values

            `order` [int] : Order of regression; if None, parameters must be passed in manually as parameters=<list of lists>

            `parameters` [dict] : interaction keys with their values expressed as lists.

            `errors` [array-like] : List of phenotype errors.

            `log_transform` [bool] : If True, log transform the phenotypes.
<commit_msg>minor bug from last commit<commit_after># ------------------------------------------------------------
# Imports
# ------------------------------------------------------------

import numpy as np
from sklearn.linear_model import LinearRegression

# ------------------------------------------------------------
# seqspace imports
# ------------------------------------------------------------

from seqspace.utils import list_binary, enumerate_space, encode_mutations, construct_genotypes

# ------------------------------------------------------------
# Local imports
# ------------------------------------------------------------

from epistasis.decomposition import generate_dv_matrix
from epistasis.models.base import BaseModel
from epistasis.utils import (epistatic_order_indices,
                                build_model_params)

# ------------------------------------------------------------
# Unique Epistasis Functions
# ------------------------------------------------------------

class EpistasisRegression(BaseModel):

    def __init__(self, wildtype, genotypes, phenotypes, 
                order=None, 
                parameters=None, 
                variances=None, 
                stdeviations=None, 
                log_transform=False, 
                mutations=None, 
                n_replicates=1, 
                model_type="local"):
                
        """ Create a map from local epistasis model projected into lower order
            order epistasis interactions. Requires regression to estimate values.

            __Arguments__:

            `wildtype` [str] : Wildtype genotype. Wildtype phenotype will be used as reference state.

            `genotypes` [array-like, dtype=str] : Genotypes in map. Can be binary strings, or not.

            `phenotypes` [array-like] : Quantitative phenotype values

            `order` [int] : Order of regression; if None, parameters must be passed in manually as parameters=<list of lists>

            `parameters` [dict] : interaction keys with their values expressed as lists.

            `errors` [array-like] : List of phenotype errors.

            `log_transform` [bool] : If True, log transform the phenotypes.

{'fraction_non_alphanumeric': 0.27030716723549486, 'fraction_numerical': 0.0004550625711035267, 'mean_word_length': 1.2190812720848057, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '792817', 'n_tokens_mistral': 967, 'n_tokens_neox': 854, 'n_words': 288}