-->

Thursday, January 5, 2017

Python and Core Python Packages for Data Science

Python

Python is an interpreted, interactive, object-oriented programming language. It incorporates modules, exceptions, dynamic typing, very high level dynamic data types, and classes. Python combines remarkable power with very clear syntax. It has interfaces to many system calls and libraries, as well as to various window systems, and is extensible in C or C++. It is also usable as an extension language for applications that need a programmable interface. Finally, Python is portable: it runs on many Unix variants, on the Mac, and on PCs under MS-DOS, Windows, Windows NT, and OS/2.

From <https://docs.python.org/2.7/faq/general.html>

Enthought Canopy

Enthought Canopy is a comprehensive Python analysis environment that provides easy installation of over 450 core scientific analytic and Python packages, creating a robust platform you can explore, develop, and visualize on. In addition to its pre-built, tested Python distribution, Enthought Canopy has valuable tools for iterative data analysis, visualization and application development including:

From <https://www.enthought.com/products/canopy/>

Spark

Fast and general engine for large-scale data processing. Lets you load data into RDDs (resilient distributed databases), and auto optimally spreads it out to a cluster of machines.

numpy

NumPy is the fundamental package for scientific computing in Python. It is a Python library that provides a multidimensional array object, various derived objects (such as masked arrays and matrices), and an assortment of routines for fast operations on arrays, including mathematical, logical, shape manipulation, sorting, selecting, I/O, discrete Fourier transforms, basic linear algebra, basic statistical operations, random simulation and much more.
At the core of the NumPy package, is the ndarray object. This encapsulates n-dimensional arrays of homogeneous data types, with many operations being performed in compiled code for performance.

From <https://docs.scipy.org/doc/numpy/user/whatisnumpy.html>

matplotlib

matplotlib is a library for making 2D plots of arrays in Python. Although it has its origins in emulating the MATLAB® [1] graphics commands, it is independent of MATLAB, and can be used in a Pythonic, object oriented way. Although matplotlib is written primarily in pure Python, it makes heavy use of NumPy and other extension code to provide good performance even for large arrays.
matplotlib is designed with the philosophy that you should be able to create simple plots with just a few commands, or just one! If you want to see a histogram of your data, you shouldn’t need to instantiate objects, call methods, set properties, and so on; it should just work.

From <http://matplotlib.org/users/intro.html>

SciPy

 

 

SciPy is a collection of mathematical algorithms and convenience functions built on the Numpy extension of Python. It adds significant power to the interactive Python session by providing the user with high-level commands and classes for manipulating and visualizing data. With SciPy an interactive Python session becomes a data-processing and system-prototyping environment rivaling systems such as MATLAB, IDL, Octave, R-Lab, and SciLab

From <https://docs.scipy.org/doc/scipy/reference/tutorial/general.html>

pandas

 

pandas is a Python package providing fast, flexible, and expressive data structures designed to make working with “relational” or “labeled” data both easy and intuitive. It aims to be the fundamental high-level building block for doing practical, real world data analysis in Python. Additionally, it has the broader goal of becoming the most powerful and flexible open source data analysis / manipulation tool available in any language. It is already well on its way toward this goal.

From <http://pandas.pydata.org/pandas-docs/stable/?v=20161222083801>

urllib3

urllib3 is a powerful, sanity-friendly HTTP client for Python. 
  • Thread safety.
  • Connection pooling.
  • Client-side SSL/TLS verification.
  • File uploads with multipart encoding.
  • Helpers for retrying requests and dealing with HTTP redirects.
  • Support for gzip and deflate encoding.
  • Proxy support for HTTP and SOCKS.
  • 100% test coverage.

From <https://urllib3.readthedocs.io/en/latest/>

''

Installing Python Packages

Intent

How to install python packages in Pycharm, Canopy, and potentially more.

Pycharm

  1. Hit 'Ctrl+Alt+S' to open up settings
  2. Navigate to Project Interpreter

  1. Hit the + symbol and browse for packages

  1. PITFALL: Don't forget to upgrade packages. In this case, couldn't install matlib without upgrading pip

Canopy

  1. From the Enthought Canopy frontpage, select 'Project Manager'

  1. Use the search bar to find packages and upgrade them

Monday, December 19, 2016

Type Casting with Primitives



byte: 8 bits
short: 16 bits
int: 32 bits
long: 64
float: 32
double: 64

In java, through polymorphism, its possible to cast different numerals as different types. Take this for example:
int 45 = new double


This is known as Implicit casting, and the number we casted when done so implicitly is generally preserved.

You can also cast down in reverse. Known as explicit casting:
Double 43.45 = (Int) 43.45


Its important to understand that you can as you do such things however, you are effectively cutting off bits (that is, zeros and ones) from that number to make it fit as a smaller unit.

Using a unit converter online, let's see what really happens to that number.





Wednesday, April 27, 2016

Data Science Basics - Structured

Big data is data that exceeds normal processing techniques because the data is too big, moves too fast, or doesn't plain fit structural architecture requirements.


Clustering is one form of classifying structured datasets. They are useful when you want to know something about a larger subset and just about that larger subset.

Some situations where we might cluster involves automatically tagging someone in a photograph, based on prior photos of that person, or recommending a new song to someone based on prior music selections.

When first utilizing a cluster algorithm, it helps to have a set of training data first, Two of the risks we run with clustering training data is overfitting and overgeneralization with our training data.

"If it walks like a duck and quacks like a duck, it might be a duck."

Overfitting: "It is a duck only if it looks and quacks precisely as I have observed ducks. If a new species of duck is added to the dataset, it can't be a duck."

Overgeneralization: "If it hobbles on two legs and emits a hi pitched noise it must be a duck."

Thursday, June 11, 2015

Web Programming Bulletpoints


XML - eXtensible Markup Language

  • A language for storing data in an easy to format manner
  • Lists rules for encoding documents in an way that's both machine and human readable

HTML

  • Static
  • Compiled within the browser, making it more independent


JavaScript

  • Makes an HTML page dynamic
  • Simple syntax
  • Detects client browser
  • Validates client data
  • Example : login pages, Wikipedia, email pages, drop menus
  • Example of pages that wouldn't use  JavaScript: News Article

Cascading Style Sheets

  • Formatting Language
  • Multiple pages use the same style
  • Separates content from style and layout
  • Easier layout changes
For more practice on web programming, I recommend Code Academy.


~Code Crunch Corner~




Thursday, June 4, 2015

Java Beans: Short Version

A java bean is simply a convention for a class. For a class to be considered a bean, it must simply possess:
  • A default constructor
  • Getter and Setter Methods
  • Implements the Serializable interface, so it can its states be saved, streamed, and passed to other applications
That is all. For more details, see here.


~CodeCrunchCorner~

Monday, March 23, 2015

The First Graphics Card

I like many people, would think installing a graphics card would be difficult.

Lets clear away some misconceptions I had about graphics cards that I learned from buying one.

  1. Yes, you really need a card to play games
    • Many of the features list on a PC like buzzwords to make their PC sound more powerful than it really it. Take my case: My computer featured a stellar HD Radeon 4200 integrated graphics!

      "Oh," I thought. "I bet it can play games better than my old lappy.!"

      But all integrated graphics means its that the motherboard itself does graphical work for stuff like playing a movie or web browsing. To play the video games of a console, a part akin to a console is necessary.
  2. Graphics "card" is a bit of a misnomor
    • With computing getting smaller and smaller these days, I never understood why they say you can't upgrade the cards on a laptop. I didn't understood what a graphics card looked like, but when I think "card" I think something that fits in my wallet.

      Boy oh boy was I surprised when my first card showed up.

      [pic of box] [pic of card]

      You see, when one thinks of a graphics card, one should properly visualize something more akin to say...a license plate. That is why for Home Theater Purposes, PCs will always be what you need, even as mobile computing becomes more and more convenient for regular needs and business work.
  3. Hooking up a graphics card is no real different than hooking up a VCR
    • Remember that very first awkward, terrifying moment when you had to hook up a TV or a VCR for the very first time? How you thought "What if I mess something up?!"

      When it comes to the concept of computer upgrades, most people, which included myself, have the apprehension that opening their computer for any reason is bound to break...something! But then you discover that the cables are designed so that it's actually not possible to mess it up, as the cables are thankfully shaped in a manner where its simply a matter of Lego blocks.
  4. With great power comes the need for power
    • It was a really good deal at the time my father bought this computer. I had it appraised for the potential for upgrading from a Geek Squad associate to confirm it was scalable.

      He affirmed for me that it was indeed an excellent base to make a gaming computer at the time, and wondered how they managed to get the price so affordable.So he popped it open to appraise it. And confirmed a suspicion he had.

      They way they did so was to go cheap on the Power Supply. Or PSU. Its the job of a PSU to take Volts from a wall outlet and convert it into the Watts that an appliance needs. Without enough watts, it seems you really could break a system (fortunately, if your PSU isn't up to snuff, it normally doesn't come with enough connectors and stuff however).

      So just be prepared to check if you have enough power to go with your gizmo. Short on cash at the time, I bought an inexpensive 500 Watt Power Supply to take care of things.
  5. Surprisingly Inexpensive Options
    • At the time, I was inbetween jobs and scrapped for cash. I will never forget how I was able to find my card, which was then amongst the top twenty money could buy, at only $180. To me, someone who was working multiple part-time jobs and temp work, was so low that even I could afford it. Based on your budget, there truly are some inexpensive options out there!

      For the next two years my Sapphire would keep me happily gaming on Very High settings. Absolutely beatiful details. So it was later on, for very specific reasons I would develop later, that I would come to wish to have a new high performance system itself. As having shopped, I'd like to advocate that once you start building, beware the temptations of power lust. Gaming need note break the bank. As I would later journey into the world of building a full spectrum.