Skip to content
Snippets Groups Projects
Commit 651ba59f authored by bbauvin's avatar bbauvin
Browse files

Re-using random search for late weighted linear, added Readme

parent 788b3384
No related branches found
No related tags found
No related merge requests found
...@@ -330,23 +330,6 @@ def initMultiviewArguments(args, benchmark, views, viewsIndices, accuracies, cla ...@@ -330,23 +330,6 @@ def initMultiviewArguments(args, benchmark, views, viewsIndices, accuracies, cla
return argumentDictionaries return argumentDictionaries
# def analyzeLabels(labelsArrays, realLabels, classifiersNames):
# nbClassifiers = len(classifiersNames)
# nbExamples = realLabels.shape[0]
# nbIter = nbExamples/nbClassifiers
# data = np.zeros((nbExamples, nbClassifiers*nbIter))
# tempData = np.array([labelsArray == realLabels for labelsArray in np.transpose(labelsArrays)]).astype(int)
# for classifierIndex in range(nbClassifiers):
# for iterIndex in range(nbIter):
# data[:,classifierIndex*nbIter+iterIndex] = tempData[classifierIndex,:]
# fig, ax = plt.subplots()
# cax = ax.imshow(data, interpolation='nearest', cmap=cm.coolwarm)
# ax.set_title('Error on examples depending on the classifier')
# cbar = fig.colorbar(cax, ticks=[0, 1])
# cbar.ax.set_yticklabels(['Wrong', ' Right'])
# fig.savefig("Results/"+time.strftime("%Y%m%d-%H%M%S")+"error_analysis.png")
parser = argparse.ArgumentParser( parser = argparse.ArgumentParser(
description='This file is used to benchmark the accuracies fo multiple classification algorithm on multiview data.', description='This file is used to benchmark the accuracies fo multiple classification algorithm on multiview data.',
formatter_class=argparse.ArgumentDefaultsHelpFormatter) formatter_class=argparse.ArgumentDefaultsHelpFormatter)
......
...@@ -68,11 +68,8 @@ def ExecMonoview(X, Y, name, labelsNames, learningRate, nbFolds, nbCores, databa ...@@ -68,11 +68,8 @@ def ExecMonoview(X, Y, name, labelsNames, learningRate, nbFolds, nbCores, databa
# Calculate Train/Test data # Calculate Train/Test data
logging.debug("Start:\t Determine Train/Test split"+" for iteration "+str(iterationStat+1)) logging.debug("Start:\t Determine Train/Test split"+" for iteration "+str(iterationStat+1))
testIndices = ClassifMonoView.splitDataset(Y, nbClass, learningRate, datasetLength) testIndices = ClassifMonoView.splitDataset(Y, nbClass, learningRate, datasetLength)
print "fromage"
trainIndices = [i for i in range(datasetLength) if i not in testIndices] trainIndices = [i for i in range(datasetLength) if i not in testIndices]
print "jqmbon"
X_train = extractSubset(X,trainIndices) X_train = extractSubset(X,trainIndices)
print "poulet"
X_test = extractSubset(X,testIndices) X_test = extractSubset(X,testIndices)
y_train = Y[trainIndices] y_train = Y[trainIndices]
y_test = Y[testIndices] y_test = Y[testIndices]
......
...@@ -32,7 +32,7 @@ def gridSearch(DATASET, classificationKWARGS, trainIndices, nIter=30, viewsIndic ...@@ -32,7 +32,7 @@ def gridSearch(DATASET, classificationKWARGS, trainIndices, nIter=30, viewsIndic
if accuracy > bestScore: if accuracy > bestScore:
bestScore = accuracy bestScore = accuracy
bestConfig = normalizedArray bestConfig = normalizedArray
return [np.array([1.0 for i in range(nbView)])] return [bestConfig]
class WeightedLinear(EarlyFusionClassifier): class WeightedLinear(EarlyFusionClassifier):
......
# Project Title
One Paragraph of project description goes here
## Getting Started
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
### Prerequisites
What things you need to install the software and how to install them
```
Give examples
```
### Installing
A step by step series of examples that tell you have to get a development env running
Say what the step will be
```
Give the example
```
And repeat
```
until finished
```
End with an example of getting some data out of the system or using it for a little demo
## Running the tests
Explain how to run the automated tests for this system
### Break down into end to end tests
Explain what these tests test and why
```
Give an example
```
### And coding style tests
Explain what these tests test and why
```
Give an example
```
## Deployment
Add additional notes about how to deploy this on a live system
## Built With
* [Dropwizard](http://www.dropwizard.io/1.0.2/docs/) - The web framework used
* [Maven](https://maven.apache.org/) - Dependency Management
* [ROME](https://rometools.github.io/rome/) - Used to generate RSS Feeds
## Contributing
Please read [CONTRIBUTING.md](https://gist.github.com/PurpleBooth/b24679402957c63ec426) for details on our code of conduct, and the process for submitting pull requests to us.
## Versioning
We use [SemVer](http://semver.org/) for versioning. For the versions available, see the [tags on this repository](https://github.com/your/project/tags).
## Authors
* **Billie Thompson** - *Initial work* - [PurpleBooth](https://github.com/PurpleBooth)
See also the list of [contributors](https://github.com/your/project/contributors) who participated in this project.
## License
This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details
## Acknowledgments
* Hat tip to anyone who's code was used
* Inspiration
* etc
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment