Skip to content

Instantly share code, notes, and snippets.

View chandan2495's full-sized avatar
🎯
Focusing

Chandan Singh chandan2495

🎯
Focusing
View GitHub Profile
@chandan2495
chandan2495 / LeetCodeArticles.md
Last active January 2, 2024 06:38
LeetCode Articles
@chandan2495
chandan2495 / readme.md
Last active November 4, 2020 11:34 — forked from troyfontaine/readme.md
Resize root partition (or how to remove the default /home partition) on CentOS 7 online

Resize root partition (or how to remove the default /home partition) on CentOS 7 online

This requires you to be able to ssh into the instance using the root user account and that no services be running as users out of /home on the target machine.

The examples are from a default installation with no customation-you NEED to know what you're working with for volumes/partitions to not horribly break things.

By default, CentOS 7 uses XFS for the file system and Logical Volume Manager (LVM), creating 3 partitions: /,/home and

Step 1 - Copy /home Contents (No need if you don't have any data there)

To backup the contents of /home, do the following:

@chandan2495
chandan2495 / download_links.js
Created September 17, 2019 07:30
download links using javascript
@chandan2495
chandan2495 / MLTips.md
Last active May 2, 2019 06:06
Approaching any ML Problem
  1. Single column, binary values -- classification problem
  2. Single column, real values -- regression problem
  3. Multiple Column, binary values -- multi classification (more than two classes)
  4. Multiple column, real values -- regression problem
  5. Multilabel -- classficiation (one sample belong to several class)

Evaluation Metrics

  1. Binary Classification problem -- ROC AUC or simply AUC
  2. Regression problem -- MSE (mean squared error)
@chandan2495
chandan2495 / Pandas.md
Last active February 13, 2019 10:25
sufficient pandas
  • Use the brackets for selecting a column of data
  • The loc indexer selects only by label while the iloc indexer selects only by integer location.
  • Two additional indexers, at and iat, exist that select a single cell of a DataFrame. These provide a slight performance advantage over their analogous loc and ilocindexers.
>>> import numpy as np
>>> a = np.random.rand(10 ** 5, 5)
>>> df1 = pd.DataFrame(a)
>>> row = 50000
@chandan2495
chandan2495 / Spacy_GPU.md
Created January 29, 2019 15:00
spacy installation with gpu

Spacy Installation with GPU

  • Install CUDA 10
  • Install cuDNN 7.4
  • Copy bin and include folder files from cuDNN to CUDA installation path.
  • Install cython using pip
  • Install fastrlock using conda
  • Install cupy-cuda100 from pypi (with --no-deps)
  • Install thinc using conda
  • Install spacy using conda
@chandan2495
chandan2495 / Juypter_theme.md
Last active August 26, 2018 16:24
Jupyter notebook sytling

Theme

jt -t onedork -fs 95 -tfs 13 -nfs 115 -cellw 88% -fs 12 -nfs 12 -ofs 11

Set default plotting style

nano ~/.ipython/profile_default/startup/startup.ipy

# import jtplot module in notebook
from jupyterthemes import jtplot

# choose which theme to inherit plotting style from
@chandan2495
chandan2495 / DeleteCommand.md
Last active April 13, 2018 12:51
Removing Files with permissions

Change permission

cacls Folder /G everyone:F /t

  • /G grant access to the user
  • everyone username
  • F for full control
  • /t recursive

Recursive Delete

rmdir Folder /Q /S

Good To Know

  • intern method
    • Java automatically interns string literals.
    • intern method is to be used on Strings constructed using new String()
    String s1 = new String("Hello");
    String s2 = new String("Hello").intern();
    if (s1 == s2) {

System.out.println("s1 and s2 are same");