Skip to content

Instantly share code, notes, and snippets.

@fatmas1982
fatmas1982 / statistical_tests.py
Created May 7, 2017 15:39 — forked from mblondel/statistical_tests.py
t-test and wilcoxon-test examples in Python
# Mathieu Blondel, February 2012
# License: BSD 3 clause
# Port to Python of examples in chapter 5 of
# "Introductory Statistics with R" by Peter Dalgaard
import numpy as np
from scipy.stats import ttest_1samp, wilcoxon, ttest_ind, mannwhitneyu
# daily intake of energy in kJ for 11 women
@fatmas1982
fatmas1982 / nnmf_no_datatreatment.py
Created April 2, 2017 19:07 — forked from tgalery/nnmf_no_datatreatment.py
Non-Negative Matrix Factorisation solutions to topic extraction in python

These are two solutions for a topic extraction task. The sample data is loaded into a variable by the script. I’ve included running times for both solutions, so we could have precise information about the cost that each one takes, in addition to their results. According to (Pazienza et al. 2005)
, two trends on textual information can be identified: one based on linguistic and syntactical information, another based on statistical analysis of frequency patterns (which usually consider text as a bags-of-words). Whilst the first approach is a purely syntactic one, the second one aims to imcorporate information about syntatic categories into the analysis (hence a hybrid approach)

After presenting the solutions and briefly mentioning an alternative to it, I’ll move to a short theoretical discussion.

1 – Set-up used:

*Ubuntu 11.04 Natty AMD64

*Python 2.7.3

*python re library

*python nltk 2.0 library and the required NumPy and PyYaml (For NLP tas

@fatmas1982
fatmas1982 / install_tensorflow_centos7.sh
Created February 6, 2017 17:48 — forked from thoolihan/install_tensorflow_centos7.sh
Install TensorFlow on CentOS7
sudo yum -y install epel-release
sudo yum -y install gcc gcc-c++ python-pip python-devel atlas atlas-devel gcc-gfortran openssl-devel libffi-devel
# use pip or pip3 as you prefer for python or python3
pip install --upgrade virtualenv
virtualenv --system-site-packages ~/venvs/tensorflow
source ~/venvs/tensorflow/bin/activate
pip install --upgrade numpy scipy wheel cryptography #optional
pip install --upgrade https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.10.0rc0-cp35-cp35m-linux_x86_64.whl
# or below if you want gpu, support, but cuda and cudnn are required, see docs for more install instructions
pip install --upgrade https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-0.10.0rc0-cp35-cp35m-linux_x86_64.whl
@fatmas1982
fatmas1982 / perceptron.py
Created January 27, 2017 20:23 — forked from oryband/perceptron.py
Perceptron implementation in python, without dependencies or 3rd-party modules (numpy).
"""Simple Perceptron implementation.
No 3rd-party modules (numpy) used.
"""
from math import copysign
def sgn(x):
"""Mathemetical sign function implementation.
@fatmas1982
fatmas1982 / perceptron.py
Created January 27, 2017 20:23 — forked from benui-dev/perceptron.py
Playing with making a simple perceptron in Python. Used Foundations of Statistical Natural Language Processing as a reference.
# Ben's Magical Perceptron
def dot_product(a, b):
return sum([a[i]*b[i] for i in range(len(a))])
def decision( x, w, theta ):
return (dot_product(x, w) > theta)
@fatmas1982
fatmas1982 / vboxdrvfix.md
Created October 18, 2016 20:56 — forked from PartTimeLegend/vboxdrvfix.md
/etc/init.d/vboxdrv setup Not Found - VirtualBox Fix!

#/etc/init.d/vboxdrv setup Not Found - VirtualBox Fix!

When setting up Virtual Box I was faced with the immortal error telling me to run sudo /etc/init.d/vboxdrv setup. Simple enough, until you're told it doesn't exist.

Thus began my fight to get it working. The fix is here in the hope that it helps someone else.

To follow this guide you need to have a basic understanding of shell commands. If you don't, then just be careful.

First off I like aptitute so let's install it.

@fatmas1982
fatmas1982 / BIG DATA with RevoScale R
Created August 6, 2016 13:01 — forked from joseph-rickert/BIG DATA with RevoScale R
Scripts for 2/14/13 Webinar Introduction to R for Data Mining
#------------------------------------------------------------
# REVOLUTION ANALYTICS WEBINAR: INTRODUCTION TO R FOR DATA MINING
# February 14, 2013
# Joseph B. Rickert
# Technical Marketing Manager
#
# BIG DATA with RevoScaleR
#
# Copyright: Revolution Analytics
<dependencies>
<dependency>
<groupId>org.apache.hive</groupId>
<artifactId>hive-jdbc</artifactId>
<version>0.12.0-cdh5.1.0</version>
</dependency>
<dependency>
<groupId>org.apache.hive</groupId>