The sigmoid or activation function and their uses

From Wikipedia:

“Many natural processes, including those of complex system learning curves, exhibit a progression from small beginnings that accelerates and approaches a climax over time. When a detailed description is lacking, a sigmoid function is often used. A sigmoid curve is produced by a mathematical function having an “S” shape. Often, sigmoid function refers to the special case of the logistic function shown at right and defined by the formula”

When you are faced to a mathematical problem, where is necessary to find a output value, (given a continue input ) that behave like near to Boolean, for example, in simulated neural networks or in very range of problem, could be necessary to use this function and adapt it to our needs.

As was previously stated, the graph of sigmoid function has “S” shape, but could be necessary to change the shape of it “s” or their position.

In the previous formula, we have added a and b.

If you change a, for instance, a=10, you will get a short “S”, if you let a=20, “S” will be more short.

If you change b, it will let you move your S in the graph, allowing let it not centred on zero. For example, if you input range (domain of function) is between 0.0 and 1.0, you could need the following function:

Where y=0.5, when x=0.5.

You can see it graph using Google calculator here

I found more information about this function on Dr. Mark Humphrys webpage




pickleDB, a key/value store for python


PickleDB logo

PickleDB is a simple store of kind key/value that was written by Harrison Erd. I made simple test to storing:

  • Number,
  • Text,
  • Dictionaries
and  it works fine for a not huge quantity of keys, may be, less or around 1.000.000, depending you machine configuration (In my test, I used a Intel Core i7 2600CPU@3.40 gHZ, 4 GB Ram computer with Python over Windows 7 Professinoal).
  • Very easy to use. I got it working in few minutes
  • Easy integrate with your python code
  • Has a limited capacity to work with large dataset, due that works with it in memory and then dump it to a file.

If you need work with more data, I recommend to play with other, like as Riak, Couchbase, Redis or OrientDB. For a large list of nosql database, go to

Example of usage (Python console):

In [19]: import pickledb
In [20]: db=pickledb.load('data.db',False)
In [25]: db.set('key1',1)
Out[25]: True
In [26]: db.get('key1')
Out[26]: 1


Four pillars of analytics competing
Distinctive capability
Enterprise-wide Analytics
Senior management commitment
Large-scale ambition

2011 in review

The stats helper monkeys prepared a 2011 annual report for this blog.

Here’s an excerpt:

A New York City subway train holds 1,200 people. This blog was viewed about 6,100 times in 2011. If it were a NYC subway train, it would take about 5 trips to carry that many people.

Click here to see the complete report.

Writing business letters, useful phrases

It’s a copy from

There you will find more content about it and updates.

  • Dear Mr Brown
  • Dear Ms White
  • Dear Sir
  • Dear Sirs
  • Dear Madam  
  • Dear Sir or Madam
  • Gentlemen


  • We are writing to inform you that …
    to confirm …
    to request …
    to enquire about …
  • I am contacting you for the following reason.
  • I recently read/heard about  . . . and would like to know . . .
  • Having seen your advertisement in … , I would like to …
  • I would be interested in (obtaining/receiving) …
  • I received your address from …      and would like to   …
  • I am writing to tell you about …


       Referring to
previous contact
  • Thank you for your letter of March 15 …
  • Thank you for contacting us.
  • In reply to your request …
  • Thank you for your letter regarding …
  • With reference to our telephone conversation yesterday …
  • Further to our meeting last week …
  • It was a pleasure meeting you in London last month.
  • I enjoyed having lunch with you last week in Tokyo.
  • I would just like to confirm the main points we discussed on Tuesday . . .


       Making a request
  • We would appreciate it if you would …
  • I would be grateful if you could…
  • Could you please send me . . .
  • Could you possibly tell us/let us have…
  • In addition, I would like to receive …
  • It would be helpful if you could send us …
  • I am interested in (obtaining/receiving…)
  • I would appreciate your immediate attention to this matter.
  • Please let me know what action you propose to take.


       Offering help
  • We would be happy to …
  • Would you like us to …
  • We are quite willing to …
  • Our company would be pleased to …
       Giving good news
  • We are pleased to announce that …
  • I am delighted to inform you that …
  • You will be pleased to learn that …
       Giving bad news
  • We regret to inform you that …
  • I’m afraid it would not be possible to …
  • Unfortunately we cannot/we are unable to …
  • After careful consideration we have decided (not) to …
  • I am writing to express my dissatisfaction with …
  • I am writing to complain about …
  • Please note that the goods we ordered on (date) have not yet arrived.
  • We regret to inform you that our order n°— is now considerably overdue.
  • I would like to query the transport charges which seem unusually high. 
  • We are sorry for the delay in replying …
  • I regret any inconvenience caused
  • I would like to apologize for (the delay/the inconvenience) …
  • Once again, I apologise for any inconvenience.
  • Thank you for your quotation of …
  • We are pleased to place an order with your company for …
  • We would like to cancel our order n°…    
  • Please confirm receipt of our order.
  • I am pleased to acknowledge receipt of your order n°…
  • Your order will be processed as quickly as possible.
  • It will take about (three) weeks to process your order.
  • We can guarantee delivery before …
  • Unfortunately these articles are no longer available/are out of stock.
  • Please send us your price list.
  • You will find enclosed our most recent catalogue and price list.
  • Please note that our prices are subject to change without notice.
  • We have pleasure in enclosing a detailed quotation.
  • We can make you a firm offer of …
  • Our terms of payment are as follows :
       Referring to payment
  • Our records show that we have not yet received payment of …
  • According to our records …
  • Please send payment as soon as possible.
  • You will receive a credit note for the sum of …
       Enclosing documents
  • I am enclosing …
  • Please find enclosed …
  • You will find enclosed …
       Closing remarks
  • If we can be of any further assistance, please let us know
  • If I can help in any way, please do not hesitate to contact me
  • If you require more information …
  • For further details …
  • Thank you for taking this into consideration
  • Thank you for your help.
  • We hope you are happy with this arrangement.
  • We hope you can settle this matter to our satisfaction.
       Referring to future
  • We look forward to a successful working relationship in the future
  • We would be (very) pleased to do business with your company.
  • I would be happy to have an opportunity to work with your firm.
       Referring to future
  • I look forward to seeing you next week
  • Looking forward to hearing from you
  •     ”           ”      to receiving your comments
  • I look forward to meeting you on the 15th
  • I would appreciate a reply at your earliest convenience.  
  • An early reply would be appreciated.
        Ending business letters 
  • Sincerely,          }
  • Yours sincerely, } (for all customers/clients)
  • Sincerely yours, }
  • Regards,             (for those you already know and/or
    with whom you already have a working relationship.)

