Exemple #1
0
def mobilesoft_cart(fileNameParam, fileToWriteP):
    testAndTrainData = IO_.giveTestAndTrainingData(fileNameParam)
    trainData = testAndTrainData[0]
    testData = testAndTrainData[1]
    selected_training_data = pca_mobilesoft.getPCAedFeatures(trainData)
    print "Size of selected training data : ", np.shape(selected_training_data)
    print "=" * 50

    dict_of_results = param_exp_classifier.runCART(selected_training_data,
                                                   testData, 0.90)
    reportStr = param_exp_analysis.analyzeThis(dict_of_results)
    IO_.writeStrToFile(fileToWriteP, reportStr)
def speedup_random_forest(fileNameParam, fileToWriteP):

  testAndTrainData = IO_.giveTestAndTrainingData(fileNameParam)
  trainData = testAndTrainData[0]
  testData  = testAndTrainData[1]
  #print trainData
  selected_training_data = pca_mobilesoft.getPCAedFeatures(trainData)
  print "Size of selected training data : ", np.shape(selected_training_data)
  print "="*50

  dict_of_results = runRandomForest(selected_training_data, testData)
  reportStr = param_exp_analysis.analyzeThis(dict_of_results)
  IO_.writeStrToFile(fileToWriteP, reportStr)
def mobilesoft_cart(fileNameParam, fileToWriteP):
  indexVector = [0, 5, 10, 12, 13, 18, 19, 20]
  testAndTrainData = IO_.giveTestAndTrainingData(fileNameParam)
  trainData = testAndTrainData[0]
  testData  = testAndTrainData[1]
  selected_training_data = createMobileSoftFeatures(trainData, indexVector)
  print "Size of selected training data : ", np.shape(selected_training_data)
  print "="*50
  print "Glimpse at  selected features (10th entry): \n", selected_training_data.iloc[9, :]
  print "="*50
  print "Glimpse at  labels (10th entry): \n", testData.iloc[9]
  print "="*50
  dict_of_results = param_exp_classifier.runCART(selected_training_data, testData, 0.90)
  reportStr = param_exp_analysis.analyzeThis(dict_of_results)
  IO_.writeStrToFile(fileToWriteP, reportStr)
def experiemnt_random_forest(fileNameParam, fileToWriteP):
  
  testAndTrainData = IO_.giveTestAndTrainingData(fileNameParam)
  print "This is 'experiemnt_random_forest' "  
  
  # settign up train data 
  trainData = testAndTrainData[0]
  original_rows = trainData.shape[0]
  original_cols =  trainData.shape[1] 
  print "Size of  training data : rows: {}, columns: {}".format( original_rows , original_cols )
  
  # settign up test data 
  testData = testAndTrainData[1]   
  dict_of_results = param_exp_classifier.runRandomForest(trainData, testData)
  reportStr = param_exp_analysis.analyzeThis(dict_of_results)
  IO_.writeStrToFile(fileToWriteP, reportStr)
Exemple #5
0
def experiemnt_random_forest(fileNameParam, fileToWriteP):

    testAndTrainData = IO_.giveTestAndTrainingData(fileNameParam)
    print "This is 'experiemnt_random_forest' "

    # settign up train data
    trainData = testAndTrainData[0]
    original_rows = trainData.shape[0]
    original_cols = trainData.shape[1]
    print "Size of  training data : rows: {}, columns: {}".format(
        original_rows, original_cols)

    # settign up test data
    testData = testAndTrainData[1]
    dict_of_results = param_exp_classifier.runRandomForest(trainData, testData)
    reportStr = param_exp_analysis.analyzeThis(dict_of_results)
    IO_.writeStrToFile(fileToWriteP, reportStr)