Posts

Windows Startup errors and 0x0000225 Error

Image
My main motto is to repair the windows with my data saved. literally, I have tried the possible to solve the above error but I couldn't at initial phases. I have opened cmd from troubleshooting option->advanced option->cmd(you can come to troubleshooting option by pressing  F1  or F8 button simultaneously with the power button). you can check by pressing F2 with power(boot manager and system check) and F12  button (one-time boot menu). after entering cmd typed  bootrec /rebuildbcd, The  bootrec  command will search for Windows installations not included in the BCD and then ask you if you'd like to add one or more to it. then you may get a result of either installation 0 or 1  if 1 press yes to add and  Since the BCD store exists and lists a Windows installation, you'll first have to remove it manually and then try to rebuild it again. At the prompt, execute the  bcdedit  command as shown and then press  Enter ...

Normalization

Major tasks of preprocessing are: Data cleaning filling missing values smoothing of noisy data identifying and removing outliers resolving inconsistencies Data Integration integrating data from multiple databases, data file, cubes Data transformation normalization  aggregation Data reduction obtain a reduced representation of data but same results Data discretization part of data reduction but with particular importance, especially for numeric data Normalization :  The goal of normalization is to make an entire set of values have a particular property. There are 3 different ways to perform normalization : min-max normalization X_std = (X - X.min(axis=0)) / (X.max(axis=0) - X.min(axis=0)) X_scaled = X_std * (max - min) + min here max, min is the new ranges  z-score normalization z = (x - u) / s where u is the mean of the training samples, s is the standard deviation normalization by decimal scaling v_new = v/pow(10,j) ...

How to Handle Noisy Data in preprocessing of data?

Binning method:(one of the method) first sort data and partition into (equi-depth) bins then one can smooth by bin means,  smooth by bin median, smooth by bin boundaries, etc. Equal-width (distance) partitioning: It divides the range into N intervals of equal size: uniform grid if A and B are the lowest and highest values of the attribute, the width of intervals will be: W = (B-A)/N. The most straightforward But outliers may dominate the presentation Skewed data is not handled well. Equal-depth (frequency) partitioning: It divides the range into N intervals, each containing approximately same number of samples Good data scaling Managing categorical attributes can be tricky. Code for binning (if needed we can edit for user input instead of random) : Feel free to comment about mistakes and doubts.

Roots of a Polynomial Equation

The  solvers  module in SymPy implements methods for solving equations. Let's take an example of solving the equation of order 2. Equation : (x - 0.4)*(x + 0.65) - 1, Now we try to find positive roots of equation from sympy.solvers import solve from sympy import Symbol beta = Symbol('x',positive=True) #https://docs.sympy.org/latest/modules/solvers/solvers.html f =1 gammavalues = [0.4, 0.35, 0.3] for i in range(1,-1,-1): f = f*(beta-gammavalues[i]) f= f+1 f = f-2 print(f) beta = solve(f, beta) print(beta) output: (x - 0.4)*(x + 0.65) - 1 [1.00443569980765] just go through this link where you can find other important things like solving an algebraic equation, ODEs, PDEs https://docs.sympy.org/latest/modules/solvers/solvers.html

UNIT TESTS

Image
There are two types of engineers in this world(software context): type-1 just writes code and walks away, they assume everything will work fine. type-2 does the unit test and brings the piece of mind to type-1. Now we go through the unit testing in python, This helps us to the verify how well our code works with the required inputs. If we ask an engineer to write the code for the area of the circle, he writes it with no effort. from math import pi def circle_area(r): return pi*(r**2) #Test function will not be return by type-1 Engineers #Testing function radii = [2, 0, -3, 2+3j,True ,"radius"] message = "Area of circle with r = {radius} is {area}" for r in radii: A = circle_area(r) print(message.format(radius=r, area=A)) Output: we have written the testing code just to show you how the code goes wrong with the inputs. engineers just write the function and get relaxed. From the above i...

Embedding the GitHub Gists codes into blogs

Image
Create the gist of your codes: Then get the embedding link. Click the HTML link and place the embedded link at the desired position. Code your code snippet appears as magic with git link in the below. Above process works for dynamic themes like Contempo in bloggers, but it fails for other dynamic themes so go for step 5. https://stackoverflow.com/questions/18788724/issues-adding-github-gist-to-my-blogusing-google-blogger/21355714#21355714  is the link where you can find the information to display the codes of Github with Gists in dynamic blogs.

Splitting criteria

Image
This package helps to find splitting criteria in C4.5 Information Gain ID3 uses information gain as its attribute selection measure. This measure is based on pioneering work by Claude Shannon on information theory, which studied the value or “information content” of messages. Let node N represent or hold the tuples of partition D. The attribute with the highest information gain is chosen as the splitting attribute for node N. This attribute minimizes the information needed to classify the tuples in the resulting partitions and reflects the least randomness or “impurity” in these partitions. Such an approach minimizes the expected number of tests needed to classify a given tuple and guarantees that a simple (but not necessarily the simplest) tree is found. The expected information needed to classify a tuple in D is given by: where pi is the probability that an arbitrary tuple inDbelongs to classCi and is estimated by |Ci,D|/|D|. A log function to the base 2 is used becaus...

QUOTATION SERVER AND CLIENT

Image
A simple program of server and client where the server sent a good quote to the connected client immediately after the connection(as welcoming). Multiple Clients are handled using java multithreading concept, Used UDP datagram sockets, and text where quotes are stored.  The output of the above program: Outputs after quotes are completed:

SQLiteDatabase

Image
An application which deals with Database, Custom ListView : This is a simple application which covers some of the basic topics of android like AsyncTask, SQLiteDatabase-insertion, Custom ListView UI's of app:                                                                                     activity_main.xml : <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"     android:layout_width="match_parent"     android:layout_height="match_parent"     android:orientation="vertical">     <EditText         android:id="@+id/textName"         android:layout_width="match_parent"     ...