vi Editor Commands


I found a listed of commands to work with vi editor in linux. That’s all folks

Captura de pantalla vi

Captura de pantalla vi - Pantalla capturada con Cmd+Shift+4 y luego Space Bar


General Startup
To use vi: vi filename
To exit vi and save changes: ZZ or :wq
To exit vi without saving changes: :q!
To enter vi command mode: [esc]
A number preceding any vi command tells vi to repeat
that command that many times.
Cursor Movement

h move left (backspace)

j move down

k move up

l move right (spacebar)

[return] move to the beginning of the next line

$ last column on the current line

0 move cursor to the first column on the
current line

^ move cursor to first nonblank column on the
current line

w move to the beginning of the next word or
punctuation mark

W move past the next space

b move to the beginning of the previous word
or punctuation mark

B move to the beginning of the previous word,
ignores punctuation

e end of next word or punctuation mark

E end of next word, ignoring punctuation

H move cursor to the top of the screen

M move cursor to the middle of the screen

L move cursor to the bottom of the screen
Screen Movement

G move to the last line in the file

xG move to line x

z+ move current line to top of screen

z move current line to the middle of screen

z- move current line to the bottom of screen

^F move forward one screen

^B move backward one line

^D move forward one half screen

^U move backward one half screen

^R redraw screen
( does not work with VT100 type terminals )

^L redraw screen
( does not work with Televideo terminals )

r replace character under cursor with next
character typed

R keep replacing character until [esc] is hit

i insert before cursor

a append after cursor

A append at end of line

O open line above cursor and enter append mode

x delete character under cursor

dd delete line under cursor

dw delete word under cursor

db delete word before cursor
Copying Code

yy (yank)’copies’ line which may then be put by
the p(put) command. Precede with a count for
multiple lines.
Put Command
brings back previous deletion or yank of lines,
words, or characters

P bring back before cursor

p bring back after cursor

Find Commands

? finds a word going backwards

/ finds a word going forwards

f finds a character on the line under the
cursor going forward

F finds a character on the line under the
cursor going backwards

t find a character on the current line going
forward and stop one character before it

T find a character on the current line going
backward and stop one character before it

; repeat last f, F, t, T
Miscellaneous Commands

. repeat last command

u undoes last command issued

U undoes all commands on one line

xp deletes first character and inserts after
second (swap)

J join current line with the next line

^G display current line number

% if at one parenthesis, will jump to its mate

mx mark current line with character x

‘x find line marked with character x

NOTE: Marks are internal and not written to the file.
Line Editor Mode
Any commands form the line editor ex can be issued
upon entering line mode.

To enter: type ‘:’

To exit: press[return] or [esc]
ex Commands
For a complete list consult the
UNIX Programmer’s Manual
copies (reads) filename after cursor in file
currently editing

:r filename

:w saves the current file without quitting

:# move to line #

:$ move to last line of file
executes ‘cmd’ as a shell command.




Installing IPython on Mac OS X 10.6.8

If you work with python, you likely know Ipython which allow works with Python in a nice way. I’ve worked previously in ubuntu linux. Now that I need  work with this in Mac, I used the following commands to get it working.

sudo easy_install ipytho
sudo easy_install  readline

In my first attempt, I followed this post of Brin Berliner but I got an compilation error, so I changed it to my commands and it works well.