{"id":21849634,"url":"https://github.com/aaaa-source/mbti-predict","last_synced_at":"2025-03-21T17:44:56.223Z","repository":{"id":264310348,"uuid":"892984073","full_name":"AAAA-source/MBTI-Predict","owner":"AAAA-source","description":"predict author's MBTI through text","archived":false,"fork":false,"pushed_at":"2024-12-06T03:45:15.000Z","size":59941,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-26T12:42:31.773Z","etag":null,"topics":["artificial-intelligence","classification","data-mining","data-mining-algorithms","mbti-personality","prediction","prediction-model","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AAAA-source.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-11-23T08:09:15.000Z","updated_at":"2025-01-10T16:31:24.000Z","dependencies_parsed_at":null,"dependency_job_id":"116b3cd6-c3fd-4cbc-a3ae-0e1a3b8fbbc0","html_url":"https://github.com/AAAA-source/MBTI-Predict","commit_stats":null,"previous_names":["aaaa-source/mbti-predict"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AAAA-source%2FMBTI-Predict","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AAAA-source%2FMBTI-Predict/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AAAA-source%2FMBTI-Predict/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AAAA-source%2FMBTI-Predict/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AAAA-source","download_url":"https://codeload.github.com/AAAA-source/MBTI-Predict/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244842746,"owners_count":20519685,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["artificial-intelligence","classification","data-mining","data-mining-algorithms","mbti-personality","prediction","prediction-model","python"],"created_at":"2024-11-28T00:13:45.099Z","updated_at":"2025-03-21T17:44:56.203Z","avatar_url":"https://github.com/AAAA-source.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MBTI-Predict\npredict author's MBTI through text\n\nthe row file of MBTI text : https://www.kaggle.com/datasets/zeyadkhalid/mbti-personality-types-500-dataset/data\n(please download at kaggle)\n\nplease put the row file in the same directory with the code , and rename the file to \"MBTI.csv\"\n\n\n1. first run the transtotxt.py code , it will split the row data to many small text data\n(split by row) and put them into \"txt_output\" file.\n2. you can run any code with suitable environment(with all package we need) , then it will return the result\n3. if the file name _separate , it means that the classification/clustering is letter by letter \n    i.e. there are 4 classifier with I/E , S/N ,  F/T , J/P \n4. if the file name _reduce , it means the data will first be resample before training model.\n    which will resample by two ways(oversampling/undersampling)\n5. for the result with one classifier , it will return the precision , recall , accuracy  and F1-score ; and for the multiple classifiers , it will at least return the accuracy.\n\n-------------------------------------------------------------------------------------\nFor our research , we split in 3 steps : \n1. train general models : we choosed the Naive Bayes(NB) , BernoulliNB , Complement NB , KNN , SVM(with linear kernel and rbf kernel) , decision tree methods. and train those models with K-fold validation(k = 10)\n\nAfter that , we found that out data is unbalanced , some of categories have more the 20000 sample , but some only have less than 1000 sample.\nSo we try to conquer this problem. Therefore , we try the balanced random forest method and the xgboost way.And resample data making the data set \"balanced\"\n\n2. We then try the balanced random forest method and the xgboost way. However , the two models performence aren't good enough (in fact , the performance are worse than SVM , NB model).\nAnd every model with resample data preform worse then raw data. This result just like what we thought.(we believe the more data be trained , the better preformence;\nbut the resample data make the training set small or adding some random data will interfere the raw distribution).\n\nBecause step can not efficiently conquer the problem , we try another way -- merge the models.\n\n3. We choose the best two models which we already have. The SVM and CNB have the best f1-score and precision.\nBecause the prediction of MBTI is try to predict the author's personality , we now focus on precision.\n\nWe define the confidence score of SVM model with class c as SVM(c) and the confidence score of CNB model with class c as CNB(c)\nNow , we define the final score of merge model is \n    final score(c) = SVM(c) * precSVM(c) + CNB(c) * precCNB(c)\nwhich precSVM(c) is the precision of SVM model in class c (we observed by k-fold validation before , step 1) \nand precCNB is the precision of CNB model in class c.\n\nLast , the merge model will output the class which have the maximum final score.\n\nAfter we training the merge model , we compare the \"macro average\" of the model and SVM , CNB model. \n(Choose macro average is because the data is unbalanced and we believe the author's MBTI personality is uniform distribution in real world)\n\nThe macro average of the merge model is 0.83 , and SVM is 0.81 , CNB is 0.78\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faaaa-source%2Fmbti-predict","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faaaa-source%2Fmbti-predict","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faaaa-source%2Fmbti-predict/lists"}