Exemplo n.º 1
0
def tuneBaggingRegressorNValues():
    nValues = [
        2**4, 2**5, 2**6, 2**7, 2**8, 2**9, 2**10, 2**11, 2**12, 2**13, 2**14,
        2**15, 2**16, 2**17, 2**18, 2**19
    ]

    tuneNValue(nValues,
               classifier,
               classifierName,
               jsonFileNames,
               dataSource='reddit')
Exemplo n.º 2
0
def tuneSGDNValues():
    nValues = [
        2**4, 2**5, 2**6, 2**7, 2**8, 2**9, 2**10, 2**11, 2**12, 2**13, 2**14,
        2**15, 2**16, 2**17, 2**18, 2**19, 2**20
    ]

    tuneNValue(nValues,
               regressor,
               regressorName,
               jsonFileNames,
               dataSource='reddit')
Exemplo n.º 3
0
def tuneRandomForestNValues():
    nValues = [
        2**4,
        2**5,
        2**6,
        2**7,
        2**8,
        2**9,
        2**10,
        2**11,
        2**12,
        2**13,
    ]

    tuneNValue(nValues, classifier, classifierName, jsonFileNames)
Exemplo n.º 4
0
def tuneKNeighborsNValues():
    nValues = [
        2**4,
        2**5,
        2**6,
        2**7,
        2**8,
        2**9,
        2**10,
        1598,
        2**11,
        2**12,
        2**13,
    ]

    tuneNValue(nValues, classifier, classifierName, jsonFileNames)
Exemplo n.º 5
0
def tuneSGDNValues():
    nValues = [
        2 ** 4,
        2 ** 5,
        2 ** 6,
        2 ** 7,
        2 ** 8,
        2 ** 9,
        2 ** 10,
        1599,
        2 ** 11,
        2 ** 12,
        2 ** 13,
    ]

    tuneNValue(nValues, regressor, regressorName, jsonFileNames)
Exemplo n.º 6
0
def tuneRandomForestNValues():
    nValues = [
        2 ** 4,
        2 ** 5,
        2 ** 6,
        2 ** 7,
        2 ** 8,
        2 ** 9,
        2 ** 10,
        2 ** 11,
        2 ** 12,
        2 ** 13,
        2 ** 14,
        2 ** 15,
        2 ** 16,
        2 ** 17,
        2 ** 18,
        2 ** 19,
        2 ** 20,
    ]

    tuneNValue(nValues, classifier, classifierName, jsonFileNames, dataSource='reddit')
Exemplo n.º 7
0
def tuneKNeighborsNValues():
    nValues = [
        2**4,
        2**5,
        2**6,
        2**7,
        2**8,
        2**9,
        2**10,
        2**11,
        2**12,
        2**13,
        2**14,
        2**15,
        2**16,
    ]

    tuneNValue(nValues,
               classifier,
               classifierName,
               jsonFileNames,
               dataSource='reddit')
Exemplo n.º 8
0
    2**8,
    2**9,
    2**10,
    2**11,
    2**12,
    2**13,
    2**14,
    2**15,
    2**16,
    2**17,
    2**18,
    2**19,
    2**20,
]

machineLearning.tuneNValue(nValues, classifier, classifierName, jsonFileNames)

# Pick a reasonable n value considering you'll be training the model a few hundred times
# We want an n with a high accuracy but low run time
decentNValue = 2**15

# ______________________________________________________
# WHAT ARE THE BEST VALUES OF EACH PARAMETER?
# ______________________________________________________
#

# This should be a list of all your parameters with a wide range of possible values
parameterGrid = {
    "C": [0.001, 0.01, 0.1, 1, 10, 100, 1000],
    "fit_intercept": [True, False],
    "solver": ['newton-cg', 'lbfgs', 'liblinear', 'sag', 'saga'],
Exemplo n.º 9
0
    2 ** 11,
    2 ** 12,
    2 ** 13,
    2 ** 14,
    2 ** 15,
    2 ** 16,
    2 ** 17,
    2 ** 18,
    2 ** 19,
    2 ** 20,
    2 ** 21,
    2 ** 22,
    2 ** 23,
]

tuneNValue(nValues, classifier, classifierName, jsonFileNames)

# Pick a reasonable n value considering you'll be training the model a few hundred times
# We want an n with a high accuracy but low run time
decentNValue = 30000

# ______________________________________________________
# WHAT ARE THE BEST VALUES OF EACH PARAMETER?
# ______________________________________________________
#

# This should be a list of all your parameters with a wide range of possible values
parameterGrid = {
    # "n_estimators": np.arange(5, 500, 10),
    # "max_depth": np.arange(1, 22, 1),
    # "min_samples_split": np.arange(2, 150, 4),