Linear-Regression-Simple-8594

Sat 17 May 2025

title: "Linear Regression Simple" author: "Rj" date: 2019-04-20 description: "-" type: technical_note draft: false


import matplotlib.pyplot as plt
import numpy as np
from sklearn import datasets, linear_model
from sklearn.metrics import mean_squared_error, r2_score
import pandas as pd
# Load the diabetes dataset
diabetes_data = datasets.load_diabetes()
# Print all keys and number of …

Category: sklearn

Read More

Logistic Regression Breast Cancer

Sat 17 May 2025

title: "Logistic Regression Breast Cancer" author: "Rj" date: 2019-04-20 description: "-" type: technical_note draft: false


import numpy as np
import pandas as pd
from sklearn.datasets import load_breast_cancer
import statsmodels.api as sm
import scipy.stats as st
from statsmodels.tools import add_constant as add_constant
df = load_breast_cancer()
df_cancer = pd.DataFrame(np …

Category: sklearn

Read More

Pca-Simple

Sat 17 May 2025

title: "PCA Simple" author: "Rj" date: 2019-04-20 description: "-" type: technical_note draft: false


from sklearn.pipeline import Pipeline, FeatureUnion
from sklearn.model_selection import GridSearchCV
from sklearn.svm import SVC
from sklearn.datasets import load_iris
from sklearn.decomposition import PCA
from sklearn.feature_selection import SelectKBest
iris = load_iris()
X, y = iris.data, iris …

Category: sklearn

Read More

Pydotplus-1

Sat 17 May 2025
from pydotplus import graphviz

# Example graph creation
graph = graphviz.Dot(graph_type='digraph')
node_a = graphviz.Node('A')
node_b = graphviz.Node('B')
graph.add_node(node_a)
graph.add_node(node_b)
graph.add_edge(graphviz.Edge(node_a, node_b))

# Save and visualize
graph.write_png("example_graph.png")
from IPython.display import Image
Image(graph.create_png())

png



Score: 0

Category: sklearn

Read More

Simple-Tree

Sat 17 May 2025

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


from sklearn import tree
X = [[0, 0], [1, 1]]
Y = [0, 1]
clf = tree.DecisionTreeClassifier()
clf = clf.fit(X, Y)
print(clf.predict([[21., 21.]]))
[1]


Score: 5

Category: sklearn

Read More
Page 2 of 2

« Prev