-
The Python Package Index (PyPI) is a repository of software for the Python programming language.
-
NumFOCUS is a nonprofit that supports open source scientific computing.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
id | entage | follow | pd | fate | fh | |
---|---|---|---|---|---|---|
1 | 30 | 14.863791465759277 | 0 | 0 | 0 | |
2 | 45 | 24.16974639892578 | 0 | 0 | 0 | |
3 | 35 | 23.32375144958496 | 0 | 0 | 0 | |
4 | 47 | 17.4757022857666 | 0 | 0 | 0 | |
5 | 30 | 28.43805694580078 | 1 | 0 | 0 | |
6 | 44 | 26.376455307006836 | 1 | 0 | 0 | |
7 | 50 | 28.331279754638672 | 1 | 0 | 0 | |
8 | 47 | 29.3223819732666 | 0 | 0 | 0 | |
9 | 39 | 27.299110412597656 | 1 | 0 | 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
This module defines export functions for survival trees. | |
It is based on the sklearn.tree.export module. | |
""" | |
# Authors: Gilles Louppe <g.louppe@gmail.com> | |
# Peter Prettenhofer <peter.prettenhofer@gmail.com> | |
# Brian Holt <bdholt1@gmail.com> | |
# Noel Dawe <noel@dawe.me> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
class CoefficientRescaler: | |
"""Inverse transform of coefficients of a linear model. | |
Parameters | |
========== | |
scalar_mean : ndarray, shape=(n_features,) | |
Feature-wise mean. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import matplotlib.pyplot as plt | |
import numpy as np | |
import pandas as pd | |
import seaborn as sns | |
from matplotlib.backends.backend_pdf import PdfPages | |
def index_to_binary_matrix(index): | |
return index.to_series().apply(lambda x: pd.Series(map(int, x.split(":")), name=x)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# simulation study related to https://stats.stackexchange.com/questions/362194/data-how-smart-are-models-is-my-dummy-redundant | |
library(ROCR) | |
gen.features <- function(n.samples) { | |
age <- runif(n.samples, min=6, max=89) | |
sex <- factor(rbinom(n.samples, 1, 0.5), c(0, 1), c("male", "female")) | |
data <- data.frame(age, sex) | |
return(data) | |
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from theano.printing import Print | |
import pymc3 as pm | |
import numpy as np | |
import theano.tensor as T | |
def covariance(sigma, rho): | |
C = T.fill_diagonal(T.alloc(rho, 2, 2), 1.) | |
S = T.diag(sigma) | |
M = S.dot(C).dot(S) |