Can't load my twitter data .CSV file to Weka Explorer - machine-learning

Why giving not recognize as an 'CSV data files' file ? Can't load my twitter data .CSV file to Weka Explorer.
This is one row of my data. Help me to add this csv file to WEKA explorer.
example:
Sat Sep 01 06:30:00 +0000 2018
1035776770966876162
1035776770966876162
Ooohhhh my brgy sa A nxt week for hype kids #Main...
Twitter for Android
False
null
null
null
null
null
224527163
224527163
👻 👻 👻
meladylorie
null
null
null
none
False
False
205
273
4
1042
63685
Thu Dec 09 06:57:05 +0000 2010
null
null
True
en
False
False
94D487
http://abs.twimg.com/images/themes/theme12/bg.gif
https://abs.twimg.com/images/themes/theme12/bg.gif
False
7FDBB6
FFFFFF
FBF94E
2D3F0F
True
http://pbs.twimg.com/profile_images/10193468908637...
https://pbs.twimg.com/profile_images/1019346890863...
https://pbs.twimg.com/profile_banners/224527163/15...
False
False
null
null
null
null
null
null
null
Error:
Please point me how to add twitter data set like mine to WEKA explorer.

Related

Google Sheets query output changes upon closing and reopening workbook

I have a workbook where I track game stats for my local community. I added a chart that changes upon a few selections and I use filter to get the desired result. The data comes from a sheet where I use query to calculate month to month differences (since I could not find this easily done with google's provided pivot options). One of the query's looks like this
=query('Response Edits'!1:1112,"select A,B,C WHERE A IS NOT NULL AND NOT H matches '"&textjoin("|",TRUE,query('Response Edits'!1:1112,"select min(H) WHERE A IS NOT NULL group by D",0))&"' order by D, C ASC",0)
A converts the month value in the timestamp to the correct survey month (e.g. a 2020-07-01 would be for 06 survey and 2020-07-29 would
be for 07 survey)
B converts the year value in the timestamp to the correct survey year
C is the timestamp of the survey submission
D is the player name
H is the player XP of the survey submission (I use this as a lazy solution since it only increases and because I could not figure out a
way to include the key phrase date using multiple datetime e.g.
NOT C matches date texjoin("|",TRUE,"select min(C)...") did not work)
the textjoin is just to remove the earliest date submitted because it would not have a month to month value. Here is a portion of the output of the query above and another query which I believe is correct:
7 2020 2020-07-31 23:18:48 ... 6873449 198 11610
8 2020 2020-08-31 22:15:53 ... 7789713 175 8732
9 2020 2020-09-30 23:03:12 ... 5994347 139 8932
When I close the the sheet and reopen it I notice that my chart has only 0 values because my sheet with the query functions is only outputting 0. The above query and my other query have also given a different output, which I have provided a portion for below:
6 2020 2020-06-30 22:04:02 ... 0 0 0
7 2020 2020-07-31 23:18:48 ... 0 0 0
8 2020 2020-08-31 22:15:53 ... 0 0 0
9 2020 2020-09-30 23:03:12 ... 0 0 0
I am new to using query, but the formula seems correct, because if I change the last 0 in the formula (which is the option for header) to 1 and then back to 0 I get the desired result.
Tl;dr Why does the queried data not output correctly when I close and reopen a workbook? And why does it output correctly after the formula is changed and changed back (including selecting undo)? Is it potentially textjoin or matches causing the problem in the query?
try to run this:
=QUERY('Response Edits'!A1:H1112,
"select A,B,C
where A is not null
and not H matches '"&TEXTJOIN("|", 1,
QUERY('Response Edits'!A1:H1112,
"select min(H)
where A is not null group by D", 0))&"'
order by D, C", 0)

How to access previous updated_at?

I have model in which I keep track of the field updated_at.
Is there a way I can track the previous updated_at?
For example
updated_at = A (where A is an actual datetime stamp)
Some work is done then save is called
updated_at = B (where B is an actual datetime stamp)
Is there a way I can access the previous updated_at i.e. A?
If you have the object available, then you can call:
object.previous_changes
This would return you a hash as follows showing which attributes have been changed:
{"name"=>["foo", "bar"], "updated_at"=>[Tue, 19 Apr 2016 08:19:40 UTC +00:00, Mon, 25 Apr 2016 10:49:47 UTC +00:00]}
Refer:
previous_changes
Please have a look ActiveModel::Dirty module:
object.updated_at # returns current value
object.updated_at_changed? # returns true or false if value has changed
object.updated_at_was # return last value
object.updated_at_change
Or
If you wants to track all changed values you can use Paper Trail Gem.
It will be useful if you use paper trail gem.
It will persist the previous record on disk which may affect your app performance.
Better way to implement an in-memory solution to store the previous records.

Rails 4 Comparing Datetime in API

Hi I am having issues comparing datetimes with a Rails 4 JSON API.
I use a scope with the created_at attribute
scope :later_than, -> (date) { where('created_at > ?', date) }
The JSON returned for the created_at looks like
"created_at" = "2015-05-07T01:16:43.611Z"
When sending this same datetime the API log and SQL look like
Parameters: {"later_than"=>"2015-05-06T21:16:43.611-0400"}
created_at > '2015-05-06T21:16:43.611-0400'
In the console
Object.first.created_at
=> Thu, 07 May 2015 01:16:43 UTC +00:00
Object.first.created_at > '2015-05-06T21:16:43.611-0400'
=> true
The last comparison should be false, but instead it is true and the scope is not working properly.
When logging
Object.first.created_at - '2015-05-06T21:16:43.611-0400'.to_datetime
=> 0.000402
So what happens is:
the API returns datetime truncated to milliseconds
Rails compares datetimes with microseconds precision
Thus when sending the same datetime to the API, the microseconds will be set to 0 and thus the comparison is not going to work as expected.
Is there a way to tell Rails: compare datetimes with millisecond precision?
Is Message.first.created_at equal to Thu, 07 May 2015 01:16:43 UTC +00:00? (you have Object.first.created_at up there) because if it is, the console expression is behaving correctly and should be true.
Have you tried something like this?
Object.first.created_at > Time.parse('2015-05-06T21:16:43.611-0400')

Ruby on Rails retrieve datetime by converting it from UTC to user's time zone from database by querying date

my application stores attendance datetime from user as 2014-11-23 08:42:00 by converting it to UTC, application has custom search method to search attendance only by entering date as 2014-11-23.
Now problem is i have 5 attendance of date 2014-11-23 with different time and Rails stored it by converting into UTC. so for 2 record it is converted and date is changed to 2014-11-22.
my search query is 2014-11-23 and expected result is all 5 records but getting only 3.
not getting other 2 because they are converted to 2014-11-22
How to get all 5 records only with entering 2014-11-23 ?
Please help.
If you store the datetime you can use it for that query using beginning_of_day and end_of_day methods on the time with timezone
date = Time.parse('Wed, 19 Nov 2014 19:23:59 UTC +00:00')
# => 2014-11-19 19:23:59 UTC
d = date.in_time_zone('Paris')
# => Wed, 19 Nov 2014 20:23:59 CET +01:00
User.where(created_at: (d.beginning_of_day..d.end_of_day)).count
# (46.5ms) SELECT COUNT(*) FROM "users" WHERE ("users"."created_at" BETWEEN '2014-11-18 23:00:00.000000' AND '2014-11-19 22:59:59.999999')

Error when comparing two DateTime objects in Ruby on Rails

I'm comparing two DateTime objects (at least I think I am, they look slightly different in the console output below).
p DateTime.now
p current_user.created_at #schema.rb states that this is a datetime field
difference = DateTime.now - current_user.created_at
p difference
Console output
Mon, 04 Oct 2010 22:56:32 +1000
Sat, 14 Aug 2010 20:51:08 EST +10:00
Error (on the difference = DateTime.now - current_user.created_at line)
expected numeric or date
What am I doing wrong? Thanks for reading.
Try Time.zone.now (http://railsapi.com/doc/rails-v3.0.0/classes/ActiveSupport/TimeWithZone.html).

Resources