Run python clf_comparison.py
to compare different classifiers for the problem.
Running main.py
shows a menu in which you can choose either to train classifier or to record and analyse your voice.
- sklearn
- matplotlib
- pandas
- pyaudio
- warbleR
Using machine learning to recognise gender by analysing recorded voice.
ValueError Traceback (most recent call last)
in
17
18 if option == '1':
---> 19 neural_net.run()
20 elif option == '2':
21 if not os.path.isfile('trained_neural_net'): # check if neural_net file exists
~\GenderRecognitionByVoice\neural_net.py in run()
45
46 print('\nCalculating accuracy...\n')
---> 47 get_accuracy(x_train, x_test, y_train, y_test, trained_neural_net) # print results
48
49
~\GenderRecognitionByVoice\data_process.py in get_accuracy(x_train, x_test, y_train, y_test, clf)
89 correct = 0
90 for index in range(len(y_train)):
---> 91 predicted = clf.predict(x_train.iloc[index, :])
92 actual = y_train[index]
93 if actual == predicted:
~\AppData\Local\Continuum\anaconda3\lib\site-packages\sklearn\neural_network\multilayer_perceptron.py in predict(self, X)
956 """
957 check_is_fitted(self, "coefs_")
--> 958 y_pred = self.predict(X)
959
960 if self.n_outputs == 1:
~\AppData\Local\Continuum\anaconda3\lib\site-packages\sklearn\neural_network\multilayer_perceptron.py in _predict(self, X)
660 The decision function of the samples for each class in the model.
661 """
--> 662 X = check_array(X, accept_sparse=['csr', 'csc', 'coo'])
663
664 # Make sure self.hidden_layer_sizes is a list
~\AppData\Local\Continuum\anaconda3\lib\site-packages\sklearn\utils\validation.py in check_array(array, accept_sparse, accept_large_sparse, dtype, order, copy, force_all_finite, ensure_2d, allow_nd, ensure_min_samples, ensure_min_features, warn_on_dtype, estimator)
519 "Reshape your data either using array.reshape(-1, 1) if "
520 "your data has a single feature or array.reshape(1, -1) "
--> 521 "if it contains a single sample.".format(array))
522
523 # in the future np.flexible dtypes will be handled like object dtypes
ValueError: Expected 2D array, got 1D array instead:
array=[-0.06840044 -0.04569167 -0.07454539 0.05122191 -0.13215234 -0.18143853
0.00378831 -0.01562295 0.05008664 0.10544558 -0.02366944 -0.06840044
0.05960946 0.1704949 -0.11786657 0.05839372 0.2281493 -0.04817778
-0.05295515 0.20075652].
Reshape your data either using array.reshape(-1, 1) if your data has a single feature or array.reshape(1, -1) if it contains a single sample.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.