Hướng dẫn undo log transformation python - hoàn tác bản ghi chuyển đổi python

Tôi đã được cung cấp một bộ dữ liệu đã được chuyển đổi bởi người dùng trước đó. Khi tôi thử và tạo/vẽ một NMF bằng mã này:

multiRankNMF <- nmf(dataset, seq(seq1,seq2), 
                method=usedmethod, nrun=noofrun, 
                seed=initseed, .options = "t")

Tôi không thể nhận được những lỗi này:

 Error in (function (...)  : All the runs produced an error:
    -#1 [r=2] -> NMF::nmf - 20/20 fit(s) threw an error.
 Error(s) thrown:
  - run #1: NMF::nmf - Input matrix x contains some negative entries.
    -#2 [r=3] -> NMF::nmf - 20/20 fit(s) threw an error.
 Error(s) thrown:
  - run #1: NMF::nmf - Input matrix x contains some negative entries.
    -#3 [r=4] -> NMF::nmf - 20/20 fit(s) threw an error.
 Error(s) thrown:
  - run #1: NMF::nmf - Input matrix x contains some negative entries.
    -#4 [r=5] -> NMF::nmf - 20/20 fit(s) threw an error.
 Error(s) thrown:
  - run #1: NMF::nmf - Input matrix x contains some negative entries.
    -#5 [r=6] -> NMF::nmf - 20/20 fit(s) threw an error.
 Error(s) thrown:
  - run #1: NMF::nmf - Input matrix x contains some negative entries.
    -#6 [r=7] -> NMF::nmf - 20/20 fit(s) threw an error.

Suy nghĩ của tôi là các giá trị tiêu cực đang được nhìn thấy là do sự chuyển đổi được sử dụng trước đây vì dữ liệu biểu hiện gen vốn đã không âm.

Làm thế nào tôi có thể hoàn tác sự chuyển đổi được thực hiện để tôi có thể tạo NMF?


Nhiều thử nghiệm thống kê đưa ra giả định rằng các bộ dữ liệu thường được phân phối. Tuy nhiên, điều này thường không phải là trường hợp trong thực tế.

Nội phân chính

  • Chuyển đổi nhật ký trong Python
  • Biến đổi gốc ở Python
  • Biến đổi gốc khối trong Python
  • Tài nguyên bổ sung
  • Làm thế nào để bạn tính toán chuyển đổi nhật ký?
  • Làm thế nào để bạn chuyển đổi dữ liệu trong Python?
  • Biến đổi biến trong Python là gì?

Một biến đổi biến xác định một phép biến đổi được sử dụng cho một số giá trị của một biến. Theo các thuật ngữ khác, đối với mỗi đối tượng, cuộc cách mạng được sử dụng với giá trị của biến cho đối tượng đó.

Nhiều thử nghiệm thống kê đưa ra giả định rằng các bộ dữ liệu thường được phân phối. Tuy nhiên, điều này thường không phải là trường hợp trong thực tế.Transform the response variable from y to log(y).

Nội phân chínhTransform the response variable from y to y.

Chuyển đổi nhật ký trong PythonTransform the response variable from y to y1/3.

Biến đổi gốc ở Python

Biến đổi gốc khối trong Python

Chuyển đổi nhật ký trong Python

Biến đổi gốc ở Pythonlog transformation on a variable and create side-by-side plots to view the original distribution and the log-transformed distribution of the data:

import numpy as np
import matplotlib.pyplot as plt

#make this example reproducible
np.random.seed(0)

#create beta distributed random variable with 200 values
data = np.random.beta(a=4, b=15, size=300)

#create log-transformed data
data_log = np.log(data)

#define grid of plots
fig, axs = plt.subplots(nrows=1, ncols=2)

#create histograms
axs[0].hist(data, edgecolor='black')
axs[1].hist(data_log, edgecolor='black')

#add title to each histogram
axs[0].set_title('Original Data')
axs[1].set_title('Log-Transformed Data')

Biến đổi gốc khối trong Python

Tài nguyên bổ sung

Biến đổi gốc ở Python

Biến đổi gốc khối trong Pythonsquare root transformation on a variable and create side-by-side plots to view the original distribution and the square root transformed distribution of the data:

import numpy as np
import matplotlib.pyplot as plt

#make this example reproducible
np.random.seed(0)

#create beta distributed random variable with 200 values
data = np.random.beta(a=1, b=5, size=300)

#create log-transformed data
data_log = np.sqrt(data)

#define grid of plots
fig, axs = plt.subplots(nrows=1, ncols=2)

#create histograms
axs[0].hist(data, edgecolor='black')
axs[1].hist(data_log, edgecolor='black')

#add title to each histogram
axs[0].set_title('Original Data')
axs[1].set_title('Square Root Transformed Data')

Tài nguyên bổ sung

Biến đổi gốc khối trong Python

Tài nguyên bổ sungcube root transformation on a variable and create side-by-side plots to view the original distribution and the cube root transformed distribution of the data:

import numpy as np
import matplotlib.pyplot as plt

#make this example reproducible
np.random.seed(0)

#create beta distributed random variable with 200 values
data = np.random.beta(a=1, b=5, size=300)

#create log-transformed data
data_log = np.cbrt(data)

#define grid of plots
fig, axs = plt.subplots(nrows=1, ncols=2)

#create histograms
axs[0].hist(data, edgecolor='black')
axs[1].hist(data_log, edgecolor='black')

#add title to each histogram
axs[0].set_title('Original Data')
axs[1].set_title('Cube Root Transformed Data')

Làm thế nào để bạn tính toán chuyển đổi nhật ký?

Tài nguyên bổ sung

Làm thế nào để bạn tính toán chuyển đổi nhật ký?
How to Normalize Data in Python
What is the Assumption of Normality in Statistics?

Làm thế nào để bạn tính toán chuyển đổi nhật ký?

Làm thế nào để bạn chuyển đổi dữ liệu trong Python?f ( x ) = k + a log b ⁡ where a, b, k, and h are real numbers such that b is a positive number ≠ 1, and x - h > 0. A logarithmic function is transformed into the equation: f ( x ) = 4 + 3 log ⁡ .

Làm thế nào để bạn chuyển đổi dữ liệu trong Python?

Một cách để giải quyết vấn đề này là chuyển đổi phân phối các giá trị trong bộ dữ liệu bằng cách sử dụng một trong ba phép biến đổi:.

Bước 1: Nhập thư viện. #Thư viện quan sát. Nhập GANDAS dưới dạng PD. Nhập ngẫu nhiên. ....

Bước 2: Tạo DataFrame. Dữ liệu = pd. DataFrame ({'c': [ngẫu nhiên. ....

Bước 3: Sử dụng quy trình hợp nhất. %% timeit. dữ liệu. ....

Bước 4: Sử dụng hàm biến đổi. %% timeit. Dữ liệu ['N3'] = Dữ liệu ..

Biến đổi biến trong Python là gì?

Một biến đổi biến xác định một phép biến đổi được sử dụng cho một số giá trị của một biến. Theo các thuật ngữ khác, đối với mỗi đối tượng, cuộc cách mạng được sử dụng với giá trị của biến cho đối tượng đó.a transformation that is used to some values of a variable. In other terms, for every object, the revolution is used to the value of the variable for that object.