jubins / machinelearning-detecting-twitter-bots Goto Github PK
View Code? Open in Web Editor NEWCustom classification algorithm to sense the bots vs human on social media space like twitter
License: MIT License
Custom classification algorithm to sense the bots vs human on social media space like twitter
License: MIT License
Hey
So i have a file of tweets but its not exactly in the same order or contain the header fields like your test data, any idea how I can test on this different tweet file ?
I can rearrange the columns to match your test data file but is there an alternative you may have tried?
I executed the code and I get the following error
Training the classifier. Please wait 30 seconds.
Traceback (most recent call last):
File "BotDetection.py", line 169, in <module>
print("Train Accuracy: ", twitter_bot.get_accuracy_score(train_df))
File "BotDetection.py", line 120, in get_accuracy_score
(X_train, y_train, X_test, y_test) = twitter_bot.perform_train_test_split(df)
File "BotDetection.py", line 25, in perform_train_test_split
train, test = df[msk], df[~msk]
TypeError: only integer scalar arrays can be converted to a scalar index
Kindly help me rectify this error
I have seen your algorithm for studying purposes but found that it is not accurate.But coincidentally it showin above 95% accuracy.In the fucntion of the bot_prediction_algorithm() prediction_df is not sorted according to the indexes of the rows,while the train_df is by sequence indexing of the rows.So while finding the accuracy it is coincidentally showing above 95%.When I sorted the prdeiction_df it is showing aroung 69 % of the accuracy.Correct me if I am wrong
Hey
Thanks for posting this
When I run python3 on the program it throws a unicode error
Also I believe the test data set is empy
when I run the code with python2 or python3 it throws this error, even though it worked before.
Training the classifier. Please wait 30 seconds.
Traceback (most recent call last):
File "BotDetection.py", line 152, in
test_df = pd.read_csv(filepath + 'test_data_4_students.csv' , sep='\t', encoding='ISO-8859-1')
File "/usr/local/lib/python3.5/dist-packages/pandas/io/parsers.py", line 655, in parser_f
return _read(filepath_or_buffer, kwds)
File "/usr/local/lib/python3.5/dist-packages/pandas/io/parsers.py", line 411, in _read
data = parser.read(nrows)
File "/usr/local/lib/python3.5/dist-packages/pandas/io/parsers.py", line 1005, in read
ret = self._engine.read(nrows)
File "/usr/local/lib/python3.5/dist-packages/pandas/io/parsers.py", line 1748, in read
data = self._reader.read(nrows)
File "pandas/_libs/parsers.pyx", line 890, in pandas._libs.parsers.TextReader.read (pandas/_libs/parsers.c:10862)
File "pandas/_libs/parsers.pyx", line 912, in pandas._libs.parsers.TextReader._read_low_memory (pandas/_libs/parsers.c:11138)
File "pandas/_libs/parsers.pyx", line 966, in pandas._libs.parsers.TextReader._read_rows (pandas/_libs/parsers.c:11884)
File "pandas/_libs/parsers.pyx", line 953, in pandas._libs.parsers.TextReader._tokenize_rows (pandas/_libs/parsers.c:11755)
File "pandas/_libs/parsers.pyx", line 2184, in pandas._libs.parsers.raise_parser_error (pandas/_libs/parsers.c:28765)
pandas.errors.ParserError: Error tokenizing data. C error: Expected 10 fields in line 3, saw 105
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.