Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
Copyright (c) 2019-2020, Felix M. Riese.
All rights reserved.
"""
import numpy as np
from scipy.special import softmax
from sklearn.base import ClassifierMixin
from sklearn.preprocessing import LabelBinarizer
from sklearn.utils import class_weight
from .SOMEstimator import SOMEstimator
from .SOMUtils import check_estimation_input
class SOMClassifier(SOMEstimator, ClassifierMixin):
"""Supervised SOM for estimating discrete variables (= classification).
Parameters
----------
n_rows : int, optional (default=10)
Number of rows for the SOM grid
n_columns : int, optional (default=10)
Number of columns for the SOM grid
init_mode_unsupervised : str, optional (default="random")
Initialization mode of the unsupervised SOM
init_mode_supervised : str, optional (default="majority")
Initialization mode of the classification SOM
"""SOMRegressor class.
Copyright (c) 2019-2020, Felix M. Riese.
All rights reserved.
"""
import numpy as np
from sklearn.base import RegressorMixin
from .SOMEstimator import SOMEstimator
class SOMRegressor(SOMEstimator, RegressorMixin):
"""Supervised SOM for estimating continuous variables (= regression).
Parameters
----------
n_rows : int, optional (default=10)
Number of rows for the SOM grid
n_columns : int, optional (default=10)
Number of columns for the SOM grid
init_mode_unsupervised : str, optional (default="random")
Initialization mode of the unsupervised SOM
init_mode_supervised : str, optional (default="random")
Initialization mode of the supervised SOM