Validate-Classification

Fri 14 November 2025
import numpy as np
import pandas as pd
from sklearn.model_selection import train_test_split
from sklearn.ensemble import RandomForestClassifier
from deepchecks import Dataset
from deepchecks.checks import TrainTestFeatureDrift, ConfusionMatrixReport
from deepchecks.suites import full_suite

# Generate a synthetic dataset
from sklearn.datasets import make_classification
# Generate a dataset with 2 classes
X, y …

Category: deepchecks

Read More

Values-And-Index

Fri 14 November 2025

title: "Values and Index" author: "Rj" date: 2019-04-22 description: "-" type: technical_note draft: false


import numpy as np
import pandas as pd
datatype = [('one', 'int32'), ('two', 'int32')]
values = np.zeros(3, dtype = datatype)
currrent_index = ['Row '+str(i) for i in range(1, 4)]
df = pd.DataFrame(values, index = currrent_index)
df

Category: data-wrangling

Read More

Values-On-Top

Fri 14 November 2025


import numpy as np
import matplotlib.pyplot as plt


data = [[  66386,  174296,   75131,  577908,   32015],
        [  58230,  381139,   78045,   99308,  160454],
        [  89135,   80552,  152558,  497981,  603535],
        [  78415,   81858,  150656,  193263,   69638],
        [ 139361,  331509,  343164,  781380,   52269]]

columns = ('Freeze', 'Wind', 'Flood', 'Quake', 'Hail')
rows = ['%d year' % x for x in (100, 50 …

Category: barchart

Read More

Van-Der-Pol-1

Fri 14 November 2025

from bokeh.plotting import figure, output_file, show
from bokeh.io import output_notebook
from bokeh.models import ColumnDataSource
# Set Bokeh output to notebook
output_notebook()

Category: bokeh

Read More

Variables-And-Session

Fri 14 November 2025

title: "Variables and Session" author: "Raja CSP Raman" date: 2019-05-07 description: "-" type: technical_note draft: false


import tensorflow as tf

import os

# Just disables the warning, doesn't enable AVX/FMA
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
a = tf.ones((2, 2))
b = tf.Variable(tf.zeros((2, 2)), name = 'weights')

with tf …

Category: tensorflow-work

Read More

Variables-With-Random-Values

Fri 14 November 2025

title: "Variables With Random Values" author: "Raja CSP Raman" date: 2019-05-06 description: "-" type: technical_note draft: false


import tensorflow as tf

import os

# Just disables the warning, doesn't enable AVX/FMA
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
a = tf.random_uniform((4, 4), 0, 1)
a
<tf.Tensor 'random_uniform_2:0' shape=(4, 4 …

Category: tensorflow-work

Read More

Variables-With-Type

Fri 14 November 2025

title: "Variables with Type" author: "Raja CSP Raman" date: 2019-05-06 description: "-" type: technical_note draft: false


import tensorflow as tf

import os

# Just disables the warning, doesn't enable AVX/FMA
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
w = tf.Variable([.2], dtype=tf.float32)
b = tf.Variable([0.11], dtype=tf.float32)
x …

Category: tensorflow-work

Read More

Various-Algorithms

Fri 14 November 2025

title: "Various Algorithms" author: "Rj" date: 2019-04-20 description: "-" type: technical_note draft: false


Source:

https://www.kaggle.com/drfrank/estonia-disaster-visualization-machine-learning

import numpy as np
from sklearn.linear_model import LinearRegression
from sklearn.model_selection import train_test_split, GridSearchCV, cross_val_score
from sklearn.metrics import confusion_matrix, accuracy_score, classification_report

X = np.array(
    [
        [1, 1], [1, 2], [2 …

Category: basics

Read More

Various-Algorithms-Titanic

Fri 14 November 2025

title: "Various Algorithms Titanic" author: "Rj" date: 2019-04-20 description: "-" type: technical_note draft: false


Source:

https://www.kaggle.com/drfrank/estonia-disaster-visualization-machine-learning

https://stackoverflow.com/questions/55240330/how-to-read-csv-file-from-github-using-pandas

https://gist.github.com/michhar/2dfd2de0d4f8727f873422c5d959fff5

https://www.kaggle.com/rajacsp/titanic-basic-analysis

import pandas as pd

url = 'https://gist.githubusercontent.com/michhar/2dfd2de0d4f8727f873422c5d959fff5/raw …

Category: basics

Read More

Versions

Fri 14 November 2025

title: "Versions" author: "Rj" date: 2019-04-20 description: "List Test" type: technical_note draft: false


# scipy
import scipy
print('scipy: %s' % scipy.__version__)
scipy: 1.2.1
# numpy
import numpy
print('numpy: %s' % numpy.__version__)
numpy: 1.16.2
# matplotlib
import matplotlib
print('matplotlib: %s' % matplotlib.__version__)
matplotlib: 3.0.3
# pandas …

Category: basics

Read More
Page 141 of 146

« Prev Next »