def main():
	maxFeature, featureChoices = getMFCCs()
	cls = getClassifiersWithoutFS()
	X_train, y_train, X_dev, y_dev, y_bin_train, y_bin_dev = preLoadData()
	X_train_default, X_dev_default, chosenFeatures, numOfFeatures = selectFeatures(maxFeature, featureChoices, X_train, X_dev)
	X_train_normalized, X_dev_normalized, chosenFeatures, numOfFeatures = selectFeaturesWithFeatureStandardization(maxFeature, featureChoices, X_train, X_dev)
	plotMFCCsFirst2Bin(X_train_default, X_train_normalized)
def main():
    maxFeature, featureChoices = getAllFeatures()

    #get only mean
    #maxFeature, featureChoices = getMeanFeatures()

    #use small feature sets to test
    #maxFeature, featureChoices = getTestFeatures()

    X_train, y_train, X_dev, y_dev, y_bin_train, y_bin_dev = preLoadData()

    chosenFeatureAndModels = automaticChooseFeatures(True, maxFeature,
                                                     featureChoices, 0,
                                                     X_train, X_dev,
                                                     y_bin_train, y_bin_dev)
    saveAsTable('classifierWithFeature.csv', chosenFeatureAndModels)
Esempio n. 3
0
# Author: Noel Dawe <*****@*****.**>
# Edited b
# License: BSD 3 clause

from sklearn.externals.six.moves import zip

import matplotlib.pyplot as plt

from sklearn.datasets import make_gaussian_quantiles
from sklearn.ensemble import AdaBoostClassifier
from sklearn.metrics import accuracy_score
from sklearn.tree import DecisionTreeClassifier

from classifierWithFS import preLoadData, getBestMeanFeatures, selectFeatures

X_train, y_train_phq8, X_test, y_dev, y_train, y_test = preLoadData()
maxFeature, featureChoices = getBestMeanFeatures()

X_train, X_test, chosenFeatures, numOfFeatures = selectFeatures(
    maxFeature, featureChoices, X_train, X_test)

bdt_real = AdaBoostClassifier(random_state=13370)

bdt_real.fit(X_train, y_train)

real_test_errors = []

for real_test_predict in bdt_real.staged_predict(X_test):
    real_test_errors.append(1. - accuracy_score(real_test_predict, y_test))

n_trees_real = len(bdt_real)
Esempio n. 4
0
               # add a paragraph 'Processed Data'
               #1) generate the dataset with 526 features
               #2) the predictive variance and predictive mean (best and worst) of some vectors from the dot product.

#  3-th leading minor not positive definite
#    ("GP exp sine squared", gp.GaussianProcessRegressor(kernel=gp.kernels.ExpSineSquared())),
               #("GP rational quadratic", None, gp.GaussianProcessRegressor(kernel=gp.kernels.RationalQuadratic())),
               #("GP white kernel", None, gp.GaussianProcessRegressor(kernel=gp.kernels.WhiteKernel())),
               #("GP abs_exp", None, gp.GaussianProcess(corr='absolute_exponential')),
               #("GP squared_exp", ["All"], gp.GaussianProcess(corr='squared_exponential')),
               #("GP cubic", None, gp.GaussianProcess(corr='cubic')),
               #("GP linear", None, gp.GaussianProcess(corr='linear')),
               #("GP RBF ARD", ["All"], RBF_ARD_WRAPPER(kern.RBF(input_dim=n_feats, variance=1., lengthscale=np.array([1]*n_feats), ARD=True)))]
]

X_train, y_train, X_dev, y_dev, y_bin_train, y_bin_dev = preLoadData()

#maxFeature, featureChoices = getBestMeanFeatures()
#maxFeature, featureChoices = getBestMeanStdFeatures()
#maxFeature, featureChoices = getBestNormalizedMeanStdFeatures()
maxFeature, featureChoices = getBestNormalizedMeanFeatures()
#X_train, X_dev, chosenFeatures, numOfFeatures = selectFeatures(maxFeature, featureChoices, X_train, X_dev)
X_train, X_dev, chosenFeatures, numOfFeatures = selectFeaturesWithFeatureStandardization(maxFeature, featureChoices, X_train, X_dev)

modeString = 'All'

models_rmse = []
for name, featSelectionMode, model in regressors:
    model.fit(X_train, y_train)
    predictTrain = model.predict(X_train)
    predictDev = model.predict(X_dev)