<commit_before>## FIX use ffnet for now, use sklearn in future
from ffnet import ffnet,mlgraph,tmlgraph
import numpy as np
from scipy.stats import linregress

from oddt import random_seed

class _ffnet_sklearned(object):
    def __init__(self, shape = None, full_conn=True, biases=True, random_state=None, random_weights=True, n_jobs=1):
        """
        shape: shape of a NN given as a tuple
        """
        self.shape = shape
        self.full_conn = full_conn
        self.biases = biases
        self.random_weights = random_weights
        self.random_state = random_state
        self.shape = shape
        self.n_jobs = n_jobs

    def get_params(self, deep=True):
        return {'shape': self.shape, 'full_conn': self.full_conn, 'biases': self.biases, 'random_state': self.random_state, 'random_weights': self.random_weights, 'n_jobs': self.n_jobs}

    def set_params(self, **args):
        self.__init__(**args)
        return self

    def fit(self, descs, target_values, train_alg='tnc',**kwargs):
        # setup neural network
        if self.full_conn:
            conec = tmlgraph(self.shape, self.biases)
        else:
            conec = mlgraph(self.shape, self.biases)<commit_msg>Handle ffnet import gracefully<commit_after>## FIX use ffnet for now, use sklearn in future
try:
    from ffnet import ffnet,mlgraph,tmlgraph
except ImportError:
    pass
import numpy as np
from scipy.stats import linregress

from oddt import random_seed

class _ffnet_sklearned(object):
    def __init__(self, shape = None, full_conn=True, biases=True, random_state=None, random_weights=True, n_jobs=1):
        """
        shape: shape of a NN given as a tuple
        """
        self.shape = shape
        self.full_conn = full_conn
        self.biases = biases
        self.random_weights = random_weights
        self.random_state = random_state
        self.shape = shape
        self.n_jobs = n_jobs

    def get_params(self, deep=True):
        return {'shape': self.shape, 'full_conn': self.full_conn, 'biases': self.biases, 'random_state': self.random_state, 'random_weights': self.random_weights, 'n_jobs': self.n_jobs}

    def set_params(self, **args):
        self.__init__(**args)
        return self

    def fit(self, descs, target_values, train_alg='tnc', **kwargs):
        # setup neural network
        if self.full_conn:
            conec = tmlgraph(self.shape, self.biases)
        else:
            conec = mlgraph(self.shape, self.biases)
{'fraction_non_alphanumeric': 0.10032362459546926, 'fraction_numerical': 0.0008090614886731392, 'mean_word_length': 2.9568, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '2254233', 'n_tokens_mistral': 797, 'n_tokens_neox': 766, 'n_words': 205}