Skip to content

Instantly share code, notes, and snippets.

View lokeshh's full-sized avatar
🌴
On vacation

Lokesh Sharma lokeshh

🌴
On vacation
View GitHub Profile
-- Logs begin at Tue 2017-01-03 16:35:05 IST, end at Tue 2017-01-03 17:09:01 IST. --
Jan 03 16:35:05 kali kernel: microcode: CPU0 microcode updated early to revision 0xa4, date = 2010-10-02
Jan 03 16:35:05 kali kernel: Linux version 4.5.0-kali1-amd64 (debian-kernel@lists.debian.org) (gcc version 5.3.1 20160409 (Debian 5.3.1-14) ) #1 SMP Debian 4.5.3-2kali1 (2016-05-09)
Jan 03 16:35:05 kali kernel: Command line: BOOT_IMAGE=/boot/vmlinuz-4.5.0-kali1-amd64 root=/dev/sda6 ro initrd=/install/gtk/initrd.gz quiet
Jan 03 16:35:05 kali kernel: x86/fpu: Legacy x87 FPU detected.
Jan 03 16:35:05 kali kernel: x86/fpu: Using 'lazy' FPU context switches.
Jan 03 16:35:05 kali kernel: e820: BIOS-provided physical RAM map:
Jan 03 16:35:05 kali kernel: BIOS-e820: [mem 0x0000000000000000-0x000000000009fbff] usable
Jan 03 16:35:05 kali kernel: BIOS-e820: [mem 0x000000000009fc00-0x000000000009ffff] reserved
Jan 03 16:35:05 kali kernel: BIOS-e820: [mem 0x00000000000e0000-0x00000000000fffff] reserved
#!/bin/sh
#jinstall - Command line script to easily add new java directories to
#'alternatives'. This sets the java as default, and you can switch your
#default java with update-java-alternatives
#
#Copyright 2014 Bruce.Ingalls at gmail & Alin Andrei <webupd8@gmail.com>
#GPL v3 Affero license at http://www.gnu.org/
#Downloads & discussion at http://www.webupd8.org/
#Tested on Ubuntu Oneiric; should require few changes for other modern Unix systems
#Currently tested only with JDK, not JRE.

GSoC 2016 Summary, Adding categorical data support

Support for categorical data is important for any data analysis tool. This summer I added categorical data support to:

  • to easily analyze categorical data in Daru
  • visualize categorical data
  • support regression with categorical variable in Statsample and Statsample-GLM

Here's my project page.

Lets talk about each of them in detail.

array([[ 0.40576443, 0.17155695, 0. , 0. , 0. ,
0. , 0. , 0. , 0. , 0. ,
0. ],
[ 0.20288222, 0.34311389, 0.17489069, 0.08206331, 0.0530504 ,
0.03926702, 0.03141361, 0.0265252 , 0.02344666, 0.02186134,
0.02300929],
[ 0.10144111, 0.17155695, 0.34978139, 0.16412661, 0.0795756 ,
0.05235602, 0.03926702, 0.03183024, 0.02735444, 0.02498438,
0.02588545],
[ 0.06762741, 0.08577847, 0.17489069, 0.32825322, 0.15915119,
@lokeshh
lokeshh / comp.rb
Last active September 17, 2016 18:36
require 'daru'
require 'benchmark'
# Vector :b is not required here. Taking it only to compare the performance
# with second dataframe which also has two columns.
df1 = Daru::DataFrame.new({
a: [1, 2, 3]*1000,
b: [1, 2, 3]*1000},
index: Daru::CategoricalIndex.new([:a, :b, :c, :d, :e, :f]*500)
@lokeshh
lokeshh / abc.md
Created September 16, 2016 17:05

#language en = @PAGE@ = Please describe your City here.

== Teams == Please manually add a link to your team page below after creating it:

  • Team1
  • Team2
require 'benchmark'
require 'matrix'
require 'nmatrix'
class Matrix
public :"[]=", :set_element, :set_component
end
m = Matrix.zero 1000 ;
n = NMatrix.new [1000, 1000], [0]*10**6
This file has been truncated, but you can view the full file.
200000 24
1 1 1 0 0 0 0 0 1 1 0 1 0 0 1 1 1 1 0 0 1 1 1 1
0 1 1 0 0 1 1 0 0 1 0 1 1 1 1 1 1 0 1 0 1 1 0 1
0 1 1 1 0 0 0 0 0 0 0 1 0 0 1 0 1 1 1 0 0 1 0 1
1 1 1 0 1 0 1 1 1 0 1 1 1 1 1 0 1 0 0 1 1 0 0 0
0 1 0 0 1 1 1 0 1 0 1 1 0 0 1 1 1 1 1 0 0 1 0 0
0 1 0 0 1 0 1 0 0 0 0 1 0 0 1 1 1 0 1 1 0 1 0 1
0 0 0 1 1 0 0 0 1 1 0 1 1 0 1 0 1 0 1 0 0 0 0 0
0 0 0 0 1 0 0 0 0 1 1 1 1 1 0 1 1 1 0 1 1 0 0 0
1 1 1 0 0 1 1 0 0 1 0 0 0 1 1 1 1 1 1 1 1 0 0 1
@lokeshh
lokeshh / yo.md
Last active August 19, 2016 16:31
ubuntu@ip-172-31-51-75:~$ irb
2.3.0 :001 > require 'daru'

Install the reportbuilder gem version ~>1.4 for using reportbuilder functions.

Install the spreadsheet gem version ~>1.1.1 for using spreadsheet functions.
NameError: uninitialized constant Daru::Accessors::ArrayWrapper::Forwardable
	from /home/ubuntu/.rvm/gems/ruby-2.3.0/gems/daru-0.1.4/lib/daru/accessors/array_wrapper.rb:6:in `<class:ArrayWrapper>'
	from /home/ubuntu/.rvm/gems/ruby-2.3.0/gems/daru-0.1.4/lib/daru/accessors/array_wrapper.rb:4:in `<module:Accessors>'
require 'benchmark'
n = 100000
dv = Daru::Vector.new 1..n
# For current branch
Benchmark.bm do |x|
x.report do
100.times { dv[0] = nil }
end