Commit 0bf48fa2 authored by Estelle ARRICAU's avatar Estelle ARRICAU
Browse files

add new README

parent afaf8481
cmake_minimum_required(VERSION 3.16)
project(EML)
# set(CMAKE_C_COMPILER "/usr/bin/gcc-11")
# set(CMAKE_CXX_COMPILER "/usr/bin/g++-11")
set(CMAKE_CXX_COMPILER "/usr/bin/g++-11")
# cmake -DCMAKE_CXX_COMPILER=/usr/bin/g++-11 ..
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -Wall -Wextra -std=c++20")
......
## Pre requisites
Necessary python librairies:
* keras
* sklearn
* graphviz
* pandas
* tensorflow
Donwload the database [here](https://www.kaggle.com/carlthome/gtzan-genre-collection). Then, from the root of the project:
````
cd DATASETS/
````
Then decompress the archive here.
## Compile the projet
From the root of the project:
````
mkdir build
cd build/
cmake ..
make
````
## Extract features from database
From the root of the project:
````
cd build/Extraction/
./EXTRACTION
````
A file **features.csv** has been written into the folder ```build/Extraction/```.
## Classify data
### Train the classifier
Launch the python file in the folder of the classifier to train.
A file **file_test.csv** has been written into the folder ```classifier_name/```.
### Apply the classifier
From the root of the project
* Example with a music sample:
````
cd build/RF/
./RF ../../DATASETS/genres/jazz/jazz.00022.au
````
* Example for all the test data:
````
cd build/RF/
./RF
````
\ No newline at end of file
......@@ -4,37 +4,18 @@ from time import time
import sys
import warnings
import sklearn
from sklearn.utils.multiclass import unique_labels
from sklearn.metrics import confusion_matrix
from sklearn.model_selection import train_test_split
from sklearn import svm, datasets
from sklearn.metrics import roc_curve, auc
from sklearn.preprocessing import label_binarize
from sklearn.preprocessing import StandardScaler
from sklearn.base import clone
from sklearn.preprocessing import LabelEncoder
from sklearn import preprocessing
from sklearn import metrics
import seaborn as sns
import matplotlib.pyplot as plt
import numpy as np
from numpy.random import rand
import scipy as sp
from scipy import interp
import pandas as pd
from sklearn import linear_model
from sklearn.neural_network import MLPClassifier
from sklearn.ensemble import RandomForestClassifier
from sklearn.svm import SVC
from sklearn.model_selection import train_test_split
from sklearn.model_selection import learning_curve
from sklearn.model_selection import GridSearchCV
from sklearn.datasets import fetch_lfw_people
from sklearn.metrics import classification_report
from sklearn.decomposition import PCA
from sklearn.model_selection import cross_val_score
from sklearn.metrics import ConfusionMatrixDisplay
from sklearn.metrics import accuracy_score
from sklearn.tree import export_graphviz, export_text
# ---------------------------------------->
......@@ -219,17 +200,6 @@ def train_RF(saveAlgo=False, path=""):
display_model_performance_metrics(
labelInd_test, prediction_random_best, labelIndices_unique)
# print(prediction_random_best)
# print(model_best.apply(X_train))
# print(model_best.decision_path(X_train))
# for e in model_best.estimators_:
# print(e.tree_)
# print(e.classes_)
# print(e.n_classes_)
# print(e.n_outputs_)
# report = export_text(e)
# print(report)
# help(sklearn.tree._tree.Tree)
file = path+'RF/RFTrained.h'
open(file, 'w').close()
with open(file, 'a') as f:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment