Angela  Dickens

Angela Dickens

1598070600

Visual Representation of Matrix and Vector Operations

I am accustomed to creating new deep learning architectures for different problems, but which framework (Keras, Pytorch, TensorFlow) to choose is often harder.

Since there’s an uncertainty in it, it’s good to know the fundamental operations on those framework’s fundamental units (NumPy, Torch, Tensor).

In this post, I have performed a handful of the same operations across the 3 frameworks, also tried my hands on visualization for most of them.

This is a beginner-friendly post, so let’s get started.

1. Installation

pip install numpy
	pip install tensorflow
	pip install torch
view raw
pips.py hosted with ❤ by GitHub

2. Version Check

import numpy as np
	import tensorflow as tf
	import torch

	print(np.__version__)
	print(tf.__version__)
	print(torch.__version__)

	#### OUTPUT ###

	2.3.0 
	1.18.5 
	1.6.0+cu101
view raw
VC.py hosted with ❤ by GitHub

3. Array Initialization ~ 1-D, 2-D, 3-D

Scalar and 1-D Array

Image for post

Scalar, 1-D, 2-D arrays

#torch #tensor #numpy #deep-learning #tensorflow #deep learning

What is GEEK

Buddha Community

Visual Representation of Matrix and Vector Operations
Ray  Patel

Ray Patel

1619565060

Ternary operator in Python?

  1. Ternary Operator in Python

What is a ternary operator: The ternary operator is a conditional expression that means this is a comparison operator and results come on a true or false condition and it is the shortest way to writing an if-else statement. It is a condition in a single line replacing the multiline if-else code.

syntax : condition ? value_if_true : value_if_false

condition: A boolean expression evaluates true or false

value_if_true: a value to be assigned if the expression is evaluated to true.

value_if_false: A value to be assigned if the expression is evaluated to false.

How to use ternary operator in python here are some examples of Python ternary operator if-else.

Brief description of examples we have to take two variables a and b. The value of a is 10 and b is 20. find the minimum number using a ternary operator with one line of code. ( **min = a if a < b else b ) **. if a less than b then print a otherwise print b and second examples are the same as first and the third example is check number is even or odd.

#python #python ternary operator #ternary operator #ternary operator in if-else #ternary operator in python #ternary operator with dict #ternary operator with lambda

Arvel  Parker

Arvel Parker

1591177440

Visual Analytics and Advanced Data Visualization

Visual Analytics is the scientific visualization to emerge an idea to present data in such a way so that it could be easily determined by anyone.

It gives an idea to the human mind to directly interact with interactive visuals which could help in making decisions easy and fast.

Visual Analytics basically breaks the complex data in a simple way.

The human brain is fast and is built to process things faster. So Data visualization provides its way to make things easy for students, researchers, mathematicians, scientists e

#blogs #data visualization #business analytics #data visualization techniques #visual analytics #visualizing ml models

Visual representations

This is a follow-up to my last publication, about learning business statistics in order to find a data science job, if you didn’t read my first post, please check it in here.

So, this text will cover the contents of the first and half of the second chapter of the book Statistic for Business and Economics by David R. Anderson, Dennis J. Sweeney, and Thomas A. Williams, if you want to check out I’m going with the eleventh edition.

Before we start with my biggest learnings I would like to tell you something that I been thinking about this during the first chapters:

If you want to follow this path, you need to rely more on learning with documentations than learning from free internet content.

Why? Well, this text will cover a little bit about some very early concepts but more on visual representations, and doing it on python, can be very tricky. The most tricky part of it is the part about how to input your data, and how your input will give the desired output, I looked into some content online to try to help me and, some of it just make you go and reproduce exactly what the person in the other side of the screen is doing, which is very far from reality (even the exercises for you to think about, are pretty much a copy and paste).

Given that situation, I had to go choose my tools of choice, and I how they work together, as my computer is very old (I’m running a 4GB RAM so pray for me in the future), I’m going with Jupiter Notebooks as my IDE, for running each individual cell, Pandas for data manipulation, just because I have more affinity with it now but I’m learning how to switch to Numpy when necessary and Plotly for data visualization, because, apparently, Matplotlib doesn’t work so well with Jupiter and I had an annoying bug running it.

Another thing I found myself really surprised in the first chapter already, the number of concepts covered by the book that often listen associated with data science. Inference, data mining, time series, quantitative data, all that jazz really explained and really giving me some ground on all those stuff.

So now that you are up to speed, let’s get into what I’ve done so far.

#python-programming #data-science #machine-learning #python #data-visualization #visual representations

Abdullah  Kozey

Abdullah Kozey

1617738420

Unformatted input/output operations In C++

In this article, we will discuss the unformatted Input/Output operations In C++. Using objects cin and cout for the input and the output of data of various types is possible because of overloading of operator >> and << to recognize all the basic C++ types. The operator >> is overloaded in the istream class and operator << is overloaded in the ostream class.

The general format for reading data from the keyboard:

cin >> var1 >> var2 >> …. >> var_n;

  • Here, var1var2, ……, varn are the variable names that are declared already.
  • The input data must be separated by white space characters and the data type of user input must be similar to the data types of the variables which are declared in the program.
  • The operator >> reads the data character by character and assigns it to the indicated location.
  • Reading of variables terminates when white space occurs or character type occurs that does not match the destination type.

#c++ #c++ programs #c++-operator overloading #cpp-input-output #cpp-operator #cpp-operator-overloading #operators

Kasey  Turcotte

Kasey Turcotte

1623233520

Efficient Pandas: Apply vs Vectorized Operations

Time and efficiency matters

Pandas is one of the most commonly used data analysis and manipulation libraries in data science ecosystem. It offers plenty of functions and methods to perform efficient operations.

What I like most about Pandas is that there are almost always multiple ways to accomplish a given task. However, we should consider time and computational complexity when selection a method from available options.

It is not enough just to complete a given task. We should make it as efficient as possible. Thus, having a comprehensive understanding of how functions and methods work is of crucial importance.

In this article, we will do examples to compare the apply and applymap functions of pandas to vectorized operations. The apply and applymap functions come in hand for many tasks. However, as the size of data increases, time becomes an issue.

#programming #data-science #machine-learning #artificial-intelligence #efficient pandas: apply vs vectorized operations #apply vs vectorized operations