Giter Site home page Giter Site logo

i-rohan / genderrecognitionbyvoice Goto Github PK

View Code? Open in Web Editor NEW
11.0 1.0 6.0 550 KB

Using machine learning to recognise gender by analysing recorded voice.

Python 53.16% R 46.84%
machine-learning gender-recognition-by-voice neural-network voice-classfication

genderrecognitionbyvoice's Introduction

Gender Recognition By Voice

USAGE:

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.

Requirements

Python

  1. sklearn
  2. matplotlib
  3. pandas
  4. pyaudio

R

  1. warbleR

genderrecognitionbyvoice's People

Contributors

i-rohan avatar raghav7203 avatar rohan-sharma-95 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

genderrecognitionbyvoice's Issues

"Reshape your data either using array.reshape(-1, 1) if " 520 "your data has a single feature or array.reshape(1, -1) "

Training Results:

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.